Skip to content

Commit

Permalink
fix comment
Browse files Browse the repository at this point in the history
  • Loading branch information
FANNG1 committed Jul 9, 2024
1 parent 59a993a commit 45adcf0
Showing 1 changed file with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,10 @@ private void purgeTable(String namespace, String table) {

private void purgeNameSpace(String namespace) {
Set<String> tables = convertToStringSet(sql("SHOW TABLES IN " + namespace), 1);
tables.stream().filter(
// the original table and registered table share one metadata, so couldn't purge two tables.
tables.stream()
.filter(
// the original table and registered table share one metadata, so couldn't purge two
// tables.
table -> !table.equals(ICEBERG_REGISTER_TABLE_NAME))
.forEach(table -> purgeTable(namespace, table));
sql("DROP database " + namespace);
Expand Down Expand Up @@ -529,16 +531,21 @@ void testSnapshot() {
@EnabledIf("catalogTypeNotMemory")
void testRegisterTable() {
sql(
"CREATE TABLE iceberg_rest_table_test." + ICEBERG_REGISTER_TABLE_NAME
"CREATE TABLE iceberg_rest_table_test."
+ ICEBERG_REGISTER_TABLE_NAME
+ " (id bigint COMMENT 'unique id',data string) using iceberg");
sql(String.format("INSERT INTO iceberg_rest_table_test.%s VALUES (1, 'a')",
ICEBERG_REGISTER_TABLE_NAME));
sql(
String.format(
"INSERT INTO iceberg_rest_table_test.%s VALUES (1, 'a')", ICEBERG_REGISTER_TABLE_NAME));

// get metadata location
List<String> metadataLocations =
convertToStringList(
sql(String.format("select file from iceberg_rest_table_test.%s.metadata_log_entries",
ICEBERG_REGISTER_TABLE_NAME)), 0);
sql(
String.format(
"select file from iceberg_rest_table_test.%s.metadata_log_entries",
ICEBERG_REGISTER_TABLE_NAME)),
0);
String metadataLocation = metadataLocations.get(metadataLocations.size() - 1);

// register table
Expand Down

0 comments on commit 45adcf0

Please sign in to comment.