You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Yaohua Zhao (Jira)" <ji...@apache.org> on 2022/11/16 04:00:00 UTC

[jira] [Created] (SPARK-41151) Keep built-in file _metadata column nullable value consistent

Yaohua Zhao created SPARK-41151:
-----------------------------------

             Summary: Keep built-in file _metadata column nullable value consistent
                 Key: SPARK-41151
                 URL: https://issues.apache.org/jira/browse/SPARK-41151
             Project: Spark
          Issue Type: Bug
          Components: SQL
    Affects Versions: 3.3.1, 3.3.0, 3.3.2
            Reporter: Yaohua Zhao


In FileSourceStrategy, we add an Alias node to wrap the file metadata fields (e.g. file_name, file_size) in a NamedStruct ([here|https://github.com/apache/spark/blob/master/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/FileSourceStrategy.scala#L279]). But `CreateNamedStruct` has an override `nullable` value `false` ([here|https://github.com/apache/spark/blob/master/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/complexTypeCreator.scala#L443]), which is different from the `_metadata` struct `nullable` value `true` ([here|https://github.com/apache/spark/blob/master/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/namedExpressions.scala#L467]). 

 

We should keep the nullable value the same, otherwise, the downstream optimization rules might use the nullability here and cause unexpected behaviors.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org