Partition Column transform support for Year, Month, Day & Hour#21303
Partition Column transform support for Year, Month, Day & Hour#21303tdcmeehan merged 1 commit intoprestodb:masterfrom
Conversation
steveburnett
left a comment
There was a problem hiding this comment.
Thanks for the documentation! I made suggestions for consistency with examples earlier in the page, and a very small formatting error.
If my rephrasing suggestions change your intended meaning in a way you disagree with, let me know and I'm happy to discuss it.
90b4690 to
29c39ca
Compare
steveburnett
left a comment
There was a problem hiding this comment.
My apologies! I overlooked this single edit but I focused on the code block edit. I should have included this suggested change in yesterday's review. This is everything, no other suggestions.
29c39ca to
a19eff2
Compare
steveburnett
left a comment
There was a problem hiding this comment.
LGTM! (docs)
Thanks!
6da5a77 to
0e3fde1
Compare
|
Codenotify: Notifying subscribers in CODENOTIFY files for diff 038ff56...b7c6bff.
|
steveburnett
left a comment
There was a problem hiding this comment.
(redoing review because CODENOTIFY pinged me)
LGTM! (docs)
New local build of docs, everything looks great.
presto-iceberg/src/main/java/com/facebook/presto/iceberg/PartitionTransforms.java
Outdated
Show resolved
Hide resolved
0e3fde1 to
ef75f7b
Compare
steveburnett
left a comment
There was a problem hiding this comment.
Nice work! Two very small nits to consider.
ef75f7b to
93f2094
Compare
93f2094 to
012549c
Compare
hantangwangd
left a comment
There was a problem hiding this comment.
There are some problems when calculating partition values.
presto-iceberg/src/main/java/com/facebook/presto/iceberg/PartitionTransforms.java
Outdated
Show resolved
Hide resolved
presto-iceberg/src/test/java/com/facebook/presto/iceberg/IcebergDistributedSmokeTestBase.java
Outdated
Show resolved
Hide resolved
steveburnett
left a comment
There was a problem hiding this comment.
LGTM! (docs)
Thanks!
presto-iceberg/src/test/java/com/facebook/presto/iceberg/IcebergDistributedSmokeTestBase.java
Outdated
Show resolved
Hide resolved
012549c to
b7c6bff
Compare
hantangwangd
left a comment
There was a problem hiding this comment.
LGTM! Thanks for the fix.
| assertUpdate("INSERT INTO " + tableName + " VALUES (3, date '1970-10-01'), (4, date '1971-11-05')", 2); | ||
|
|
||
| assertQuery("SELECT c2_day, row_count, file_count FROM " + "\"" + tableName + "$partitions\" ORDER BY c2_day", | ||
| "VALUES ('1970-10-01', 1, 1), ('1971-11-05', 1, 1), ('2022-10-01', 1, 1), ('2023-11-02', 1, 1)"); |
There was a problem hiding this comment.
I am a bit confused. According to the spec, partition transform by day should return an integer. Shouldn't c2_day then return the number of days from 1970-01-01, not the string date?
There was a problem hiding this comment.
It seems that Iceberg implementation has special treatment for partition function day. Referring to the codes in function org.apache.iceberg.transforms.Dates.getResultType().
There was a problem hiding this comment.
You are correct. I raised apache/iceberg#9345 to fix this.
Description
Presto issue #20570
Motivation and Context
Beyond selecting a particular column to partition by, you can select a “transform” and partition the table by the transformed value of the column.
Available in Iceberg include: https://iceberg.apache.org/spec/#partition-specs
Day, Month, Year, Hour, Bucket, Truncate
Presto Iceberg Connector currently already supports Bucket & Truncate transform with partition column in Iceberg Table. This feature request is to add transform support for Day, Month, Year, Hour
Impact
Test Plan
Contributor checklist
Release Notes
Please follow release notes guidelines and fill in the release notes below.