You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Apache Spark (Jira)" <ji...@apache.org> on 2022/12/05 06:37:00 UTC

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

    [ https://issues.apache.org/jira/browse/SPARK-41151?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17643133#comment-17643133 ] 

Apache Spark commented on SPARK-41151:
--------------------------------------

User 'Yaohua628' has created a pull request for this issue:
https://github.com/apache/spark/pull/38910

> 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.3.2, 3.4.0
>
>
> 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