Skip to content

[fix](iceberg) Allow disabling REST catalog view operations#62986

Open
xylaaaaa wants to merge 1 commit intoapache:masterfrom
xylaaaaa:codex/fix-iceberg-rest-view-toggle
Open

[fix](iceberg) Allow disabling REST catalog view operations#62986
xylaaaaa wants to merge 1 commit intoapache:masterfrom
xylaaaaa:codex/fix-iceberg-rest-view-toggle

Conversation

@xylaaaaa
Copy link
Copy Markdown
Contributor

@xylaaaaa xylaaaaa commented May 1, 2026

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 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.

Check List

  • mvn -pl fe-core -am -Dtest=IcebergRestPropertiesTest,IcebergMetadataOpTest -Dcheckstyle.skip=true -DfailIfNoTests=false -Dmaven.build.cache.enabled=false test

Copilot AI review requested due to automatic review settings May 1, 2026 09:03
@hello-stephen
Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 (default true) in IcebergRestProperties.
  • Gates view-related calls in IcebergMetadataOps behind 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.

Comment on lines +1213 to 1215
if (!isViewCatalogEnabled()) {
throw new DdlException("Drop Iceberg view is not supported with not view catalog.");
}
Copy link

Copilot AI May 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
@xylaaaaa
Copy link
Copy Markdown
Contributor Author

xylaaaaa commented May 1, 2026

run buildall

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants