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

ExprRewriter did not rewrite 'id = 0 OR false' as expected

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • Impala 4.3.0, Impala 4.4.0
    • Impala 4.5.0, Impala 4.4.1
    • Frontend
    • None
    • ghx-label-6

    Description

      The comments in the SimplifyConditionalsRule class mention that 'id = 0 OR false' would be rewritten to 'id = 0', but in reality, it does not perform this rewrite as expected. After executing such SQL, we can see in the text plan that:

      Analyzed query: SELECT * FROM functional.alltypestiny WHERE FALSE OR id = CAST(0
      AS INT) 

      The issue appears to be that the CompoundPredicate generated by NormalizeExprsRule was not analyzed, causing the SimplifyConditionalsRule to skip the rewrite.

      Attachments

        1. query-reduced.sql
          0.6 kB
          Michael Smith
        2. tables-reduced.sql
          0.3 kB
          Michael Smith

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: