Skip to content

Commit

Permalink
Add product test case for predicate on recreated Iceberg column
Browse files Browse the repository at this point in the history
  • Loading branch information
leetcode-1533 authored and raunaqmorarka committed Jan 18, 2024
1 parent 83d09e0 commit 38c58a3
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -806,6 +806,8 @@ public void testIdBasedFieldMapping(StorageFormat storageFormat, int specVersion
.addField("added", null)
.build(),
1001L));
// make sure predicates are also ID based
assertThat(onTrino().executeQuery(format("SELECT keep_col FROM %s WHERE drop_and_add_col IS NULL", trinoTableName))).containsOnly(row(3L));

// smoke test for dereference
assertThat(onTrino().executeQuery(format("SELECT a_struct.renamed FROM %s", trinoTableName))).containsOnly(row(11L));
Expand All @@ -818,6 +820,7 @@ public void testIdBasedFieldMapping(StorageFormat storageFormat, int specVersion
assertThat(onTrino().executeQuery(format("SELECT keep_col FROM %s WHERE a_struct.renamed = 11", trinoTableName))).containsOnly(row(3L));
assertThat(onTrino().executeQuery(format("SELECT keep_col FROM %s WHERE a_struct.keep = 12", trinoTableName))).containsOnly(row(3L));
assertThat(onTrino().executeQuery(format("SELECT keep_col FROM %s WHERE a_struct.casesensitive = 14", trinoTableName))).containsOnly(row(3L));
// make sure predicates are also ID based
assertThat(onTrino().executeQuery(format("SELECT keep_col FROM %s WHERE a_struct.drop_and_add IS NULL", trinoTableName))).containsOnly(row(3L));
assertThat(onTrino().executeQuery(format("SELECT keep_col FROM %s WHERE a_struct.added IS NULL", trinoTableName))).containsOnly(row(3L));

Expand Down

0 comments on commit 38c58a3

Please sign in to comment.