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

[jira] [Assigned] (SPARK-38266) UnresolvedException: Invalid call to dataType on unresolved object caused by GetDateFieldOperations

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

wuyi reassigned SPARK-38266:
----------------------------

    Assignee: wuyi

> UnresolvedException: Invalid call to dataType on unresolved object caused by GetDateFieldOperations
> ---------------------------------------------------------------------------------------------------
>
>                 Key: SPARK-38266
>                 URL: https://issues.apache.org/jira/browse/SPARK-38266
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 3.3.0, 3.2
>            Reporter: wuyi
>            Assignee: wuyi
>            Priority: Major
>
> {code:java}
> test("GetDateFieldOperations should skip unresolved nodes") {
>   withSQLConf(SQLConf.ANSI_ENABLED.key -> "true") {
>     val df = Seq("1644821603").map(i => (i.toInt, i)).toDF("tsInt", "tsStr")
>     val df1 = df.select(df("tsStr").cast("timestamp")).as("df1")
>     val df2 = df.select(df("tsStr").cast("timestamp")).as("df2")
>     df1.join(df2, $"df1.tsStr" === $"df2.tsStr", "left_outer")
>     val df3 = df1.join(df2, $"df1.tsStr" === $"df2.tsStr", "left_outer")
>       .select($"df1.tsStr".as("timeStr")).as("df3")
>     // This throws "UnresolvedException: Invalid call to
>     // dataType on unresolved object" instead of "AnalysisException: Column 'df1.timeStr' does not exist."
>     df3.join(df1, year($"df1.timeStr") === year($"df3.tsStr"))
>   }
> } {code}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

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