yuqi1129 commented on code in PR #14755:
URL: https://github.com/apache/gravitino/pull/14755#discussion_r4563437520
##########
spark-connector/spark-common/src/main/java/org/apache/gravitino/spark/connector/plugin/restcatalog/GravitinoLakehouseRESTDiscoveryDriverPlugin.java:
##########
@@ -105,6 +116,18 @@ void initialize(SparkConf sparkConf, Map<String, String>
providerClassNames) {
validateProviderRuntime(provider, classLoader);
Map<String, String> globalProperties =
extractCatalogProperties(userConf, format);
+ if ("lance".equals(format)
Review Comment:
Keeping these hooks on the provider makes sense. My remaining concern is
that someone implementing a new provider cannot tell from the current Javadoc
when to override each method or what the caller guarantees. Please document the
contract in the interface Javadoc, with a short call-flow comment in the driver
if useful:
- `normalizeCatalogProperties`: called separately for global user properties
and per-catalog overrides. Each input may be empty or contain only a partial
configuration; this is not validation of the complete effective catalog
configuration. Explain that it mutates the supplied map, should be idempotent,
and must not inject defaults. For example, requiring all mandatory properties
here would incorrectly reject an otherwise valid per-catalog override
containing only one header.
- `applyCatalogDefaults`: called on normalized global properties before
discovery. It should fill missing values without replacing explicit values. The
resulting properties are used for discovery and inherited by auto-registered
catalogs; this hook is not called separately on each catalog's overrides.
Explain how `authType` and the nullable `sparkUser` are intended to be used,
and that providers needing no such defaults can retain the no-op implementation.
- Explain the distinction from `generatedCatalogProperties(uri,
discoveredCatalogName)`, which supplies catalog-specific properties during
registration. Also clarify that defaults/generated properties must use the
provider's canonical keys, since the driver does not normalize the final merged
map again.
Please make the order explicit: normalize globals → apply global defaults →
list catalogs; then, for each catalog being registered, generate
catalog-specific properties, normalize its explicit overrides, and merge with
precedence `per-catalog overrides > generated properties > global properties
(including defaults)`. Document how validation failures are reported as well.
This is a request to clarify the existing extension contract, not to undo
the refactor or introduce another abstraction. A new provider author should not
need to read the Lance implementation and driver internals to use these methods
correctly.
--
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]