20
20
21
21
import org .apache .paimon .CoreOptions ;
22
22
import org .apache .paimon .Snapshot ;
23
- import org .apache .paimon .casting .CastExecutor ;
24
- import org .apache .paimon .casting .CastExecutors ;
25
23
import org .apache .paimon .data .BinaryString ;
26
24
import org .apache .paimon .data .GenericRow ;
27
25
import org .apache .paimon .data .InternalRow ;
46
44
import org .apache .paimon .utils .FileStorePathFactory ;
47
45
import org .apache .paimon .utils .IteratorRecordReader ;
48
46
import org .apache .paimon .utils .ProjectedRow ;
47
+ import org .apache .paimon .utils .RowDataToObjectArrayConverter ;
49
48
import org .apache .paimon .utils .SerializationUtils ;
50
49
51
50
import org .apache .paimon .shade .guava30 .com .google .common .collect .Iterators ;
58
57
import java .util .Iterator ;
59
58
import java .util .List ;
60
59
import java .util .Map ;
60
+ import java .util .function .Function ;
61
61
62
62
import static org .apache .paimon .catalog .Catalog .SYSTEM_TABLE_SPLITTER ;
63
63
@@ -186,16 +186,17 @@ public RecordReader<InternalRow> createReader(Split split) {
186
186
}
187
187
List <ManifestFileMeta > manifestFileMetas = allManifests (dataTable );
188
188
189
- @ SuppressWarnings ("unchecked" )
190
- CastExecutor <InternalRow , BinaryString > partitionCastExecutor =
191
- (CastExecutor <InternalRow , BinaryString >)
192
- CastExecutors .resolveToString (
193
- dataTable .schema ().logicalPartitionType ());
189
+ RowDataToObjectArrayConverter partRowConverter =
190
+ new RowDataToObjectArrayConverter (dataTable .schema ().logicalPartitionType ());
191
+
192
+ Function <InternalRow , BinaryString > partConverter =
193
+ part ->
194
+ BinaryString .fromString (
195
+ Arrays .toString (partRowConverter .convert (part )));
194
196
195
197
Iterator <InternalRow > rows =
196
198
Iterators .transform (
197
- manifestFileMetas .iterator (),
198
- meta -> toRow (meta , partitionCastExecutor ));
199
+ manifestFileMetas .iterator (), meta -> toRow (meta , partConverter ));
199
200
if (readType != null ) {
200
201
rows =
201
202
Iterators .transform (
@@ -209,15 +210,15 @@ public RecordReader<InternalRow> createReader(Split split) {
209
210
210
211
private InternalRow toRow (
211
212
ManifestFileMeta manifestFileMeta ,
212
- CastExecutor <InternalRow , BinaryString > partitionCastExecutor ) {
213
+ Function <InternalRow , BinaryString > partitionCastExecutor ) {
213
214
return GenericRow .of (
214
215
BinaryString .fromString (manifestFileMeta .fileName ()),
215
216
manifestFileMeta .fileSize (),
216
217
manifestFileMeta .numAddedFiles (),
217
218
manifestFileMeta .numDeletedFiles (),
218
219
manifestFileMeta .schemaId (),
219
- partitionCastExecutor .cast (manifestFileMeta .partitionStats ().minValues ()),
220
- partitionCastExecutor .cast (manifestFileMeta .partitionStats ().maxValues ()));
220
+ partitionCastExecutor .apply (manifestFileMeta .partitionStats ().minValues ()),
221
+ partitionCastExecutor .apply (manifestFileMeta .partitionStats ().maxValues ()));
221
222
}
222
223
}
223
224
0 commit comments