You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Tanmay Deshpande (JIRA)" <ji...@apache.org> on 2016/02/25 10:55:18 UTC
[jira] [Updated] (SPARK-13491) Issue using table alias in Spark SQL
case statement
[ https://issues.apache.org/jira/browse/SPARK-13491?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Tanmay Deshpande updated SPARK-13491:
-------------------------------------
Description:
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";
was:
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";
> 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
> Reporter: Tanmay Deshpande
>
> 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.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org