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 df3ac52 commit 59a993a
Showing 1 changed file with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
public abstract class IcebergRESTServiceIT extends IcebergRESTServiceBaseIT {

private static final String ICEBERG_REST_NS_PREFIX = "iceberg_rest_";
private static final String ICEBERG_REGISTER_TABLE_NAME = "register_foo1";

@BeforeAll
void prepareSQLContext() {
Expand All @@ -66,7 +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.forEach(table -> purgeTable(namespace, table));
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 @@ -525,14 +529,16 @@ void testSnapshot() {
@EnabledIf("catalogTypeNotMemory")
void testRegisterTable() {
sql(
"CREATE TABLE iceberg_rest_table_test.register_foo1"
+ "(id bigint COMMENT 'unique id',data string) using iceberg");
sql(" INSERT INTO iceberg_rest_table_test.register_foo1 VALUES (1, 'a')");
"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));

// get metadata location
List<String> metadataLocations =
convertToStringList(
sql("select file from iceberg_rest_table_test.register_foo1.metadata_log_entries"), 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 59a993a

Please sign in to comment.