Skip to content

Commit

Permalink
Handle nested columns on IcebergTestUtils#checkParquetFileSorting
Browse files Browse the repository at this point in the history
  • Loading branch information
mattheusv committed Jul 5, 2024
1 parent 0389108 commit 8ad3745
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ public void testSortedTableUsingNestedField()
500);

for (Object filePath : computeActual("SELECT file_path from \"" + table.getName() + "$files\"").getOnlyColumnAsSet()) {
assertThat(isFileSorted(Location.of((String) filePath), "name")).isTrue();
assertThat(isFileSorted(Location.of((String) filePath), "row_t.name")).isTrue();
}
assertQuery("SELECT * FROM " + table.getName(), "SELECT * FROM " + table.getName() + " ORDER BY id");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@

import static com.google.common.base.Verify.verify;
import static com.google.common.collect.ImmutableList.toImmutableList;
import static com.google.common.collect.Iterators.getOnlyElement;
import static com.google.common.collect.MoreCollectors.onlyElement;
import static io.trino.plugin.hive.metastore.cache.CachingHiveMetastore.createPerTransactionCache;
import static io.trino.plugin.iceberg.IcebergQueryRunner.ICEBERG_CATALOG;
Expand Down Expand Up @@ -141,7 +140,7 @@ public static boolean checkParquetFileSorting(TrinoInputFile inputFile, String s
verify(parquetMetadata.getBlocks().size() > 1, "Test must produce at least two row groups");
for (BlockMetadata blockMetaData : parquetMetadata.getBlocks()) {
ColumnChunkMetadata columnMetadata = blockMetaData.columns().stream()
.filter(column -> getOnlyElement(column.getPath().iterator()).equalsIgnoreCase(sortColumnName))
.filter(column -> column.getPath().toDotString().equalsIgnoreCase(sortColumnName))
.collect(onlyElement());
if (previousMax != null) {
if (previousMax.compareTo(columnMetadata.getStatistics().genericGetMin()) > 0) {
Expand Down

0 comments on commit 8ad3745

Please sign in to comment.