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

Pull out common conjuncts from disjunctions

    Details

      Description

      I see this in tpch and tpcds where predicates look like this:

      where
      ( col = 1 AND ... AND ...) or
      ( col = 1 AND ... AND ...) or
      ( col = 1 AND ... AND ...)

      It's an OR of ANDs and there are predicates that are in each OR (col = 1). This could be pulled out.

        Issue Links

          Activity

          Hide
          dkumar@cloudera.com Dileep Kumar added a comment -

          Are there any update on this ?

          Show
          dkumar@cloudera.com Dileep Kumar added a comment - Are there any update on this ?
          Hide
          tarmstrong Tim Armstrong added a comment -

          Do we have a benchmark that exercises this?

          Show
          tarmstrong Tim Armstrong added a comment - Do we have a benchmark that exercises this?
          Hide
          dhecht Dan Hecht added a comment -

          Mostafa Mokhtar please see Tim's previous comment.

          Show
          dhecht Dan Hecht added a comment - Mostafa Mokhtar please see Tim's previous comment.
          Hide
          mmokhtar Mostafa Mokhtar added a comment -

          Tim Armstrong Dan Hecht
          Yes, several queries in TPC-H and TPC-DS are affected by this JIRA.

          One of them is TPC-H Q19
          https://github.com/apache/incubator-impala/blob/master/testdata/workloads/tpch/queries/tpch-q19.test

          Show
          mmokhtar Mostafa Mokhtar added a comment - Tim Armstrong Dan Hecht Yes, several queries in TPC-H and TPC-DS are affected by this JIRA. One of them is TPC-H Q19 https://github.com/apache/incubator-impala/blob/master/testdata/workloads/tpch/queries/tpch-q19.test
          Hide
          alex.behm Alexander Behm added a comment -

          commit 0aeb68050b3bc16b8a10a5a3ae65428e7edd9df5
          Author: Alex Behm <alex.behm@cloudera.com>
          Date: Mon Oct 17 23:01:57 2016 -0700

          IMPALA-1286: Extract common conjuncts from disjunctions.

          Adds a new ExprRewriteRule to extract common conjuncts from
          disjunctions.

          Examples:
          (a AND b AND c) OR (b AND d) ==> b AND ((a AND c) OR (d))
          (a AND b) OR (a AND b) ==> a AND b
          (a AND b AND c) OR (c) ==> c

          Adds a new query option ENABLE_EXPR_REWRITES to enable/disable
          non-essential expr rewrites in the FE. Note that some rewrites
          are required, e.g., BetweenToCompoundRule. Disabling the rewrites
          is useful for testing, in particular, to make sure that the exprs
          specified in expr-test.cc are executed as written.

          Testing: Added a new unit test in ExprRewriteRulesTest.

          Change-Id: I3cf9b950afaa3fd753d1b09ba5e540b5258940ad
          Reviewed-on: http://gerrit.cloudera.org:8080/4877
          Reviewed-by: Alex Behm <alex.behm@cloudera.com>
          Tested-by: Internal Jenkins

          Show
          alex.behm Alexander Behm added a comment - commit 0aeb68050b3bc16b8a10a5a3ae65428e7edd9df5 Author: Alex Behm <alex.behm@cloudera.com> Date: Mon Oct 17 23:01:57 2016 -0700 IMPALA-1286 : Extract common conjuncts from disjunctions. Adds a new ExprRewriteRule to extract common conjuncts from disjunctions. Examples: (a AND b AND c) OR (b AND d) ==> b AND ((a AND c) OR (d)) (a AND b) OR (a AND b) ==> a AND b (a AND b AND c) OR (c) ==> c Adds a new query option ENABLE_EXPR_REWRITES to enable/disable non-essential expr rewrites in the FE. Note that some rewrites are required, e.g., BetweenToCompoundRule. Disabling the rewrites is useful for testing, in particular, to make sure that the exprs specified in expr-test.cc are executed as written. Testing: Added a new unit test in ExprRewriteRulesTest. Change-Id: I3cf9b950afaa3fd753d1b09ba5e540b5258940ad Reviewed-on: http://gerrit.cloudera.org:8080/4877 Reviewed-by: Alex Behm <alex.behm@cloudera.com> Tested-by: Internal Jenkins
          Hide
          mmokhtar Mostafa Mokhtar added a comment -

          Alexander Behm John Russell -
          Docs work required as new query option is added ENABLE_EXPR_REWRITES

          Show
          mmokhtar Mostafa Mokhtar added a comment - Alexander Behm John Russell - Docs work required as new query option is added ENABLE_EXPR_REWRITES

            People

            • Assignee:
              alex.behm Alexander Behm
              Reporter:
              nong_impala_60e1 Nong Li
            • Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development