[
https://issues.apache.org/jira/browse/SPARK-13491?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Hyukjin Kwon resolved SPARK-13491.
----------------------------------
Resolution: Cannot Reproduce
{code}
val employee1 = Seq(Tuple2("Hyukjin", 1), Tuple2("Tom", 2)).toDF("name", "id")
val employee2 = Seq(Tuple2("Hyukjin", 1), Tuple2("Tom", 2), Tuple2("Jackson",
3)).toDF("name", "id")
employee1.createOrReplaceTempView("employee1")
employee2.createOrReplaceTempView("employee2")
val sqlStatement = s"select case when (employee1.id = employee2.id and
concat(employee1.name) = concat(employee2.name) ) then 'NoChange' end from
employee1 full outer join employee2 on employee1.id = employee2.id"
spark.sql(sqlStatement).show()
{code}
I can't reproduce this. Please reopen this if this still exists and there is a
better reproducer or steps to reproduce this.
> Issue using table alias in Spark SQL case statement
> ---------------------------------------------------
>
> Key: SPARK-13491
> URL: https://issues.apache.org/jira/browse/SPARK-13491
> Project: Spark
> Issue Type: Bug
> Components: SQL
> Reporter: Tanmay Deshpande
>
> Spark Version 1.6.0 and 1.5.2
> I am trying to run a Hive query from Spark SQL doing so when I use case
> statements in select. I get an error saying
> 16/02/25 15:19:30 INFO audit: ugi=admin1 ip=unknown-ip-addr
> cmd=get_table : db=default tbl=employee2
> Exception in thread "main" org.apache.spark.sql.AnalysisException: cannot
> resolve 'employee1.id' given input columns salary, name, name, salary, id,
> id; line 1 pos 18
> My Query in Spark is
> val sqlStatement = s"select case when (employee1.id = employee2.id and
> concat(employee1.*) = concat(employee2.*) ) then 'NoChange' end from
> employee1 full outer join employee2 on employee1.id = employee2.id";
>
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]