You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gravitino.apache.org by "jiangxt2 (via GitHub)" <gi...@apache.org> on 2026/08/31 07:19:37 UTC

[PR] [#12736] fix(doris): validate ADD INDEX fields [gravitino]

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

   ### What changes were proposed in this pull request?
   
   This pull request adds a Doris-specific field-shape validator shared by CREATE TABLE index generation and ALTER TABLE ADD INDEX. The validator requires exactly one non-blank top-level field and returns that validated field for SQL generation.
   
   It also adds focused tests for valid index SQL, malformed field shapes, consistent CREATE and ALTER validation, the no-JDBC-statement failure path, and the real Doris 4.x ADD/DROP INDEX lifecycle.
   
   ### Why are the changes needed?
   
   The Doris ALTER ADD INDEX path currently reads only `getFieldNames()[0][0]`. When a request contains multiple fields or a nested field path, Gravitino silently discards the remaining components and can create a valid single-column Doris index that does not match the request.
   
   Rejecting unsupported field shapes before DDL generation prevents this semantic truncation and makes CREATE and ALTER enforce the same Doris connector contract. Valid single-field index SQL and existing key-model behavior remain unchanged.
   
   Fix: #12736
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes. Doris CREATE TABLE and ALTER TABLE ADD INDEX requests containing multiple fields, nested field paths, empty field shapes, or blank field names now fail with an explicit `IllegalArgumentException` instead of being truncated or producing invalid SQL. Valid single-field index operations are unchanged, and no public API or property key is added or removed.
   
   ### How was this patch tested?
   
   - `./gradlew :catalogs:catalog-jdbc-doris:spotlessCheck`
   - `./gradlew rat`
   - `./gradlew :catalogs:catalog-jdbc-doris:test -PskipITs`
   - `./gradlew :catalogs:catalog-jdbc-doris:test --tests 'org.apache.gravitino.catalog.doris.integration.test.CatalogDoris4xIT.testAddAndDropInvertedIndex' -PskipDockerTests=false -PdorisMultiVersionTest`
   - `./gradlew :catalogs:catalog-jdbc-doris:build -x test`
   


-- 
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: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [#12736] fix(doris): validate ADD INDEX fields [gravitino]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #12737:
URL: https://github.com/apache/gravitino/pull/12737#issuecomment-5475952192

   <!-- coverage-report -->
   ### Code Coverage Report
   |Overall Project|68.54% **`+0.09%`**|:green_circle:|
   |:-|:-|:-:|
   |Files changed|82.85%|:green_circle:|
   <br>
   
   |Module|Coverage||
   |:-|:-|:-:|
   |aliyun|19.74%|:red_circle:|
   |api|52.09%|:green_circle:|
   |authorization-common|85.96%|:green_circle:|
   |authorization-ranger|4.38%|:red_circle:|
   |aws|53.54%|:green_circle:|
   |azure|32.1%|:red_circle:|
   |catalog-common|9.9%|:red_circle:|
   |catalog-fileset|80.3%|:green_circle:|
   |catalog-glue|69.24%|:green_circle:|
   |catalog-hive|82.96%|:green_circle:|
   |catalog-jdbc-common|45.69%|:green_circle:|
   |catalog-jdbc-doris|82.69% **`+2.28%`**|:green_circle:|
   |catalog-jdbc-mysql|79.33%|:green_circle:|
   |catalog-jdbc-postgresql|83.39%|:green_circle:|
   |catalog-jdbc-starrocks|79.16%|:green_circle:|
   |catalog-kafka|76.99%|:green_circle:|
   |catalog-lakehouse-generic|60.55%|:green_circle:|
   |catalog-lakehouse-hudi|79.1%|:green_circle:|
   |catalog-lakehouse-iceberg|85.93%|:green_circle:|
   |catalog-lakehouse-paimon|84.26%|:green_circle:|
   |catalog-model|77.99%|:green_circle:|
   |cli|44.48%|:green_circle:|
   |client-java|77.44%|:green_circle:|
   |common|55.5%|:green_circle:|
   |core|83.59% **`-0.04%`**|:green_circle:|
   |filesystem-hadoop3|76.45%|:green_circle:|
   |flink|0.0%|:red_circle:|
   |flink-common|50.29%|:green_circle:|
   |flink-runtime|0.0%|:red_circle:|
   |gcp|32.2%|:red_circle:|
   |hadoop-auth|68.0%|:green_circle:|
   |hadoop-common|17.84%|:red_circle:|
   |hive-metastore-common|53.4%|:green_circle:|
   |iceberg-aliyun-bundle|0.0%|:red_circle:|
   |iceberg-common|64.75%|:green_circle:|
   |iceberg-rest-server|75.96%|:green_circle:|
   |idp-basic|85.98%|:green_circle:|
   |integration-test-common|0.0%|:red_circle:|
   |jobs|62.92%|:green_circle:|
   |lance-common|32.63%|:red_circle:|
   |lance-rest-server|65.46%|:green_circle:|
   |lineage|53.02%|:green_circle:|
   |optimizer|83.24%|:green_circle:|
   |optimizer-api|21.95%|:red_circle:|
   |server|88.11%|:green_circle:|
   |server-common|80.5%|:green_circle:|
   |spark|28.57%|:red_circle:|
   |spark-common|48.92%|:green_circle:|
   |tencent|69.84%|:green_circle:|
   |trino-connector|47.44%|:green_circle:|
   
   <details>
   <summary>Files</summary>
   
   |Module|File|Coverage||
   |:-|:-|:-|:-:|
   |catalog-jdbc-doris|[DorisTableOperations.java](https://github.com/jiangxt2/gravitino/blob/9ac03d5ade4c22bd301307946d80209213ff2912/catalogs/catalog-jdbc-doris/src/main/java/org/apache/gravitino/catalog/doris/operation/DorisTableOperations.java)|84.91%|:green_circle:|
   |core|[AsyncQueueListener.java](https://github.com/jiangxt2/gravitino/blob/9ac03d5ade4c22bd301307946d80209213ff2912/core/src/main/java/org/apache/gravitino/listener/AsyncQueueListener.java)|66.18%|:green_circle:|
   
   </details>


-- 
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: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [#12736] fix(doris): validate ADD INDEX fields [gravitino]

Posted by "yuqi1129 (via GitHub)" <gi...@apache.org>.
yuqi1129 merged PR #12737:
URL: https://github.com/apache/gravitino/pull/12737


-- 
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: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org