viirya commented on a change in pull request #23719: [SPARK-26808][SQL] Pruned 
schema should not change nullability
URL: https://github.com/apache/spark/pull/23719#discussion_r252921710
 
 

 ##########
 File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetSchemaPruning.scala
 ##########
 @@ -280,7 +280,7 @@ private[sql] object ParquetSchemaPruning extends 
Rule[LogicalPlan] {
           val leftFieldType = leftStruct(fieldName).dataType
           val rightFieldType = rightStruct(fieldName).dataType
           val sortedLeftFieldType = sortLeftFieldsByRight(leftFieldType, 
rightFieldType)
-          StructField(fieldName, sortedLeftFieldType)
+          StructField(fieldName, sortedLeftFieldType, nullable = 
leftStruct(fieldName).nullable)
 
 Review comment:
   If left and right have different nullability, it means we do something wrong 
when preparing pruned schema.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to