-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix storage table data clean up while dropping iceberg materialized view
This is for cleaning up data files in legacy mode i.e iceberg.materialized-views.hide-storage-table is set to false. Delegating the drop table to metastore does not clean up the data files since for HMS, the iceberg table is registered as an "external" table. So to fix this instead of delegating to metastore, have the connector do the drop of the table and data files associated with it.
- Loading branch information
1 parent
999d8a3
commit bed3be2
Showing
3 changed files
with
144 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
...java/io/trino/plugin/iceberg/catalog/hms/TestTrinoLegacyHiveCatalogWithHiveMetastore.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.trino.plugin.iceberg.catalog.hms; | ||
|
||
import org.junit.jupiter.api.TestInstance; | ||
import org.junit.jupiter.api.parallel.Execution; | ||
|
||
import static io.trino.testing.TestingNames.randomNameSuffix; | ||
import static org.junit.jupiter.api.TestInstance.Lifecycle.PER_CLASS; | ||
import static org.junit.jupiter.api.parallel.ExecutionMode.CONCURRENT; | ||
|
||
@TestInstance(PER_CLASS) | ||
@Execution(CONCURRENT) | ||
public class TestTrinoLegacyHiveCatalogWithHiveMetastore | ||
extends TestTrinoHiveCatalogWithHiveMetastore | ||
{ | ||
@Override | ||
protected String getBucketName() | ||
{ | ||
return "test-legacy-hive-catalog-with-hms-" + randomNameSuffix(); | ||
} | ||
|
||
@Override | ||
protected boolean isHideMaterializedViewStorageTable() | ||
{ | ||
return false; | ||
} | ||
} |