hudi-agent commented on code in PR #19831:
URL: https://github.com/apache/hudi/pull/19831#discussion_r3927698934
##########
hudi-client/hudi-flink-client/src/main/java/org/apache/hudi/io/storage/row/lance/LanceRowDataWriter.java:
##########
@@ -113,15 +130,36 @@ private static FieldWriter createWriter(LogicalType type,
FieldVector vector, bo
StructVector structVector = (StructVector) vector;
FieldWriter[] fieldWriters = new FieldWriter[rowType.getFieldCount()];
for (int i = 0; i < fieldWriters.length; i++) {
+ String childName = rowType.getFieldNames().get(i);
fieldWriters[i] = createWriter(
- rowType.getTypeAt(i), (FieldVector)
structVector.getChildByOrdinal(i), utcTimestamp);
+ rowType.getTypeAt(i),
+ HoodieSchemaUtils.getFieldSchema(hoodieSchema,
childName).getNonNullType(),
+ (FieldVector) structVector.getChildByOrdinal(i),
+ utcTimestamp,
+ fieldPath + "." + childName);
}
return new RowWriter(structVector, fieldWriters);
case ARRAY:
ArrayType arrayType = (ArrayType) type;
+ if (hoodieSchema != null && hoodieSchema.getType() ==
HoodieSchemaType.VECTOR) {
+ HoodieSchema.Vector vectorSchema = (HoodieSchema.Vector)
hoodieSchema;
+ FixedSizeListVector fixedSizeListVector = (FixedSizeListVector)
vector;
+ FieldWriter vectorElementWriter = createWriter(
+ arrayType.getElementType(),
+ null,
Review Comment:
🤖 nit: passing explicit `null` for `hoodieSchema` here creates a silent
coupling with the `if (hoodieSchema != null && ...)` guard a few lines below —
a reader has to trace both sides to understand it's intentional. Could you
introduce a small private overload (e.g. `createPrimitiveWriter(LogicalType,
FieldVector, boolean, String)`) for the leaf/element case, so the null is never
needed?
<sub><i>⚠️ AI-generated; verify before applying. React 👍/👎 to flag
quality.</i></sub>
--
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]