@@ -1051,28 +1051,23 @@ void testAutoRefreshingPartitionedAppend() throws InterruptedException {
1051
1051
/**
1052
1052
* Verify that the sort order for the data files in the table match the expected sort order.
1053
1053
*/
1054
- private void verifySortOrder (
1054
+ private static void verifySortOrder (
1055
1055
final IcebergTableAdapter tableAdapter ,
1056
1056
final List <List <SortColumn >> expectedSortOrders ) {
1057
1057
verifySortOrder (tableAdapter , expectedSortOrders ,
1058
1058
ParquetInstructions .EMPTY .withTableDefinition (tableAdapter .definition ()));
1059
1059
}
1060
1060
1061
- private void verifySortOrder (
1061
+ private static void verifySortOrder (
1062
1062
@ NotNull final IcebergTableAdapter tableAdapter ,
1063
1063
@ NotNull final List <List <SortColumn >> expectedSortOrders ,
1064
1064
@ NotNull final ParquetInstructions readInstructions ) {
1065
1065
final org .apache .iceberg .Table icebergTable = tableAdapter .icebergTable ();
1066
- final Map <ManifestFile , List <DataFile >> manifestToDataFiles =
1067
- IcebergUtils .manifestToDataFiles (icebergTable , icebergTable .currentSnapshot ());
1068
1066
final List <List <SortColumn >> actualSortOrders = new ArrayList <>();
1069
- for (final Map .Entry <ManifestFile , List <DataFile >> entry : manifestToDataFiles .entrySet ()) {
1070
- final List <DataFile > dataFiles = entry .getValue ();
1071
- for (final DataFile dataFile : dataFiles ) {
1072
- actualSortOrders .add (computeSortedColumns (icebergTable , dataFile , readInstructions ));
1073
- }
1074
- }
1075
- assertThat (actualSortOrders ).containsExactlyInAnyOrderElementsOf (expectedSortOrders );
1067
+ IcebergUtils .allDataFiles (icebergTable , icebergTable .currentSnapshot ())
1068
+ .forEach (dataFile -> actualSortOrders
1069
+ .add (computeSortedColumns (icebergTable , dataFile , readInstructions )));
1070
+ assertThat (actualSortOrders ).isEqualTo (expectedSortOrders );
1076
1071
}
1077
1072
1078
1073
@ Test
@@ -1110,8 +1105,8 @@ void testApplyDefaultSortOrder() {
1110
1105
1111
1106
// Verify that the new data file is sorted
1112
1107
verifySortOrder (tableAdapter , List .of (
1113
- List .of (),
1114
- List .of (SortColumn . asc ( ColumnName . of ( "intCol" )) )));
1108
+ List .of (SortColumn . asc ( ColumnName . of ( "intCol" )) ),
1109
+ List .of ()));
1115
1110
1116
1111
// Append more unsorted data to the table without enforcing sort order
1117
1112
tableWriterWithoutSorting .append (IcebergWriteInstructions .builder ()
0 commit comments