You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@impala.apache.org by "Zach Amsden (Code Review)" <ge...@cloudera.org> on 2017/04/17 21:46:54 UTC

[Impala-ASF-CR] IMPALA-5159: Optimze predicates [DRAFT]

Zach Amsden has uploaded a new patch set (#2).

Change subject: IMPALA-5159: Optimze predicates [DRAFT]
......................................................................

IMPALA-5159: Optimze predicates [DRAFT]

In addition to propagating constants, we can infer bounds on slotRefs
which are implied by other constant bounds.  Such conjuncts may help
us create min/max filters and/or restrict partitions.  In addition,
there is no reason not to support null-safe operators for use in joins.
In many cases, we may derive contradictions from empty ranges, and
also eliminate tests which are outside of the range.

Testing: Manual testing.  No currently known bugs.

This will have to be staged as a change to
the normalization rule, along with all the planner tests that get
changed, then an additional checkin to support this optimization.

For example:
 int_col1 >= int_col2 and int_col2 >= int_col1
 predicates: int_col1 = int_col2

 int_col1 >= 10 and int_col2 < int_col1 and int_col2 > 15
   and int_col1 != -100
 predicates: int_col1 > 15, int_col1 > int_col2, int_col2 > 15

 int_col1 <=> int_col2 and int_col1 >= int_col2
 predicates: int_col1 = int_col2

 int_col1 <= int_col2 and int_col2 <= int_col3 and int_col1 >= int_col3
 predicate: int_col1 = int_col2, int_col1 = int_col3

Change-Id: I708ce5aa2e04f8d572af6dbc9b4e49b662843f34
---
M fe/src/main/java/org/apache/impala/analysis/BinaryPredicate.java
M fe/src/main/java/org/apache/impala/analysis/Expr.java
M fe/src/main/java/org/apache/impala/planner/SingleNodePlanner.java
M fe/src/main/java/org/apache/impala/planner/ValueRange.java
M fe/src/main/java/org/apache/impala/rewrite/NormalizeBinaryPredicatesRule.java
5 files changed, 722 insertions(+), 61 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/50/6650/2
-- 
To view, visit http://gerrit.cloudera.org:8080/6650
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I708ce5aa2e04f8d572af6dbc9b4e49b662843f34
Gerrit-PatchSet: 2
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Zach Amsden <za...@cloudera.com>
Gerrit-Reviewer: Alex Behm <al...@cloudera.com>
Gerrit-Reviewer: Dan Hecht <dh...@cloudera.com>
Gerrit-Reviewer: Zach Amsden <za...@cloudera.com>