Skip to content

Commit

Permalink
Spark 3.4, 3.5: Enable drop table with purge in tests (apache#9548)
Browse files Browse the repository at this point in the history
  • Loading branch information
manuzhang authored and adnanhemani committed Jan 30, 2024
1 parent 439774b commit b624f06
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,7 @@ public TestRemoveOrphanFilesProcedure(

@After
public void removeTable() {
// TODO: use the Iceberg catalog to drop the table until SPARK-43203 is fixed
validationCatalog.dropTable(tableIdent, true /* purge */);
sql("DROP TABLE IF EXISTS %s", tableName);
sql("DROP TABLE IF EXISTS %s PURGE", tableName);
sql("DROP TABLE IF EXISTS p PURGE");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;

public class TestDropTable extends SparkCatalogTestBase {
Expand Down Expand Up @@ -86,8 +85,7 @@ private void dropTableInternal() throws IOException {
}
}

// TODO: enable once SPARK-43203 is fixed
@Ignore
@Test
public void testPurgeTable() throws IOException {
assertEquals(
"Should have expected rows",
Expand All @@ -104,8 +102,7 @@ public void testPurgeTable() throws IOException {
Assert.assertTrue("All files should be deleted", checkFilesExist(manifestAndFiles, false));
}

// TODO: enable once SPARK-43203 is fixed
@Ignore
@Test
public void testPurgeTableGCDisabled() throws IOException {
sql("ALTER TABLE %s SET TBLPROPERTIES (gc.enabled = false)", tableName);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,7 @@ public TestRemoveOrphanFilesProcedure(

@After
public void removeTable() {
// TODO: use the Iceberg catalog to drop the table until SPARK-43203 is fixed
validationCatalog.dropTable(tableIdent, true /* purge */);
sql("DROP TABLE IF EXISTS %s", tableName);
sql("DROP TABLE IF EXISTS %s PURGE", tableName);
sql("DROP TABLE IF EXISTS p PURGE");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.TestTemplate;

public class TestDropTable extends CatalogTestBase {
Expand Down Expand Up @@ -85,8 +84,7 @@ private void dropTableInternal() throws IOException {
}
}

// TODO: enable once SPARK-43203 is fixed
@Disabled
@TestTemplate
public void testPurgeTable() throws IOException {
assertEquals(
"Should have expected rows",
Expand All @@ -102,8 +100,7 @@ public void testPurgeTable() throws IOException {
assertThat(checkFilesExist(manifestAndFiles, false)).as("All files should be deleted").isTrue();
}

// TODO: enable once SPARK-43203 is fixed
@Disabled
@TestTemplate
public void testPurgeTableGCDisabled() throws IOException {
sql("ALTER TABLE %s SET TBLPROPERTIES (gc.enabled = false)", tableName);

Expand Down

0 comments on commit b624f06

Please sign in to comment.