Zihao Ye created IMPALA-13320:
---------------------------------

             Summary: WITH clause is not rewritten by ExprRewriter
                 Key: IMPALA-13320
                 URL: https://issues.apache.org/jira/browse/IMPALA-13320
             Project: IMPALA
          Issue Type: Bug
          Components: Frontend
    Affects Versions: Impala 4.4.1
            Reporter: Zihao Ye
            Assignee: Zihao Ye


We seem to have missed handling the WITH clause during expression rewriting. 
For example, executing the following query:
{code:sql}
WITH t AS (SELECT upper('abc') FROM test WHERE id > 0 OR false) SELECT * FROM t;
{code}
It can obviously be rewritten as:
{code:sql}
WITH t AS (SELECT 'ABC' FROM `default`.test WHERE id > CAST(0 AS INT)) SELECT * 
FROM t;
{code}
However, in the 'Text plan', the analyzed query we actually get is as follows:
{code:sql}
WITH t AS (SELECT upper('abc') FROM `default`.test WHERE id > CAST(0 AS INT) OR 
FALSE) SELECT * FROM t;
{code}



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to