Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-13320

WITH clause is not rewritten by ExprRewriter

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Bug
    • Impala 4.4.1
    • None
    • Frontend
    • None
    • ghx-label-9

    Description

      We seem to have missed handling the WITH clause during expression rewriting. For example, executing the following query:

      WITH t AS (SELECT upper('abc') FROM test WHERE id > 0 OR false) SELECT * FROM t;
      

      It can obviously be rewritten as:

      WITH t AS (SELECT 'ABC' FROM `default`.test WHERE id > CAST(0 AS INT)) SELECT * FROM t;
      

      However, in the 'Text plan', the analyzed query we actually get is as follows:

      WITH t AS (SELECT upper('abc') FROM `default`.test WHERE id > CAST(0 AS INT) OR FALSE) SELECT * FROM t;
      

      Attachments

        Activity

          People

            eyizoha Zihao Ye
            eyizoha Zihao Ye
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: