lirui-apache commented on a change in pull request #15746: URL: https://github.com/apache/flink/pull/15746#discussion_r620826305
########## 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: Move this out of the loop so that we don't do this for each field? -- 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