[
https://issues.apache.org/jira/browse/IMPALA-13320?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Zihao Ye closed IMPALA-13320.
-----------------------------
Resolution: Not A Bug
This seems unnecessary. There's little point in rewriting the WITH clause, as
they will be rewritten within InlineViewRef if needed.
> 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
> Priority: Major
>
> 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)