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

   ### What changes were proposed in this pull request?
   
   This PR manually backports #12016 to `branch-1.3` and supersedes the 
unresolved automated cherry-pick PR #12684.
   
   - Read table sort orders from the canonical `system.tables.sorting_key` 
field instead of parsing `ORDER BY` from the full `SHOW CREATE TABLE` output.
   - Read table-level Settings from `system.tables.engine_full`, preventing 
projection-level `WITH SETTINGS` clauses from being exposed as table properties.
   - Keep the existing `SHOW CREATE TABLE` path only for partition metadata and 
preserve the engine-parameter behavior already backported by #12672.
   - Add focused unit coverage for the exact metadata query, expression 
conversion, blank values, Settings, and missing rows, plus a real ClickHouse 
projection regression test.
   
   The manual conflict resolution starts from the latest `branch-1.3`, retains 
#12672, and excludes the unrelated enum round-trip test that exists only on the 
source branch.
   
   ### Why are the changes needed?
   
   When a ClickHouse table contains a projection with its own `ORDER BY`, 
parsing the complete `SHOW CREATE TABLE` output can select the projection's 
`ORDER BY` instead of the table-level sorting key. Gravitino then returns 
incorrect sort-order metadata without reporting an error.
   
   The automated backport was generated before the dependent engine-parameter 
change reached `branch-1.3`, so its three-way cherry-pick produced unresolved 
conflicts in the ClickHouse implementation and tests.
   
   Fix: #11972
   
   ### Does this PR introduce _any_ user-facing change?
   
   No public API or property key changes are introduced. Loading a ClickHouse 
table with projections now returns the correct table-level sort orders while 
preserving the existing `settings.*` property contract.
   
   ### How was this patch tested?
   
   - `./gradlew :catalogs-contrib:catalog-jdbc-clickhouse:spotlessCheck` — 
passed.
   - `./gradlew rat` — passed.
   - `./gradlew :catalogs-contrib:catalog-jdbc-clickhouse:test --tests 
org.apache.gravitino.catalog.clickhouse.operations.TestClickHouseTableOperationsUnit
 -PskipITs -PskipDockerTests=true` — passed.
   - `./gradlew :catalogs-contrib:catalog-jdbc-clickhouse:test -PskipITs 
-PskipDockerTests=true` — passed.
   - `./gradlew :catalogs-contrib:catalog-jdbc-clickhouse:test --tests 
org.apache.gravitino.catalog.clickhouse.integration.test.CatalogClickHouseIT 
-PskipDockerTests=false` — 52 tests, 0 skipped, 0 failures, 0 errors; 
`testLoadTableWithProjectionUsesTableSortKey` executed successfully.
   - `./gradlew :catalogs-contrib:catalog-jdbc-clickhouse:test --tests 
org.apache.gravitino.catalog.clickhouse.integration.test.CatalogClickHouseClusterIT
 -PskipDockerTests=false` — 17 tests, 0 skipped, 0 failures, 0 errors.
   - `./gradlew :catalogs-contrib:catalog-jdbc-clickhouse:build -x test` — 
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