hutiefang76 opened a new pull request, #11878:
URL: https://github.com/apache/gravitino/pull/11878

   ### What changes were proposed in this pull request?
   
   Fix ClickHouse partition expression round-tripping for day transforms and 
nested date wrappers:
   
   - format Gravitino day transforms as `toYYYYMMDD(column)` instead of 
`toDate(column)`
   - parse `toYYYYMMDD(column)` back to a day transform
   - unwrap a supported `toDate(...)` wrapper when parsing expressions such as 
`toYYYYMM(toDate(event_time))`
   - update the ClickHouse catalog documentation for supported partition 
functions
   
   ### Why are the changes needed?
   
   Fixes #11841.
   
   Without this change, a ClickHouse partition expression like 
`toYYYYMM(toDate(event_time))` is parsed with `toDate(event_time)` as the field 
name. Also, day transforms are formatted as `toDate(...)`, which does not 
round-trip cleanly with the ClickHouse day partition form described in the 
issue.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes. ClickHouse day partition transforms are now generated as 
`toYYYYMMDD(column)`. Existing `toDate(column)` partition expressions are still 
accepted when reading metadata.
   
   ### How was this patch tested?
   
   - `JAVA_HOME=$(/usr/libexec/java_home -v 17) ./gradlew 
:catalogs-contrib:catalog-jdbc-clickhouse:test --tests 
org.apache.gravitino.catalog.clickhouse.operations.TestClickHouseTableOperationsPartitioning
 -PskipITs`
   - `JAVA_HOME=$(/usr/libexec/java_home -v 17) ./gradlew 
:catalogs-contrib:catalog-jdbc-clickhouse:spotlessCheck -PskipITs`
   - `git diff --check`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to