Skip to content

Commit

Permalink
Drop test table
Browse files Browse the repository at this point in the history
  • Loading branch information
findepi authored and losipiuk committed Feb 24, 2022
1 parent b57a32c commit 68c2c5e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7889,8 +7889,9 @@ public void testOptimize()

// compact with low threshold; nothing should change
assertUpdate(optimizeEnabledSession, "ALTER TABLE " + tableName + " EXECUTE optimize(file_size_threshold => '10B')");

assertThat(getTableFiles(tableName)).hasSameElementsAs(compactedFiles);

assertUpdate("DROP TABLE " + tableName);
}

@Test
Expand All @@ -7916,6 +7917,8 @@ public void testOptimizeWithWriterScaling()
Set<String> compactedFiles = getTableFiles(tableName);
assertThat(compactedFiles).hasSize(1);
assertThat(intersection(initialFiles, compactedFiles)).isEmpty();

assertUpdate("DROP TABLE " + tableName);
}

@Test
Expand Down Expand Up @@ -7973,6 +7976,8 @@ public void testOptimizeWithPartitioning()
Set<String> compactedFiles = getTableFiles(tableName);
assertThat(compactedFiles).hasSize(partitionsCount);
assertThat(intersection(initialFiles, compactedFiles)).isEmpty();

assertUpdate("DROP TABLE " + tableName);
}

@Test
Expand All @@ -7997,6 +8002,8 @@ public void testOptimizeWithBucketing()

assertThat(getTableFiles(tableName)).hasSameElementsAs(initialFiles);
assertNationNTimes(tableName, insertCount);

assertUpdate("DROP TABLE " + tableName);
}

@Test
Expand All @@ -8016,6 +8023,8 @@ public void testOptimizeHiveSystemTable()

assertThatThrownBy(() -> computeActual(optimizeEnabledSession(), format("ALTER TABLE \"%s$partitions\" EXECUTE optimize(file_size_threshold => '10kB')", tableName)))
.hasMessage("This connector does not support table procedures");

assertUpdate("DROP TABLE " + tableName);
}

private Session optimizeEnabledSession()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3280,6 +3280,8 @@ public void testOptimizeForPartitionedTable()
// as we force repartitioning there should be only 3 partitions
assertThat(updatedFiles).hasSize(3);
assertThat(getAllDataFilesFromTableDirectory(tableName)).containsExactlyInAnyOrderElementsOf(concat(initialFiles, updatedFiles));

assertUpdate("DROP TABLE " + tableName);
}

private List<String> getActiveFiles(String tableName)
Expand Down

0 comments on commit 68c2c5e

Please sign in to comment.