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

Julian Hyde commented on CALCITE-7331:
--------------------------------------

Can EXCLUDE repeat, and can it be used in a query that has non-star 
expressions? I think some of the DBs allow "select 1 as x, emp.* EXCLUDE(a), 
dept.* EXCLUDE (b, c), 2 as z from ..."

If it can be used in a query with non-star expressions, then "select 1 as x, 2 
as y except ((select 1 as x, 2 as y) except (select 2 as x, 3 as y))" requires 
unbounded lookahead for the parser to figure out which kind of 'except' it is 
looking at.

> Support the alias form SELECT * EXCEPT() for SELECT * EXCLUDE()
> ---------------------------------------------------------------
>
>                 Key: CALCITE-7331
>                 URL: https://issues.apache.org/jira/browse/CALCITE-7331
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.41.0
>            Reporter: Zhen Chen
>            Assignee: Zhen Chen
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.42.0
>
>
> Based on the CALCITE-7310 implementation, this Jira primarily serves as an 
> alias extension. For example:
> SELECT * EXCLUDE(deptno, empno) FROM emp;
> Similarly, it can be written as:
> SELECT * EXCEPT(deptno, empno) FROM emp;
> Similar to the implementation in ClickHouse[1], but the expr in <expr> 
> EXCEPT(col1, col2) only supports *.
> [1] 
> [https://clickhouse.com/docs/zh/sql-reference/statements/select/except-modifier]



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

Reply via email to