Skip to content

Default PURGE_VIEW_METADATA_ON_DROP to false so views can be dropped out of the box - #5335

Closed
zhang-arvin wants to merge 2 commits into
apache:mainfrom
zhang-arvin:fix/view-drop-default-config
Closed

Default PURGE_VIEW_METADATA_ON_DROP to false so views can be dropped out of the box#5335
zhang-arvin wants to merge 2 commits into
apache:mainfrom
zhang-arvin:fix/view-drop-default-config

Conversation

@zhang-arvin

Copy link
Copy Markdown

Fixes: #5293

Problem

The default values of DROP_WITH_PURGE_ENABLED (false) and PURGE_VIEW_METADATA_ON_DROP (true) were incompatible: dropping a view derived purge=true from the view flag, but the guard rejected purge=true because the table flag was off. As a result, views could not be dropped under the default configuration, returning a 403 ForbiddenException.

Root Cause

In LocalIcebergCatalog.dropView, the purge parameter is derived from PURGE_VIEW_METADATA_ON_DROP (default true). This is passed to dropTableLike, whose guard checks DROP_WITH_PURGE_ENABLED (default false). The shipped defaults are exactly the combination that fails.

Fix

Change the default value of PURGE_VIEW_METADATA_ON_DROP from true to false, so that views can be dropped out of the box without requiring DROP_WITH_PURGE_ENABLED to be enabled.

Changes

  • FeatureConfiguration.java: Change PURGE_VIEW_METADATA_ON_DROP default from true to false, update description to note dependency on DROP_WITH_PURGE_ENABLED
  • PolarisRestCatalogIntegrationBase.java: Add testDropViewWithDefaultPurgeViewMetadataOnDrop test verifying views can be dropped when PURGE_VIEW_METADATA_ON_DROP is unset (default applies)
  • CHANGELOG.md: Document the breaking/default behavior change
  • flags-polaris_features.md: Update documented default value

Upgrade Guidance

Deployments that enable DROP_WITH_PURGE_ENABLED and rely on view metadata being purged should now explicitly set PURGE_VIEW_METADATA_ON_DROP to true.

…ling-check query

The optimized sibling check reads location_without_scheme via
QueryGenerator.generateOverlapQuery, which filters realm_id and
catalog_id. On Postgres and CockroachDB the idx_locations index led
with parent_id instead of catalog_id, so the predicate could only
probe the realm_id prefix and every CREATE TABLE / CREATE NAMESPACE
with OPTIMIZED_SIBLING_CHECK enabled fell back to a scan instead of
the intended indexed lookup. H2 already used the correct columns.

Schema v5 has already shipped in 1.7.0, so rather than editing a
released script this adds schema v6 for all backends with the
corrected index and bumps the latest schema version. Fresh installs
bootstrap at v6 and get the right index automatically. Existing
deployments need a one-time manual index recreation, documented in
the changelog upgrade notes, because Polaris has no automated schema
migrations.
…out of the box

Fixes: apache#5293

The default values of DROP_WITH_PURGE_ENABLED (false) and
PURGE_VIEW_METADATA_ON_DROP (true) were incompatible: dropping
a view derived purge=true from the view flag, but the guard
rejected purge=true because the table flag was off. As a result,
views could not be dropped under the default configuration.

Change the default of PURGE_VIEW_METADATA_ON_DROP to false so
that views can be dropped out of the box. Deployments that rely
on view metadata being purged should explicitly set
PURGE_VIEW_METADATA_ON_DROP to true alongside
DROP_WITH_PURGE_ENABLED.

- Update FeatureConfiguration.java default value
- Add integration test for default config behavior
- Update CHANGELOG.md and documentation
@ayushtkn

Copy link
Copy Markdown
Member

this dupes an already existing PR linked in the issue: #5322

@iprithv

iprithv commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

@zhang-arvin Before opening a PR, please check if there’s already an open PR for the same issue. If there is, please avoid creating a duplicate and consider contributing to the existing PR instead. I can also suggest some good first issues if you’d like to pick up another one.

@github-project-automation github-project-automation Bot moved this from PRs In Progress to Done in Basic Kanban Board Aug 19, 2026
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.

Views can not be dropped under default configurations

3 participants