KevinWen007 commented on a change in pull request #2627:
URL: https://github.com/apache/incubator-inlong/pull/2627#discussion_r810967326
##########
File path:
inlong-sort/sort-single-tenant/src/main/java/org/apache/inlong/sort/singletenant/flink/Entrance.java
##########
@@ -121,15 +125,22 @@ private static DataFlowInfo
getDataflowInfoFromFile(String fileName) throws IOEx
SourceInfo sourceInfo,
Configuration config
) throws IOException, ClassNotFoundException {
- DeserializationSchema<Row> schema =
- DeserializationSchemaFactory.build(sourceInfo.getFields(),
sourceInfo.getDeserializationInfo());
- DeserializationFunction function = new DeserializationFunction(schema);
+ FieldInfo[] sourceFields = sourceInfo.getFields();
+ DeserializationSchema<Row> schema = DeserializationSchemaFactory.build(
+ extractNonBuiltInFieldInfo(sourceFields),
sourceInfo.getDeserializationInfo());
+ FieldMappingTransformer fieldMappingTransformer = new
FieldMappingTransformer(config, sourceFields);
+ DeserializationFunction function = new DeserializationFunction(schema,
fieldMappingTransformer);
return sourceStream.process(function)
.uid(Constants.DESERIALIZATION_SCHEMA_UID)
.name("Deserialization")
.setParallelism(config.getInteger(Constants.DESERIALIZATION_PARALLELISM));
}
+ private static FieldInfo[] extractNonBuiltInFieldInfo(FieldInfo[]
fieldInfos) {
+ return Arrays.stream(fieldInfos).filter(fieldInfo -> !(fieldInfo
instanceof BuiltInFieldInfo)).toArray(
+ FieldInfo[]::new);
+ }
+
Review comment:
I don't think it's necessary to move it to CommonUtils currently.
--
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]