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

Alessandro Solimando commented on CALCITE-7027:
-----------------------------------------------

Fixed via 
[40e9099|https://github.com/apache/calcite/commit/40e90998ac111a15838fe6cdb90c54aafa28cee0],
 thanks [~Sergey Nuyanzin] for the fix, [~julianhyde], [~mbudiu], [~nobigo] and 
[~jensen] for reviewing!

> Improve error message in case of several `UNION`, `INTERSECT`, `EXCEPT` in a 
> query
> ----------------------------------------------------------------------------------
>
>                 Key: CALCITE-7027
>                 URL: https://issues.apache.org/jira/browse/CALCITE-7027
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 1.39.0
>            Reporter: Sergey Nuyanzin
>            Assignee: Sergey Nuyanzin
>            Priority: Minor
>              Labels: pull-request-available
>             Fix For: 1.40.0
>
>
> -We have our exception classification system internally which based on cause 
> decides whether it is a user exception or not. Since currently there 
> {{Util#needToImplement}} which might be thrown from multiple places. We 
> prefer to not include the whole variety of {{Util#needToImplement}} to user 
> error since it would be tricky to control.-
> -The proposal is to introduce also some message part which could allow to add 
> more context what exactly is not implemented-
> -Also open to other suggestions-
> UPD: it looks the reason of failures we faced is unsupported {{UNION}}, 
> {{INTERSECT}}, {{EXCEPT}}, {{MINUS}} in {{SqlUtil#getSelectListItem}}
> renamed jira issue 
> to reproduce
> {code:sql}
> SELECT name FROM dept UNION SELECT name FROM dept UNION SELECT slacker FROM 
> emp
> {code}
> currently fails with
> {noformat}
> Caused by: java.lang.UnsupportedOperationException: class 
> org.apache.calcite.sql.SqlBasicCall: SELECT `NAME`
> FROM `DEPT`
> UNION
> SELECT `NAME`
> FROM `DEPT`
> {noformat}
> while the issue is type mismatch column
> after the fix it should fail as
> {noformat}
> Type mismatch in column 1 of UNION
> {noformat}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to