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

   ### What changes were proposed in this pull request?
   
   Add structured read and create support for `toStartOfWeek(column)` and 
`toStartOfMonth(column)` partition transforms by reusing the existing function 
transform. Loading preserves these forms as `ApplyTransform`; creating a table 
emits the corresponding ClickHouse function expression.
   
   ### Why are the changes needed?
   
   ClickHouse allows these common date partition expressions, but the catalog 
does not currently represent them as structured transforms for loaded tables or 
create them from Gravitino. Keeping the native functions intact supports 
metadata round trips without mapping them to a different transform.
   
   Fix: #13391
   
   ### Does this PR introduce any user-facing change?
   
   Yes. The ClickHouse catalog now supports the one-column forms 
`toStartOfWeek(column)` and `toStartOfMonth(column)` for MergeTree-family 
partitioning. The one-argument `toStartOfWeek(column)` form uses ClickHouse's 
default mode 0 (Sunday start) and the server timezone. Forms with explicit mode 
or timezone arguments and nested functions remain unstructured and are 
preserved through the read-only `partition-key` property.
   
   ### How was this patch tested?
   
   - `./gradlew :catalogs-contrib:catalog-jdbc-clickhouse:test -PskipITs 
--tests '*TestClickHouseTableOperationsPartitioning' --tests 
'*TestClickHouseTableOperationsUnit'` — 58 tests passed.
   - `./gradlew :catalogs-contrib:catalog-jdbc-clickhouse:test --tests 
'org.apache.gravitino.catalog.clickhouse.integration.test.CatalogClickHouseIT.testLoadAndCreateWithStartOfWeekAndMonthPartitionTransforms'
 -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` — 
passed.
   - `./gradlew rat` — 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