Skip to content
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

Allow Iceberg MV with partitioning transforms on timestamptz #16637

Merged
merged 4 commits into from
Mar 29, 2023

Conversation

findepi
Copy link
Member

@findepi findepi commented Mar 20, 2023

Allow creation of Iceberg Materialized Views partitioned with a
temporal partitioning function on a timestamp with time zone column.

In MVs, the timestamp with time zone columns are generally stored as
text to preserve time zone information. However, this prevents use of
temporal partitioning functions on these columns. The commit keeps
timestamp with time zone columns with partitioning applied on them as
timestamp with time zone in the storage table.

An obvious downside to this approach is that the time zone information
is erased and it is not known whether this aligns with user intention or
not. A better solution would be to introduce a point-in-time type
(#2273) to discern between the
cases where time zone information is important (like Java's
ZonedDateTime) from cases where only point-in-time matters (like
Java's Instant).

@cla-bot cla-bot bot added the cla-signed label Mar 20, 2023
@findepi findepi force-pushed the findepi/mv-partitioning-improvements branch from f9153a0 to 4664627 Compare March 20, 2023 16:06
@github-actions github-actions bot added the iceberg Iceberg connector label Mar 20, 2023
findepi added 2 commits March 20, 2023 22:27
`storageSchemaName` is defined on class level, so the storage schema
should be created in `@BeforeClass`, not within a test.
@findepi findepi force-pushed the findepi/mv-partitioning-improvements branch from 4664627 to 6ca801c Compare March 20, 2023 21:35
@findepi
Copy link
Member Author

findepi commented Mar 21, 2023

CI #13995, #16652 (new)

@findepi
Copy link
Member Author

findepi commented Mar 22, 2023

Build green (https://github.com/trinodb/trino/actions/runs/4481491874/jobs/7878270959?pr=16637).
Will force push for commit message fix.

@findepi findepi force-pushed the findepi/mv-partitioning-improvements branch from a289513 to 0dbd356 Compare March 22, 2023 17:00
@findepi findepi requested a review from losipiuk March 22, 2023 21:18
Allow creation of Iceberg Materialized Views partitioned with a
temporal partitioning function on a `timestamp with time zone` column.

In MVs, the `timestamp with time zone` columns are generally stored as
text to preserve time zone information. However, this prevents use of
temporal partitioning functions on these columns. The commit keeps
`timestamp with time zone` columns with partitioning applied on them as
`timestamp with time zone` in the storage table.

An obvious downside to this approach is that the time zone information
is erased and it is not known whether this aligns with user intention or
not. A better solution would be to introduce a point-in-time type
(#2273) to discern between the
cases where time zone information is important (like Java's
`ZonedDateTime`) from cases where only point-in-time matters (like
Java's `Instant`).
@findepi findepi force-pushed the findepi/mv-partitioning-improvements branch from 0dbd356 to 79c7c29 Compare March 23, 2023 14:50
They were probably copied over from the preceding backtick test case.
return new Object[][] {
{"year", "date", "DATE '2005-09-09'"},
{"year", "timestamp(6)", "TIMESTAMP '2005-09-10 13:31:00.123456'"},
{"year", "timestamp(6) with time zone", "TIMESTAMP '2005-09-10 13:00:00.123456 Europe/Warsaw'"},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the timestamp with time zone tests, can you add a second value that has the same time but in a different zone and show that works properly?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, a test with precision > 6?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, a test with precision > 6?

this is not supported

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add a second value that has the same time but in a different zone and show that works properly?

it wouldn't be any different. Europe/Warsaw is not test's JVM zone so it's not special

@findepi findepi merged commit 3540385 into master Mar 29, 2023
@findepi findepi deleted the findepi/mv-partitioning-improvements branch March 29, 2023 20:03
@findepi findepi mentioned this pull request Mar 29, 2023
@github-actions github-actions bot added this to the 411 milestone Mar 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed iceberg Iceberg connector
Development

Successfully merging this pull request may close these issues.

5 participants