Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ request adding CHANGELOG notes for breaking (!) changes and possibly other secti

### Changes

- `PURGE_VIEW_METADATA_ON_DROP` now defaults to `false`, so views can be dropped under the default
configuration. Its previous default of `true` required `DROP_WITH_PURGE_ENABLED` to be enabled as
well, and dropping any view failed otherwise. Deployments that enable `DROP_WITH_PURGE_ENABLED`
and rely on view metadata being purged should now set `PURGE_VIEW_METADATA_ON_DROP` to `true`
explicitly.

### Deprecations

### Fixes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1912,6 +1912,27 @@ public void testDropViewWithPurge() {
assertThatCode(() -> restCatalog.dropView(id)).doesNotThrowAnyException();
}

@Test
public void testDropViewWithDefaultPurgeViewMetadataOnDrop() {
restCatalog.createNamespace(Namespace.of("ns1"));
TableIdentifier id = TableIdentifier.of(Namespace.of("ns1"), "view1");
restCatalog
.buildView(id)
.withSchema(SCHEMA)
.withDefaultNamespace(Namespace.of("ns1"))
.withQuery("spark", VIEW_QUERY)
.create();

Catalog catalog = managementApi.getCatalog(currentCatalogName);
Map<String, String> catalogProps = new HashMap<>(catalog.getProperties().toMap());
catalogProps.put(FeatureConfiguration.DROP_WITH_PURGE_ENABLED.catalogConfig(), "false");
// Leave PURGE_VIEW_METADATA_ON_DROP unset so that its default value applies.
catalogProps.remove(FeatureConfiguration.PURGE_VIEW_METADATA_ON_DROP.catalogConfig());
managementApi.updateCatalog(catalog, catalogProps);

assertThatCode(() -> restCatalog.dropView(id)).doesNotThrowAnyException();
}

@Test
public void testRenameViewStatus() {
String tableName = "tbl1";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -436,8 +436,9 @@ public static void enforceFeatureEnabledOrThrow(
.key("PURGE_VIEW_METADATA_ON_DROP")
.catalogConfig("polaris.config.purge-view-metadata-on-drop")
.description(
"If set to true, Polaris will attempt to delete view metadata files when a view is dropped.")
.defaultValue(true)
"If set to true, Polaris will attempt to delete view metadata files when a view is dropped."
+ " This requires DROP_WITH_PURGE_ENABLED to be enabled as well.")
.defaultValue(false)
.buildFeatureConfiguration();

public static final FeatureConfiguration<Long> POLARIS_TASK_TIMEOUT_MILLIS =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -478,10 +478,10 @@ Polaris task expiry timeout (milliseconds). Older unfinished tasks may not be pr

##### `polaris.features."PURGE_VIEW_METADATA_ON_DROP"`

If set to true, Polaris will attempt to delete view metadata files when a view is dropped.
If set to true, Polaris will attempt to delete view metadata files when a view is dropped. This requires DROP_WITH_PURGE_ENABLED to be enabled as well.

- **Type:** `Boolean`
- **Default:** `true`
- **Default:** `false`
- **Catalog Config:** `polaris.config.purge-view-metadata-on-drop`
Comment thread
ayushtkn marked this conversation as resolved.

---
Expand Down