danny0405 commented on code in PR #18741:
URL: https://github.com/apache/hudi/pull/18741#discussion_r3246059418
##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/table/format/cow/CopyOnWriteInputFormat.java:
##########
@@ -116,32 +124,50 @@ public CopyOnWriteInputFormat(
@Override
public void open(FileInputSplit fileSplit) throws IOException {
- LinkedHashMap<String, Object> partObjects =
FilePathUtils.generatePartitionSpecs(
- fileSplit.getPath().getPath(),
- Arrays.asList(fullFieldNames),
- Arrays.asList(fullFieldTypes),
- this.partDefaultName,
- this.partPathField,
- this.hiveStylePartitioning
- );
-
- this.itr = RecordIterators.getParquetRecordIterator(
- internalSchemaManager,
- utcTimestamp,
- true,
- conf.conf(),
- fullFieldNames,
- fullFieldTypes,
- partObjects,
- selectedFields,
- 2048,
- fileSplit.getPath(),
- fileSplit.getStart(),
- fileSplit.getLength(),
- predicates);
+ if
(fileSplit.getPath().getName().endsWith(HoodieFileFormat.LANCE.getFileExtension()))
{
+ this.itr = getLanceRecordIterator(fileSplit.getPath());
+ } else {
+ LinkedHashMap<String, Object> partObjects =
FilePathUtils.generatePartitionSpecs(
+ fileSplit.getPath().getPath(),
+ Arrays.asList(fullFieldNames),
+ Arrays.asList(fullFieldTypes),
+ this.partDefaultName,
+ this.partPathField,
+ this.hiveStylePartitioning
+ );
+ this.itr = RecordIterators.getParquetRecordIterator(
+ internalSchemaManager,
+ utcTimestamp,
+ true,
+ conf.conf(),
+ fullFieldNames,
+ fullFieldTypes,
+ partObjects,
+ selectedFields,
+ 2048,
+ fileSplit.getPath(),
+ fileSplit.getStart(),
+ fileSplit.getLength(),
+ predicates);
+ }
this.currentReadCount = 0L;
}
+ private ClosableIterator<RowData> getLanceRecordIterator(Path path) {
+ DataType selectedDataType = DataTypes.ROW(Arrays.stream(selectedFields)
+ .mapToObj(i -> DataTypes.FIELD(fullFieldNames[i],
fullFieldTypes[i]))
+ .toArray(DataTypes.Field[]::new))
+ .bridgedTo(RowData.class);
+ HoodieSchema requestedSchema =
HoodieSchemaConverter.convertToSchema(selectedDataType.getLogicalType());
Review Comment:
not supported yet
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]