[ 
https://issues.apache.org/jira/browse/SPARK-41151?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jungtaek Lim updated SPARK-41151:
---------------------------------
    Fix Version/s: 3.3.2

> 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.0, 3.3.1, 3.3.2
>            Reporter: Yaohua Zhao
>            Assignee: Yaohua Zhao
>            Priority: Major
>             Fix For: 3.4.0, 3.3.2
>
>
> 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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to