[
https://issues.apache.org/jira/browse/SPARK-38266?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
wuyi resolved SPARK-38266.
--------------------------
Resolution: Fixed
> 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: [email protected]
For additional commands, e-mail: [email protected]