wangwei1025 commented on a change in pull request #15746:
URL: https://github.com/apache/flink/pull/15746#discussion_r620868599



##########
File path: 
flink-formats/flink-orc/src/main/java/org/apache/flink/orc/vector/RowDataVectorizer.java
##########
@@ -151,8 +160,114 @@ private static void setColumn(
                     vector.set(rowId, timestamp);
                     break;
                 }
+            case ARRAY:
+                {
+                    ListColumnVector listColumnVector = (ListColumnVector) 
column;
+                    setColumn(rowId, listColumnVector, type, row, columnId);
+                    break;
+                }
+            case MAP:
+                {
+                    MapColumnVector mapColumnVector = (MapColumnVector) column;
+                    setColumn(rowId, mapColumnVector, type, row, columnId);
+                    break;
+                }
+            case ROW:
+                {
+                    StructColumnVector structColumnVector = 
(StructColumnVector) column;
+                    setColumn(rowId, structColumnVector, type, row, columnId);
+                    break;
+                }
             default:
                 throw new UnsupportedOperationException("Unsupported type: " + 
type);
         }
     }
+
+    private static void setColumn(
+            int rowId,
+            ListColumnVector listColumnVector,
+            LogicalType type,
+            RowData row,
+            int columnId) {
+        ArrayData arrayData = row.getArray(columnId);
+        ArrayType arrayType = (ArrayType) type;
+        listColumnVector.lengths[rowId] = arrayData.size();
+        listColumnVector.offsets[rowId] = listColumnVector.childCount;
+        listColumnVector.childCount += listColumnVector.lengths[rowId];
+        listColumnVector.child.ensureSize(
+                listColumnVector.childCount, listColumnVector.offsets[rowId] 
!= 0);
+        for (int i = 0; i < arrayData.size(); i++) {
+            setColumn(
+                    (int) listColumnVector.offsets[rowId] + i,
+                    listColumnVector.child,
+                    arrayType.getElementType(),
+                    convert(arrayData, arrayType.getElementType()),

Review comment:
       Yes, it's uncessary. This happend in 
setColumn(int,MapColumnVector,LogicalType,RowData,int)  too. I fix them in this 
latest commit [hotfix]move convert out of loop




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

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


Reply via email to