diqiu50 commented on PR #12414:
URL: https://github.com/apache/gravitino/pull/12414#issuecomment-5338577133
An alternative that keeps the SparkCatalogKind split: move
GravitinoSparkPlugin into the version modules and have it build a bindings
object to pass to GravitinoDriverPlugin. The FQN stays the same, so
spark.plugins is unchanged for users; the bindings are keyed by
SparkCatalogKind and built from class literals, with Paimon as a string for the
reason it already is. The dependency then runs version module → shared code —
ordinary Java, with no import that resolves only after source-set composition.
Three things it buys:
- The authorization extension becomes a binding too. It is dispatched by
flavor file today only because the shared plugin names the class directly;
binding it leaves the spark35/spark40 same-name mechanism with Paimon as its
only remaining user.
- A missing binding surfaces earlier. Preconditions in the builder make "a
version module forgot the JDBC catalog" fail when the plugin is instantiated,
rather than the first time that provider is used.
- The dispatch becomes testable. A test can construct its own bindings and
assert what lands in spark.sql.catalog.*, independently of what the current
module ships.
Cost is a ~15-line GravitinoSparkPlugin per version module and one
constructor argument on GravitinoDriverPlugin.
--
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]