FWLamb commented on code in PR #3047:
URL: 
https://github.com/apache/incubator-seatunnel/pull/3047#discussion_r996653946


##########
seatunnel-translation/seatunnel-translation-spark/seatunnel-translation-spark-common/src/main/java/org/apache/seatunnel/translation/spark/common/serialization/InternalRowConverter.java:
##########
@@ -216,4 +213,31 @@ private static SeaTunnelRow reconvert(InternalRow 
engineRow, SeaTunnelRowType ro
         }
         return new SeaTunnelRow(fields);
     }
+
+    private static Object reconvertArray(Object field, SeaTunnelDataType<?> 
dataType) {
+        BasicType<?> elementType = ((ArrayType<?, ?>) 
dataType).getElementType();
+        Object[] objectArray = ((ArrayData) 
field).toObjectArray(TypeConverterUtils.convert(elementType));
+        switch (elementType.getSqlType()) {

Review Comment:
   > Why we need copy data from array to another array?
   
   Because we need to convert the object type array to the exact wrapper type 
array according to the SQL type. If we do not do this, when JDBC inserts the 
array data, it will return ClassCastException.



-- 
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]

Reply via email to