-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove docs about overriding current_timestamp type when Trino's iceberg implementation supports TIMESTAMP(3) #126
Comments
I just tried making a dbt snapshot with a dbt-trino connector that eventually end up in iceberg files.
I then modified the Do I get correctly from this thread and the one linked above that this problem will soon be resolved, and this modification to the |
I dove a bit deeper and had some additional issues with When using |
Note that current_timestamp already returns timestamp with time zone. See trino docs. To make it compatible with Iceberg you should just override the macro as mentioned in the docs.
|
Thanks! Indeed, the cast is unnecessary. Changed it in the PR. Do you think it makes sense to have Or does the above thread (linked in your original post) resolve the issue altogether? |
iMHO we shouldn't switch the default behaviour to suit Iceberg. Changing it will break behaviour for Delta and Hive. Ideally it is solved in the engine itself. I have filed a PR on Trino to fix this but it still under review. |
Ok, makes sense. Thanks a lot for following up so quickly! :) |
I found another case where this I believe that either there, or in https://github.com/dbt-labs/dbt-core/blob/main/core/dbt/include/global_project/macros/materializations/snapshots/helpers.sql#L11 , a part of this data type gets lost, because the query that's eventually run on starburst is So somewhere, this
Edit: I narrowed it down to:
While, when Is this a bug in |
Good find. I don't think |
I will, thank you! |
I don't think there is a bug in dbt-core. I think we now fill up char_size with the precision of time types while actually char_size is used for ensuring characters are not cut off and expanded. In the case of time types we should not alter the type. |
Ah indeed, it seems like dbt-trino/dbt/adapters/trino/column.py Lines 32 to 36 in fa901fa
is the culprit. I'm not sure why you're rebuilding the data type from the regex matches instead of passing on the raw one, @damian3031 ? |
The reason is that |
I think it will be safer to not alter the type if not string or numerical. I think dbt only widens string types. The variable name charsize seems also to point to that. |
So do you mean to extend this condition to sth like: if raw_data_type.startswith(("array", "map", "row", "date", "time", "interval", "boolean")):
return cls(name, raw_data_type) |
Yes, i would also invert the logic to only do the size detection for numeric and string types. |
Is there a spec somewhere that describes this? I find it a bit weird to chop the datatype in pieces 🤔 I'm using https://github.com/calogica/dbt-expectations/blob/main/macros/schema_tests/column_values_basic/expect_column_values_to_be_in_type_list.sql right now, and again failing because I have columns that are Could it be an option to fill in |
Btw I also have this problem with |
Hmmm, trino itself seems to indeed separate the datatype and precision: Then I guess dbt-expectations is wrong in only accessing |
Apparently, the solution is to use |
^ this is me discovering the difference between |
Once this Trino pr is merged, we can remove those docs. |
Describe the feature
The following issue in: Trino trinodb/trino#6658 requires us to override the current_timestap macro for the Iceberg catalog.
Once this issue is resolved, we can remove this documented limitation.
Describe alternatives you've considered
No response
Who will benefit?
No response
Are you willing to submit PR?
The text was updated successfully, but these errors were encountered: