Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Tan-JiaLiang committed Dec 11, 2024
1 parent 7766f69 commit 9507c9f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,7 @@ public void testFileIndexFilterPushDownFallback() throws Exception {
write.close();
commit.close();

Function<InternalRow, String> TO_STRING =
Function<InternalRow, String> toString =
row -> row.getInt(0) + "," + row.getString(1).toString() + "," + row.getLong(2);
Predicate predicate =
PredicateBuilder.and(
Expand All @@ -796,7 +796,7 @@ public void testFileIndexFilterPushDownFallback() throws Exception {
List<String> a1 = new ArrayList<>();
RecordReader<InternalRow> r1 =
table.newRead().withFilter(predicate).createReader(plan.splits());
r1.forEachRemaining(row -> a1.add(TO_STRING.apply(row)));
r1.forEachRemaining(row -> a1.add(toString.apply(row)));
assertThat(a1.size()).isEqualTo(5);
assertThat(String.join("|", a1)).isEqualTo("1,A,1|1,B,2|1,C,3|1,A,1|1,A,1");

Expand All @@ -807,7 +807,7 @@ public void testFileIndexFilterPushDownFallback() throws Exception {
.withFilter(predicate)
.withIndexFilter(predicate)
.createReader(plan.splits());
r2.forEachRemaining(row -> a2.add(TO_STRING.apply(row)));
r2.forEachRemaining(row -> a2.add(toString.apply(row)));
assertThat(a2.size()).isEqualTo(3);
assertThat(String.join("|", a2)).isEqualTo("1,A,1|1,A,1|1,A,1");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1100,13 +1100,13 @@ public void testDeletionVectorsWithFileIndexFilterPushDownFallback() throws Exce
Predicate predicate = new PredicateBuilder(ROW_TYPE).equal(2, 100L);
List<Split> splits = toSplits(table.newSnapshotReader().read().dataSplits());

Function<InternalRow, String> TO_STRING =
Function<InternalRow, String> toString =
row -> row.getInt(0) + "," + row.getInt(1) + "," + row.getLong(2);

// test read without index filter, should not fallback
List<String> a1 = new ArrayList<>();
RecordReader<InternalRow> r1 = table.newRead().withFilter(predicate).createReader(splits);
r1.forEachRemaining(row -> a1.add(TO_STRING.apply(row)));
r1.forEachRemaining(row -> a1.add(toString.apply(row)));
assertThat(a1.size()).isEqualTo(5);
assertThat(String.join("|", a1)).isEqualTo("1,1,300|1,2,400|1,3,100|1,6,300|1,5,100");

Expand Down

0 comments on commit 9507c9f

Please sign in to comment.