[#11063] fix(lance): manage lance storage config in Gravitino #11070
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR centralizes Lance storage configuration in Gravitino catalog properties and updates Lance REST behavior to resolve storage options from catalog defaults when table-level values are absent, simplifying Spark/Lance integration while preserving per-table overrides.
Changes:
- Add Lance storage (
lance.storage.*) as a supported catalog-level property family in the generic lakehouse catalog. - Update Lance REST create/describe responses to resolve effective storage options from catalog + table properties (table overrides catalog).
- Update integration tests and docs to reflect catalog-managed storage configuration and reduced Spark-side config.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| lance/lance-rest-server/src/test/java/org/apache/gravitino/lance/integration/test/LanceSparkRESTServiceIT.java | Sets MinIO lance.storage.* on catalog creation in Spark REST IT flow. |
| lance/lance-rest-server/src/test/java/org/apache/gravitino/lance/integration/test/LanceRESTServiceIT.java | Adds IT coverage asserting REST responses include catalog-default storage options. |
| lance/lance-common/src/test/java/org/apache/gravitino/lance/common/utils/TestLancePropertiesUtils.java | Adds unit tests for extracting/resolving storage options from properties. |
| lance/lance-common/src/main/java/org/apache/gravitino/lance/common/utils/LancePropertiesUtils.java | Adds resolveLanceStorageOptions and improves storage-option extraction. |
| lance/lance-common/src/main/java/org/apache/gravitino/lance/common/ops/gravitino/GravitinoLanceTableOperations.java | Updates REST responses to return resolved (catalog+table) storage options. |
| docs/lance-rest-integration.md | Updates docs to recommend catalog-level storage config and keep per-table overrides. |
| docs/lakehouse-generic-lance-table.md | Updates MinIO section to describe catalog-level storage config; removes table-level example. |
| catalogs/catalog-lakehouse-generic/src/test/java/org/apache/gravitino/catalog/lakehouse/generic/TestPropertiesMetadata.java | Adds test asserting lance.storage.* is supported in catalog properties metadata. |
| catalogs/catalog-lakehouse-generic/src/main/java/org/apache/gravitino/catalog/lakehouse/generic/GenericCatalogPropertiesMetadata.java | Registers lance.storage.* prefix as a supported catalog property family. |
| catalogs/catalog-lakehouse-generic/src/main/java/org/apache/gravitino/catalog/lakehouse/generic/GenericCatalogOperations.java | Copies catalog-level Lance storage options into Lance table properties when absent. |
Code Coverage Report
Files
|
|
@yuqi1129 PTAL, thx |
| "The Lance storage options managed by the catalog.", | ||
| false /* immutable */, | ||
| null, /* defaultValue */ | ||
| false /* hidden */, |
| public void setCatalogProperties(Map<String, String> catalogProperties) { | ||
| this.catalogProperties = | ||
| catalogProperties == null ? Map.of() : ImmutableMap.copyOf(catalogProperties); | ||
| } |
| private ManagedTableOperations configureTableOps(ManagedTableOperations ops) { | ||
| if (ops instanceof LanceTableOperations) { | ||
| ((LanceTableOperations) ops).setCatalogProperties(catalogProperties); | ||
| } |
| Map<String, String> storageProps = | ||
| LancePropertiesUtils.resolveLanceStorageOptions(catalogProperties, properties); |
|
Updated in the latest commit:
I am leaving the secret/public property split for a follow-up because that is a broader catalog-property cleanup across the codebase, not specific to this Lance fix. WDYT?@yuqi |
It looks good to me. |
…pache#11070) ### What changes were proposed in this pull request? This PR moves Lance storage configuration into Gravitino-managed catalog properties and teaches Lance REST to use those catalog defaults when serving Spark clients. It removes the need to pass spark.sql.catalog.lance.storage.* in the demo path, while keeping table-level lance.storage.* overrides supported. ### Why are the changes needed? Spark currently has to repeat MinIO/S3 settings that are already known to Gravitino, which makes Lance integration verbose and error-prone. This change keeps Gravitino as the source of truth for Lance storage configuration and simplifies Spark usage for Gravitino-managed Lance catalogs. Fix: apache#11063 ### Does this PR introduce _any_ user-facing change? Yes. - lance.storage.* is now supported as a catalog-level property family for generic lakehouse catalogs. - Lance REST responses now resolve storage options from catalog defaults when table-level values are absent. - The Spark demo no longer requires explicit Lance storage conf entries. - Table-level lance.storage.* remains supported as an override. ### How was this patch tested? - ./gradlew :lance:lance-common:test --tests org.apache.gravitino.lance.common.utils.TestLancePropertiesUtils -PskipITs -PskipDockerTests=true - ./gradlew :catalogs:catalog-lakehouse-generic:test --tests org.apache.gravitino.catalog.lakehouse.generic.TestPropertiesMetadata -PskipITs -PskipDockerTests=true - ./gradlew :lance:lance-rest-server:compileTestJava -PskipITs -PskipDockerTests=true --------- Co-authored-by: fanng <“fanng@apache.org”>
…pache#11070) ### What changes were proposed in this pull request? This PR moves Lance storage configuration into Gravitino-managed catalog properties and teaches Lance REST to use those catalog defaults when serving Spark clients. It removes the need to pass spark.sql.catalog.lance.storage.* in the demo path, while keeping table-level lance.storage.* overrides supported. ### Why are the changes needed? Spark currently has to repeat MinIO/S3 settings that are already known to Gravitino, which makes Lance integration verbose and error-prone. This change keeps Gravitino as the source of truth for Lance storage configuration and simplifies Spark usage for Gravitino-managed Lance catalogs. Fix: apache#11063 ### Does this PR introduce _any_ user-facing change? Yes. - lance.storage.* is now supported as a catalog-level property family for generic lakehouse catalogs. - Lance REST responses now resolve storage options from catalog defaults when table-level values are absent. - The Spark demo no longer requires explicit Lance storage conf entries. - Table-level lance.storage.* remains supported as an override. ### How was this patch tested? - ./gradlew :lance:lance-common:test --tests org.apache.gravitino.lance.common.utils.TestLancePropertiesUtils -PskipITs -PskipDockerTests=true - ./gradlew :catalogs:catalog-lakehouse-generic:test --tests org.apache.gravitino.catalog.lakehouse.generic.TestPropertiesMetadata -PskipITs -PskipDockerTests=true - ./gradlew :lance:lance-rest-server:compileTestJava -PskipITs -PskipDockerTests=true --------- Co-authored-by: fanng <“fanng@apache.org”>
…pache#11070) ### What changes were proposed in this pull request? This PR moves Lance storage configuration into Gravitino-managed catalog properties and teaches Lance REST to use those catalog defaults when serving Spark clients. It removes the need to pass spark.sql.catalog.lance.storage.* in the demo path, while keeping table-level lance.storage.* overrides supported. ### Why are the changes needed? Spark currently has to repeat MinIO/S3 settings that are already known to Gravitino, which makes Lance integration verbose and error-prone. This change keeps Gravitino as the source of truth for Lance storage configuration and simplifies Spark usage for Gravitino-managed Lance catalogs. Fix: apache#11063 ### Does this PR introduce _any_ user-facing change? Yes. - lance.storage.* is now supported as a catalog-level property family for generic lakehouse catalogs. - Lance REST responses now resolve storage options from catalog defaults when table-level values are absent. - The Spark demo no longer requires explicit Lance storage conf entries. - Table-level lance.storage.* remains supported as an override. ### How was this patch tested? - ./gradlew :lance:lance-common:test --tests org.apache.gravitino.lance.common.utils.TestLancePropertiesUtils -PskipITs -PskipDockerTests=true - ./gradlew :catalogs:catalog-lakehouse-generic:test --tests org.apache.gravitino.catalog.lakehouse.generic.TestPropertiesMetadata -PskipITs -PskipDockerTests=true - ./gradlew :lance:lance-rest-server:compileTestJava -PskipITs -PskipDockerTests=true --------- Co-authored-by: fanng <“fanng@apache.org”>
What changes were proposed in this pull request?
This PR moves Lance storage configuration into Gravitino-managed catalog properties and teaches Lance REST to use those catalog defaults when serving Spark clients. It removes the need to pass spark.sql.catalog.lance.storage.* in the demo path, while keeping table-level lance.storage.* overrides supported.
Why are the changes needed?
Spark currently has to repeat MinIO/S3 settings that are already known to Gravitino, which makes Lance integration verbose and error-prone. This change keeps Gravitino as the source of truth for Lance storage configuration and simplifies Spark usage for Gravitino-managed Lance catalogs.
Fix: #11063
Does this PR introduce any user-facing change?
Yes.
How was this patch tested?