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

   ### What changes were proposed in this pull request?
   
   Add structured read and create support for the one-column ClickHouse 
partition expressions `toStartOfQuarter(column)` and `toStartOfYear(column)`. 
When these tables are loaded, the catalog preserves the function name and 
column reference in a function transform; when tables are created, it emits the 
corresponding ClickHouse expression.
   
   ### Why are the changes needed?
   
   ClickHouse MergeTree tables can use these calendar boundary functions in 
`PARTITION BY`, but the ClickHouse catalog currently leaves them unstructured 
and exposes the native expressions only through the read-only `partition-key` 
property. This prevents clients from handling quarter- and year-based 
partitions through structured metadata across load and create workflows.
   
   Fix: #13490
   
   ### Does this PR introduce any user-facing change?
   
   Yes. The ClickHouse catalog now supports one-column 
`toStartOfQuarter(column)` and `toStartOfYear(column)` partition transforms for 
MergeTree-family tables. Calls with additional arguments, nested functions, and 
other unsupported expressions remain unstructured and are preserved through the 
read-only `partition-key` property.
   
   ### How was this patch tested?
   
   The equivalent Gradle 8.2 tasks passed using Corretto 17.0.18:
   
   - `./gradlew :catalogs-contrib:catalog-jdbc-clickhouse:test -PskipITs 
--tests '*TestClickHouseTableOperationsPartitioning' --tests 
'*TestClickHouseTableOperationsUnit'` — passed.
   - `./gradlew :catalogs-contrib:catalog-jdbc-clickhouse:test --tests 
'org.apache.gravitino.catalog.clickhouse.integration.test.CatalogClickHouseIT.testLoadAndCreateWithStartOfDatePartitionTransforms'
 -PskipDockerTests=false` — 1 test passed.
   - `./gradlew :catalogs-contrib:catalog-jdbc-clickhouse:test --tests 
'org.apache.gravitino.catalog.clickhouse.integration.test.CatalogClickHouseClusterIT'
 -PskipDockerTests=false` — 20 tests passed.
   - `./gradlew :catalogs-contrib:catalog-jdbc-clickhouse:spotlessCheck rat` — 
passed.
   - `git diff --check` — passed.
   


-- 
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