gengliangwang commented on code in PR #37501:
URL: https://github.com/apache/spark/pull/37501#discussion_r944887434
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetRowConverter.scala:
##########
@@ -282,14 +239,17 @@ private[parquet] class ParquetRowConverter(
// Create a RowUpdater instance for converting Parquet objects to
Catalyst rows. If any fields
// in the Catalyst result schema have associated existence default
values, maintain a boolean
// array to track which fields have been explicitly assigned for each
row.
- val rowUpdater: RowUpdater =
- if (catalystType.hasExistenceDefaultValues) {
- resetExistenceDefaultsBitmask(catalystType)
- new RowUpdaterWithBitmask(
- currentRow, catalystFieldIndex,
catalystType.existenceDefaultsBitmask)
- } else {
- new RowUpdater(currentRow, catalystFieldIndex)
+ val rowUpdater: RowUpdater = new RowUpdater(currentRow,
catalystFieldIndex)
+ if (catalystType.hasExistenceDefaultValues) {
+ for (i <- 0 until catalystType.existenceDefaultValues.size) {
+ catalystType.existenceDefaultsBitmask(i) =
+ if (i < parquetType.getFieldCount) {
Review Comment:
Why comparing with `parquetType.getFieldCount` here?
--
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]