Skip to content

Commit

Permalink
Fix TestIcebergSystemTables
Browse files Browse the repository at this point in the history
  • Loading branch information
ZacBlanco committed Dec 20, 2024
1 parent 80164e1 commit 5819e85
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public void testSnapshotsTable()
"('manifest_list', 'varchar', '', '')," +
"('summary', 'map(varchar, varchar)', '', '')");

assertQuery("SELECT operation FROM test_schema.\"test_table$snapshots\"", "VALUES 'append', 'append'");
assertQuery("SELECT operation FROM test_schema.\"test_table$snapshots\"", "VALUES 'overwrite', 'overwrite'");
assertQuery("SELECT summary['total-records'] FROM test_schema.\"test_table$snapshots\"", "VALUES '3', '6'");
}

Expand Down Expand Up @@ -258,14 +258,16 @@ protected void checkTableProperties(String tableName, String deleteMode)
{
assertQuery(String.format("SHOW COLUMNS FROM test_schema.\"%s$properties\"", tableName),
"VALUES ('key', 'varchar', '', '')," + "('value', 'varchar', '', '')");
assertQuery(String.format("SELECT COUNT(*) FROM test_schema.\"%s$properties\"", tableName), "VALUES 7");
assertQuery(String.format("SELECT COUNT(*) FROM test_schema.\"%s$properties\"", tableName), "VALUES 8");
List<MaterializedRow> materializedRows = computeActual(getSession(),
String.format("SELECT * FROM test_schema.\"%s$properties\"", tableName)).getMaterializedRows();

assertThat(materializedRows).hasSize(7);
assertThat(materializedRows).hasSize(8);
assertThat(materializedRows)
.anySatisfy(row -> assertThat(row)
.isEqualTo(new MaterializedRow(MaterializedResult.DEFAULT_PRECISION, "write.delete.mode", deleteMode)))
.anySatisfy(row -> assertThat(row)
.isEqualTo(new MaterializedRow(MaterializedResult.DEFAULT_PRECISION, "write.update.mode", deleteMode)))
.anySatisfy(row -> assertThat(row)
.isEqualTo(new MaterializedRow(MaterializedResult.DEFAULT_PRECISION, "write.format.default", "PARQUET")))
.anySatisfy(row -> assertThat(row)
Expand All @@ -284,14 +286,16 @@ protected void checkORCFormatTableProperties(String tableName, String deleteMode
{
assertQuery(String.format("SHOW COLUMNS FROM test_schema.\"%s$properties\"", tableName),
"VALUES ('key', 'varchar', '', '')," + "('value', 'varchar', '', '')");
assertQuery(String.format("SELECT COUNT(*) FROM test_schema.\"%s$properties\"", tableName), "VALUES 8");
assertQuery(String.format("SELECT COUNT(*) FROM test_schema.\"%s$properties\"", tableName), "VALUES 9");
List<MaterializedRow> materializedRows = computeActual(getSession(),
String.format("SELECT * FROM test_schema.\"%s$properties\"", tableName)).getMaterializedRows();

assertThat(materializedRows).hasSize(8);
assertThat(materializedRows).hasSize(9);
assertThat(materializedRows)
.anySatisfy(row -> assertThat(row)
.isEqualTo(new MaterializedRow(MaterializedResult.DEFAULT_PRECISION, "write.delete.mode", deleteMode)))
.anySatisfy(row -> assertThat(row)
.isEqualTo(new MaterializedRow(MaterializedResult.DEFAULT_PRECISION, "write.update.mode", deleteMode)))
.anySatisfy(row -> assertThat(row)
.isEqualTo(new MaterializedRow(MaterializedResult.DEFAULT_PRECISION, "write.format.default", "ORC")))
.anySatisfy(row -> assertThat(row)
Expand Down

0 comments on commit 5819e85

Please sign in to comment.