Carl-Zhou-CN commented on code in PR #7283:
URL: https://github.com/apache/seatunnel/pull/7283#discussion_r1699519199
##########
seatunnel-translation/seatunnel-translation-spark/seatunnel-translation-spark-common/src/main/java/org/apache/seatunnel/translation/spark/serialization/InternalRowConverter.java:
##########
@@ -63,17 +64,24 @@
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
+import java.util.stream.IntStream;
public final class InternalRowConverter extends RowConverter<InternalRow> {
+ private final int[] indexes;
public InternalRowConverter(SeaTunnelDataType<?> dataType) {
super(dataType);
+ indexes = IntStream.range(0, ((SeaTunnelRowType)
dataType).getTotalFields()).toArray();
+ }
+
+ public InternalRowConverter(SeaTunnelDataType<?> dataType, int[] indexes) {
+ super(dataType);
+ this.indexes = indexes;
}
@Override
public InternalRow convert(SeaTunnelRow seaTunnelRow) throws IOException {
- validate(seaTunnelRow);
- return (InternalRow) convert(seaTunnelRow, dataType);
+ return parcel(seaTunnelRow, (SeaTunnelRowType) dataType);
}
Review Comment:
I will refactor and consolidate this part of the logic and provide test
cases.
--
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]