KevinWen007 commented on a change in pull request #2615:
URL: https://github.com/apache/incubator-inlong/pull/2615#discussion_r810914185



##########
File path: 
inlong-sort/sort-connectors/src/main/java/org/apache/inlong/sort/flink/clickhouse/ClickHouseRowConverter.java
##########
@@ -83,8 +91,64 @@ private static void setField(
             statement.setDate(index + 1, (Date) value);
         } else if (typeInfo instanceof TimestampTypeInfo) {
             statement.setTimestamp(index + 1, (Timestamp) value);
+        } else if (typeInfo instanceof ArrayTypeInfo) {
+            TypeInfo elementTypeInfo = ((ArrayTypeInfo) 
typeInfo).getElementTypeInfo();
+            statement.setArray(index + 1, new ClickHouseArray(
+                    getClickHouseDataTypeFromTypeInfo(elementTypeInfo), 
toObjectArray(elementTypeInfo, value)));
+        } else if (typeInfo instanceof MapTypeInfo) {
+            Map<?, ?> mapValue = (Map<?, ?>) value;
+            int size = mapValue.size();
+            Object[] kvps = new Object[size * 2];
+            int i = 0;
+            for (Map.Entry<?, ?> entry : mapValue.entrySet()) {
+                kvps[i] = entry.getKey();
+                kvps[i + 1] = entry.getValue();
+                i += 2;
+            }
+            statement.setObject(index + 1, Utils.mapOf(kvps));

Review comment:
       done




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