3
3
//
4
4
package io .deephaven .iceberg .location ;
5
5
6
+ import io .deephaven .api .SortColumn ;
6
7
import io .deephaven .base .verify .Require ;
7
8
import io .deephaven .engine .table .impl .locations .TableLocationKey ;
8
- import io .deephaven .iceberg .util .IcebergTableAdapter ;
9
9
import io .deephaven .parquet .table .ParquetInstructions ;
10
10
import io .deephaven .parquet .table .location .ParquetTableLocationKey ;
11
11
import org .apache .iceberg .DataFile ;
17
17
18
18
import java .net .URI ;
19
19
import java .util .Comparator ;
20
+ import java .util .List ;
20
21
import java .util .Map ;
21
22
import java .util .Objects ;
22
23
import java .util .UUID ;
@@ -42,12 +43,6 @@ public class IcebergTableParquetLocationKey extends ParquetTableLocationKey impl
42
43
@ Nullable
43
44
private final TableIdentifier tableIdentifier ;
44
45
45
- @ NotNull
46
- private final IcebergTableAdapter tableAdapter ;
47
-
48
- @ NotNull
49
- private final DataFile dataFile ;
50
-
51
46
/**
52
47
* The {@link DataFile#dataSequenceNumber()} of the data file backing this keyed location.
53
48
*/
@@ -71,6 +66,9 @@ public class IcebergTableParquetLocationKey extends ParquetTableLocationKey impl
71
66
@ NotNull
72
67
private final ParquetInstructions readInstructions ;
73
68
69
+ @ NotNull
70
+ private final List <SortColumn > sortedColumns ;
71
+
74
72
private int cachedHashCode ;
75
73
76
74
/**
@@ -79,7 +77,6 @@ public class IcebergTableParquetLocationKey extends ParquetTableLocationKey impl
79
77
* @param catalogName The name of the catalog using which the table is accessed
80
78
* @param tableUuid The UUID of the table, or {@code null} if not available
81
79
* @param tableIdentifier The table identifier used to access the table
82
- * @param tableAdapter The Iceberg table adapter for the table
83
80
* @param manifestFile The manifest file from which the data file was discovered
84
81
* @param dataFile The data file that backs the keyed location
85
82
* @param fileUri The {@link URI} for the file that backs the keyed location
@@ -94,14 +91,14 @@ public IcebergTableParquetLocationKey(
94
91
@ Nullable final String catalogName ,
95
92
@ Nullable final UUID tableUuid ,
96
93
@ NotNull final TableIdentifier tableIdentifier ,
97
- @ NotNull final IcebergTableAdapter tableAdapter ,
98
94
@ NotNull final ManifestFile manifestFile ,
99
95
@ NotNull final DataFile dataFile ,
100
96
@ NotNull final URI fileUri ,
101
97
final int order ,
102
98
@ Nullable final Map <String , Comparable <?>> partitions ,
103
99
@ NotNull final ParquetInstructions readInstructions ,
104
- @ NotNull final SeekableChannelsProvider channelsProvider ) {
100
+ @ NotNull final SeekableChannelsProvider channelsProvider ,
101
+ @ NotNull final List <SortColumn > sortedColumns ) {
105
102
super (fileUri , order , partitions , channelsProvider );
106
103
107
104
this .catalogName = catalogName ;
@@ -111,10 +108,6 @@ public IcebergTableParquetLocationKey(
111
108
// tableUUID was null
112
109
this .tableIdentifier = tableUuid != null ? null : tableIdentifier ;
113
110
114
- this .tableAdapter = tableAdapter ;
115
-
116
- this .dataFile = dataFile ;
117
-
118
111
// Files with unknown sequence numbers should be ordered first
119
112
dataSequenceNumber = dataFile .dataSequenceNumber () != null ? dataFile .dataSequenceNumber () : Long .MIN_VALUE ;
120
113
fileSequenceNumber = dataFile .fileSequenceNumber () != null ? dataFile .fileSequenceNumber () : Long .MIN_VALUE ;
@@ -125,6 +118,7 @@ public IcebergTableParquetLocationKey(
125
118
manifestSequenceNumber = manifestFile .sequenceNumber ();
126
119
127
120
this .readInstructions = readInstructions ;
121
+ this .sortedColumns = sortedColumns ;
128
122
}
129
123
130
124
@ Override
@@ -138,13 +132,8 @@ public ParquetInstructions readInstructions() {
138
132
}
139
133
140
134
@ NotNull
141
- DataFile dataFile () {
142
- return dataFile ;
143
- }
144
-
145
- @ NotNull
146
- IcebergTableAdapter tableAdapter () {
147
- return tableAdapter ;
135
+ List <SortColumn > sortedColumns () {
136
+ return sortedColumns ;
148
137
}
149
138
150
139
/**
@@ -220,6 +209,7 @@ public boolean equals(@Nullable final Object other) {
220
209
&& fileSequenceNumber == otherTyped .fileSequenceNumber
221
210
&& dataFilePos == otherTyped .dataFilePos
222
211
&& manifestSequenceNumber == otherTyped .manifestSequenceNumber
212
+ && sortedColumns .equals (otherTyped .sortedColumns )
223
213
&& uri .equals (otherTyped .uri );
224
214
}
225
215
@@ -235,6 +225,7 @@ public int hashCode() {
235
225
result = prime * result + Long .hashCode (fileSequenceNumber );
236
226
result = prime * result + Long .hashCode (dataFilePos );
237
227
result = prime * result + Long .hashCode (manifestSequenceNumber );
228
+ result = prime * result + Objects .hashCode (sortedColumns );
238
229
result = prime * result + uri .hashCode ();
239
230
// Don't use 0; that's used by StandaloneTableLocationKey, and also our sentinel for the need to compute
240
231
if (result == 0 ) {
0 commit comments