jiangxt2 opened a new pull request, #12919: URL: https://github.com/apache/gravitino/pull/12919
### What changes were proposed in this pull request? This pull request makes the Doris metadata read path fail closed for native NGRAM_BF indexes instead of mapping them to unrelated existing index types. - Add an explicit NGRAM_BF branch in `mapDorisIndexType()` that throws `UnsupportedOperationException` with the index name and normalized native type. - Read `Index_type` once in `getIndexes()` and give NGRAM_BF detection precedence over the legacy `PRIMARY` name mapping, while preserving that mapping for every other native type. - Add focused unit coverage and real Doris 3.0.6.2 and 4.0.6 integration coverage for fail-closed behavior, safe error context, unchanged native index type and properties, and the existing INVERTED mapping. - Document the temporary unsupported boundary. ### Why are the changes needed? Doris exposes NGRAM_BF as a distinct native index type with `gram_size` and `bf_size` properties. Gravitino currently has no matching index representation, so an ordinary index name falls through to INVERTED while the legacy `PRIMARY` name mapping returns PRIMARY_KEY. Both paths drop the native semantics and properties. Rejecting the recognized but unrepresentable metadata prevents callers from receiving a fabricated index definition while keeping unrelated compatibility behavior unchanged. Fix: #12916 ### Does this PR introduce _any_ user-facing change? Yes. Loading a Doris table that contains a native NGRAM_BF index now throws `UnsupportedOperationException` instead of returning an unrelated existing index type. The error identifies the schema, table, index, and native type without including native index properties. There is no public API, enum, property-key, CREATE TABLE, or ALTER behavior change. Existing mappings for BTREE, INVERTED, BITMAP, BLOOMFILTER, and ANN remain unchanged, as does the generic fallback for unrelated unknown Doris index types. ### How was this patch tested? - `./gradlew :catalogs:catalog-jdbc-doris:spotlessCheck` — passed. - `./gradlew rat` — passed. - `./gradlew :catalogs:catalog-jdbc-doris:test -PskipITs` — 35 tests passed, 0 skipped, 0 failures, 0 errors. - `./gradlew :catalogs:catalog-jdbc-doris:test --tests 'org.apache.gravitino.catalog.doris.integration.test.CatalogDoris3xIT.testNativeNgramBfIndexFailsClosed' --tests 'org.apache.gravitino.catalog.doris.integration.test.CatalogDoris3xIT.testCreateTableWithInvertedIndex' -PskipDockerTests=false -PdorisMultiVersionTest` — Doris 3.0.6.2: 2 tests passed, 0 skipped, 0 failures, 0 errors. - `./gradlew :catalogs:catalog-jdbc-doris:test --tests 'org.apache.gravitino.catalog.doris.integration.test.CatalogDoris4xIT.testNativeNgramBfIndexFailsClosed' --tests 'org.apache.gravitino.catalog.doris.integration.test.CatalogDoris4xIT.testCreateTableWithInvertedIndex' -PskipDockerTests=false -PdorisMultiVersionTest` — Doris 4.0.6: 2 tests passed, 0 skipped, 0 failures, 0 errors. - `./gradlew :catalogs:catalog-jdbc-doris: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]
