HyukjinKwon 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_r252951587
 
 

 ##########
 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:
   Agree with being conservative in general. For this fix, specifically, keeps 
the original nullability from the input as are, which is supposed to be. So, 
this is actually more conservative since it doesn't modify the input's 
nullability.

----------------------------------------------------------------
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