[fix](iceberg) Allow disabling REST catalog view operations - #62986
Conversation
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
There was a problem hiding this comment.
Pull request overview
Adds a REST-catalog-specific switch to skip Iceberg view operations so Doris can still list/load tables against REST catalog implementations that don’t support (or reject) view APIs.
Changes:
- Introduces
iceberg.rest.view-enabled(defaulttrue) inIcebergRestProperties. - Gates view-related calls in
IcebergMetadataOpsbehind the new property for REST catalogs. - Adds unit tests covering the property behavior and verifying
listViews()is skipped when disabled.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| fe/fe-core/src/main/java/org/apache/doris/datasource/property/metastore/IcebergRestProperties.java | Adds the new REST property and accessor (isIcebergRestViewEnabled()). |
| fe/fe-core/src/main/java/org/apache/doris/datasource/iceberg/IcebergMetadataOps.java | Centralizes view capability logic via isViewCatalogEnabled() and uses it to guard view operations. |
| fe/fe-core/src/test/java/org/apache/doris/datasource/property/metastore/IcebergRestPropertiesTest.java | Tests default enabled behavior and the false override. |
| fe/fe-core/src/test/java/org/apache/doris/datasource/iceberg/IcebergMetadataOpTest.java | Verifies listTableNames() skips listViews() when view ops are disabled for REST. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if (!isViewCatalogEnabled()) { | ||
| throw new DdlException("Drop Iceberg view is not supported with not view catalog."); | ||
| } |
There was a problem hiding this comment.
The DdlException message here becomes misleading when view ops are disabled via iceberg.rest.view-enabled=false: isViewCatalogEnabled() can return false even though catalog is a ViewCatalog. Consider updating the message (or branching) to indicate that view operations are disabled by configuration, not that the catalog lacks ViewCatalog support.
|
run buildall |
|
run buildall |
|
PR approved by at least one committer and no changes requested. |
|
PR approved by anyone and no changes requested. |
…2986) Some Iceberg REST catalog implementations expose table APIs but fail or reject view APIs. Doris currently calls `ViewCatalog.listViews()` while listing tables when the underlying Iceberg catalog implements `ViewCatalog`, so `SHOW TABLES` and table metadata loading can fail even when table listing/loading works. This PR adds a REST catalog property to disable view operations when needed, while keeping the existing default behavior enabled. ### Changes - Add `iceberg.rest.view-enabled` to `IcebergRestProperties`, defaulting to `true`. - Gate Iceberg view operations in `IcebergMetadataOps` for REST catalogs when the property is set to `false`. - Add unit coverage for the new property and for skipping `listViews()` in table listing.
…ns (#63320) ### What problem does this PR solve? Issue Number: None Related PR: #62986 Problem Summary: Backport #62986 to branch-4.1. This allows Iceberg REST catalog users to disable view operations with `iceberg.rest.view-enabled=false` when the REST catalog does not support view endpoints. The default remains enabled. ### Release note Add `iceberg.rest.view-enabled` for Iceberg REST catalog. It defaults to true and can be set to false to skip view operations. ### Check List (For Author) - Test <!-- At least one of them must be included. --> - [ ] Regression test - [x] Unit Test - [ ] Manual test (add detailed scripts or steps below) - [ ] No need to test or manual test. Explain why: - [ ] This is a refactor/code format and no logic has been changed. - [ ] Previous test can cover this change. - [ ] No code files have been changed. - [ ] Other reason <!-- Add your reason? --> - Behavior changed: - [ ] No. - [x] Yes. Add an opt-out switch for Iceberg REST catalog view operations; default behavior is unchanged. - Does this need documentation? - [x] No. - [ ] Yes. <!-- Add document PR link here. eg: apache/doris-website#1214 --> ### Check List (For Reviewer who merge this PR) - [ ] Confirm the release note - [ ] Confirm test cases - [ ] Confirm document - [ ] Add branch pick label <!-- Add branch pick label that this PR should merge into --> ### Test - `MAVEN_OPTS='-Xmx4g -XX:MaxMetaspaceSize=1g' FE_UT_PARALLEL=1 ./run-fe-ut.sh --run org.apache.doris.datasource.iceberg.IcebergMetadataOpTest,org.apache.doris.datasource.property.metastore.IcebergRestPropertiesTest`
What problem does this PR solve?
Some Iceberg REST catalog implementations expose table APIs but fail or reject view APIs. Doris currently calls
ViewCatalog.listViews()while listing tables when the underlying Iceberg catalog implementsViewCatalog, soSHOW TABLESand table metadata loading can fail even when table listing/loading works.This PR adds a REST catalog property to disable view operations when needed, while keeping the existing default behavior enabled.
Changes
iceberg.rest.view-enabledtoIcebergRestProperties, defaulting totrue.IcebergMetadataOpsfor REST catalogs when the property is set tofalse.listViews()in table listing.Check List
mvn -pl fe-core -am -Dtest=IcebergRestPropertiesTest,IcebergMetadataOpTest -Dcheckstyle.skip=true -DfailIfNoTests=false -Dmaven.build.cache.enabled=false test