You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Nicholas Chammas (JIRA)" <ji...@apache.org> on 2016/11/02 21:31:59 UTC

[jira] [Commented] (SPARK-16726) Improve `Union/Intersect/Except` error messages on incompatible types

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

Nicholas Chammas commented on SPARK-16726:
------------------------------------------

I just hit this error in 2.0.1 and it was this JIRA that helped me figure out what was going on. Thanks for addressing this issue [~dongjoon]!

> Improve `Union/Intersect/Except` error messages on incompatible types
> ---------------------------------------------------------------------
>
>                 Key: SPARK-16726
>                 URL: https://issues.apache.org/jira/browse/SPARK-16726
>             Project: Spark
>          Issue Type: Improvement
>            Reporter: Dongjoon Hyun
>            Assignee: Dongjoon Hyun
>            Priority: Minor
>             Fix For: 2.1.0
>
>
> Currently, `UNION/INTERSECT/EXCEPT` query on incompatible types shows a misleading error message like `unresolved operator Union`. We had better show a more correct message. This will help users in the situation of [SPARK-16704|https://issues.apache.org/jira/browse/SPARK-16704]
> h4. Before
> {code}
> scala> sql("select 1,2,3 union (select 1,array(2),3)")
> org.apache.spark.sql.AnalysisException: unresolved operator 'Union;
> scala> sql("select 1,2,3 intersect (select 1,array(2),3)")
> org.apache.spark.sql.AnalysisException: unresolved operator 'Intersect;
> scala> sql("select 1,2,3 except (select 1,array(2),3)")
> org.apache.spark.sql.AnalysisException: unresolved operator 'Except;
> {code}
> h4. After
> {code}
> scala> sql("select 1,2,3 union (select 1,array(2),3)")
> org.apache.spark.sql.AnalysisException: Union can only be performed on tables with the compatible column types. The first table has `[IntegerType, IntegerType, IntegerType]` and second table has `[IntegerType, ArrayType(IntegerType,false), IntegerType]`. The 2th column is incompatible;
> scala> sql("select 1,2,3 intersect (select 1,array(2),3)")
> org.apache.spark.sql.AnalysisException: Intersect can only be performed on tables with the compatible column types. The first table has `[IntegerType, IntegerType, IntegerType]` and second table has `[IntegerType, ArrayType(IntegerType,false), IntegerType]`. The 2th column is incompatible;
> scala> sql("select 1,2,3 except (select 1,array(2),3)")
> org.apache.spark.sql.AnalysisException: Except can only be performed on tables with the compatible column types. The first table has `[IntegerType, IntegerType, IntegerType]` and second table has `[IntegerType, ArrayType(IntegerType,false), IntegerType]`. The 2th column is incompatible;
> {code}



--
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