You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@impala.apache.org by "Qifan Chen (Code Review)" <ge...@cloudera.org> on 2022/04/29 16:43:21 UTC

[Impala-ASF-CR] IMPALA-11274: CNF Rewrite causes a regress in join node performance

Qifan Chen has uploaded a new patch set (#5). ( http://gerrit.cloudera.org:8080/18458 )

Change subject: IMPALA-11274: CNF Rewrite causes a regress in join node performance
......................................................................

IMPALA-11274: CNF Rewrite causes a regress in join node performance

This patch defines a subset of all predicates that are common and
relatively inexpensive to compute. Such predicates must involve
columns, constants or CAST only and are not one of the following.

  1. LIKE
  2. [NOT] EXISTS

Examples of the subset of predicates allowed:

  1. (a = 1 AND cast(b as int) = 2) OR (c = d AND e = f)
  2. a in ('1', '2', '3') OR ((b = 'abc') AND (c = d))
  3. a between 1 and 100) OR ((b is null) AND (c = d))

Examples of the predicates not allowed:
  1. (upper(a) != 'Y') AND b = 2) OR (c = d AND e = f)
  2. (coalesce(CAST(a AS string), '') = '') AND b = 2) OR
     (c = d AND e = f)

This patch further restricts the predicates to be converted to
conjunctive norm form (CNF) to be such a subset, with the aim to
reduce the run-time evaluation overhead of CNFs in which some
of the predicates can be duplicated.

Testing:
  1. Added a new test TestFeasibleToConvertToCNF() in ExprRewriterTest.java;
  2. Core tests;
  3. perf-AB-test [TBD].

Change-Id: I326406c6b004fe31ec0e2a2f390a3845b8925aa9
---
M fe/src/main/java/org/apache/impala/analysis/CompoundPredicate.java
M fe/src/main/java/org/apache/impala/analysis/ExistsPredicate.java
M fe/src/main/java/org/apache/impala/analysis/Expr.java
M fe/src/main/java/org/apache/impala/analysis/FunctionCallExpr.java
M fe/src/main/java/org/apache/impala/analysis/IsNotEmptyPredicate.java
M fe/src/main/java/org/apache/impala/analysis/LikePredicate.java
M fe/src/main/java/org/apache/impala/analysis/Predicate.java
M fe/src/main/java/org/apache/impala/analysis/TupleIsNullPredicate.java
M fe/src/main/java/org/apache/impala/rewrite/ConvertToCNFRule.java
M fe/src/test/java/org/apache/impala/analysis/ExprRewriterTest.java
10 files changed, 139 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/58/18458/5
-- 
To view, visit http://gerrit.cloudera.org:8080/18458
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I326406c6b004fe31ec0e2a2f390a3845b8925aa9
Gerrit-Change-Number: 18458
Gerrit-PatchSet: 5
Gerrit-Owner: Qifan Chen <qc...@cloudera.com>
Gerrit-Reviewer: Aman Sinha <am...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Kurt Deschler <kd...@cloudera.com>
Gerrit-Reviewer: Quanlong Huang <hu...@gmail.com>