kbendick commented on code in PR #4627:
URL: https://github.com/apache/iceberg/pull/4627#discussion_r859359649
##########
flink/v1.14/flink/src/main/java/org/apache/iceberg/flink/data/FlinkParquetReaders.java:
##########
@@ -116,7 +116,11 @@ public ParquetValueReader<RowData> struct(Types.StructType
expected, GroupType s
int id = field.fieldId();
if (idToConstant.containsKey(id)) {
// containsKey is used because the constant may be null
-
reorderedFields.add(ParquetValueReaders.constant(idToConstant.get(id)));
+
+ // We use the max definition level of the parent node to infer the
max definition level of the constant field
+ // in case of we could not find the given parquet field with
typesById.
+ int fieldD = type.getMaxDefinitionLevel(currentPath());
Review Comment:
nit: potential typo? `fieldD` reads oddly to me. Is that supposed to be
fieldDepth or fieldId? I've been thinking it was `fieldId`, but now I'm not
sure.
EDIT - nevermind. I see that `fieldD` is already a used name. It's a little
confusing to me, but given that it's already in the code it's fine.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]