s4ravanan opened a new pull request, #13509:
URL: https://github.com/apache/gravitino/pull/13509
### What changes were proposed in this pull request?
- **Spark Connector**: In `SparkCatalogKind`, replaced the generic
`startsWith("jdbc")` fallback with an explicit mapping for supported generic
JDBC providers (`jdbc-mysql`, `jdbc-doris`, `jdbc-starrocks`,
`jdbc-oceanbase`), returning `null` for any unknown `jdbc-*` providers so
registration fails fast/is skipped instead of silently falling back to the
generic JDBC catalog.
- **Flink Connector**: In `GravitinoCatalogStore`, updated the catalog
factory matching error to name the provider and mention that it may be served
by a separate extension jar.
- **Trino Connector**: In `DefaultCatalogConnectorFactory`, updated the
unsupported catalog provider error message to mention that it may be served by
a separate extension jar.
- Added and updated unit tests covering supported and unsupported providers
across Spark, Flink, and Trino.
### Why are the changes needed?
Previously, when no extension served a provider, Spark mapped every `jdbc-*`
provider (except `jdbc-postgresql`) to generic JDBC catalog by prefix match.
When a dedicated catalog extension jar was missing, providers like ClickHouse
or Hologres registered silently with the generic MySQL JDBC catalog, resulting
in misleading type or DDL errors deep inside Spark. Furthermore, Flink and
Trino error messages did not mention that the provider might be served by a
separate extension jar, and Flink omitted the provider name entirely.
Fix: #13269
### Does this PR introduce _any_ user-facing change?
Yes. Unsupported `jdbc-*` catalogs without an extension will now be skipped
in Spark rather than silently bound to the generic MySQL JDBC catalog. Error
messages in Flink and Trino now provide clearer diagnostic information.
### How was this patch tested?
- Unit tests in `TestSparkCatalogKind` and `TestGravitinoDriverPlugin`
tested against `:spark-connector:spark-3.5:test` and
`:spark-connector:spark-4.0:test`.
- Unit tests in `TestGravitinoCatalogStore` tested against
`:flink-connector:flink-common:test`.
- Unit tests in `TestDefaultCatalogConnectorFactory` tested against
`:trino-connector:trino-connector: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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]