loserwang1024 commented on code in PR #4108:
URL: https://github.com/apache/flink-cdc/pull/4108#discussion_r2299684513


##########
flink-cdc-connect/flink-cdc-source-connectors/flink-connector-debezium/src/main/java/org/apache/flink/cdc/debezium/event/DebeziumEventDeserializationSchema.java:
##########
@@ -472,6 +482,57 @@ protected Object convertToMap(Object dbzObj, Schema 
schema) throws Exception {
         return new GenericMapData(convertedMap);
     }
 
+    protected Object convertToArray(Object dbzObj, Schema schema) throws 
Exception {
+        if (dbzObj == null) {
+            return null;
+        }
+
+        Schema elementSchema = schema.valueSchema();
+        DataType elementType = schemaDataTypeInference.infer(null, 
elementSchema);
+        DeserializationRuntimeConverter elementConverter = 
createConverter(elementType);
+
+        if (dbzObj instanceof java.util.List) {
+            java.util.List<?> list = (java.util.List<?>) dbzObj;
+            Object[] array = new Object[list.size()];
+
+            for (int i = 0; i < list.size(); i++) {
+                Object element = list.get(i);
+                if (element != null) {
+                    if (elementSchema.type() == Schema.Type.ARRAY) {
+                        array[i] = convertToArray(element, elementSchema);

Review Comment:
   If we are not support now, maybe we can throw exception, and add this 
limitation to documents. When we support debezium 2.x, we can add it.
   
   More liminations at the begining will be more flexible. If we open the door, 
it hard to modify later. 



-- 
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: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to