rdblue commented on code in PR #9515: URL: https://github.com/apache/iceberg/pull/9515#discussion_r1941637351
########## spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/data/SparkParquetReaders.java: ########## @@ -198,8 +198,16 @@ public ParquetValueReader<?> list( Types.ListType expectedList, GroupType array, ParquetValueReader<?> elementReader) { String[] repeatedPath = currentPath(); - int repeatedD = type.getMaxDefinitionLevel(repeatedPath) - 1; - int repeatedR = type.getMaxRepetitionLevel(repeatedPath) - 1; + int repeatedD; + int repeatedR; + + if (type.isRepetition(Type.Repetition.REPEATED)) { + repeatedD = type.getMaxDefinitionLevel(repeatedPath); + repeatedR = type.getMaxRepetitionLevel(repeatedPath); + } else { + repeatedD = type.getMaxDefinitionLevel(repeatedPath) - 1; + repeatedR = type.getMaxRepetitionLevel(repeatedPath) - 1; + } Review Comment: This would need tests if it were to be merged. -- 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...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org