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

   ### What changes were proposed in this pull request?
   
   Update the Doris JDBC catalog so `TableChange.deleteIndex(name, true)` 
treats a missing index as a no-op without emitting a DROP fragment, while 
preserving strict missing-index validation and existing-index deletion.
   
   Validate index changes before metadata loading or SQL generation so 
duplicate DeleteIndex changes and same-name AddIndex/DeleteIndex changes fail 
fast in either request order with deterministic errors.
   
   Filter empty fragments from the combined Doris `ALTER TABLE` statement and 
add unit, operation, and Doris 3.x/4.x integration coverage for the 
missing/existing index matrix, mixed no-op requests, conflict requests, and 
missing-table error propagation.
   
   ### Why are the changes needed?
   
   The Doris implementation currently skips its local existence check when 
`ifExists=true` but still generates `DROP INDEX` inside the combined `ALTER 
TABLE` statement. Doris then rejects a missing index, which violates the public 
`TableChange.DeleteIndex` contract and prevents idempotent cleanup operations.
   
   The change keeps the connector's existing batched ALTER model and does not 
assume undocumented `ALTER TABLE ... DROP INDEX IF EXISTS` syntax. It also 
prevents a no-op delete from masking same-name conflicting index changes or 
unrelated validation failures.
   
   Fix: #12827
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes. Deleting a missing Doris index with `ifExists=true` now succeeds as a 
no-op. Existing-index deletion and `ifExists=false` strict behavior remain 
unchanged. Duplicate deletes and same-name AddIndex/DeleteIndex requests are 
rejected before DDL execution. No public API, OpenAPI field, or property key is 
added or removed.
   
   ### How was this patch tested?
   
   - `./gradlew :catalogs:catalog-jdbc-doris:test -PskipITs` — passed; 38 
tests, 0 skipped, 0 failures, 0 errors.
   - `./gradlew :catalogs:catalog-jdbc-doris:test --tests 
"org.apache.gravitino.catalog.doris.operation.TestDorisTableOperations" 
-PskipDockerTests=false` — passed; 9 tests, 0 skipped, 0 failures, 0 errors.
   - `env NEED_CREATE_DOCKER_NETWORK=false ./gradlew 
:catalogs:catalog-jdbc-doris:test --tests 
"org.apache.gravitino.catalog.doris.integration.test.CatalogDoris3xIT" 
-PskipDockerTests=false -PdorisMultiVersionTest` — passed on Doris 3.0.6.2; 15 
tests, 0 skipped, 0 failures, 0 errors.
   - `env NEED_CREATE_DOCKER_NETWORK=false ./gradlew 
:catalogs:catalog-jdbc-doris:test --tests 
"org.apache.gravitino.catalog.doris.integration.test.CatalogDoris4xIT" 
-PskipDockerTests=false -PdorisMultiVersionTest` — passed on Doris 4.0.6; 15 
tests, 0 skipped, 0 failures, 0 errors.
   - `./gradlew :catalogs:catalog-jdbc-doris:spotlessCheck` — passed.
   - `./gradlew rat` — passed.
   - `./gradlew :catalogs:catalog-jdbc-doris:build -x test` — passed.
   - The local-only Gravitino precheck passed.
   - The first Doris 3.x attempt was blocked during test-network initialization 
by an unrelated active endpoint; the recovery run used the isolated network 
environment shown above and 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