You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@impala.apache.org by "Matthew Jacobs (Code Review)" <ge...@cloudera.org> on 2016/08/15 16:29:40 UTC

[Impala-ASF-CR] IMPALA-3856,IMPALA-3871: Fix BinaryPredicate normalization for Kudu

Matthew Jacobs has uploaded a new change for review.

  http://gerrit.cloudera.org:8080/3986

Change subject: IMPALA-3856,IMPALA-3871: Fix BinaryPredicate normalization for Kudu
......................................................................

IMPALA-3856,IMPALA-3871: Fix BinaryPredicate normalization for Kudu

Change-Id: Iae7612433a2e27f8887abe6624f9ee0f4867b934
---
M fe/src/main/java/com/cloudera/impala/analysis/BinaryPredicate.java
A testdata/workloads/functional-query/queries/QueryTest/kudu-expr.test
M tests/query_test/test_kudu.py
3 files changed, 39 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/86/3986/1
-- 
To view, visit http://gerrit.cloudera.org:8080/3986
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iae7612433a2e27f8887abe6624f9ee0f4867b934
Gerrit-PatchSet: 1
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Matthew Jacobs <mj...@cloudera.com>

[Impala-ASF-CR] IMPALA-3856,IMPALA-3871: Fix BinaryPredicate normalization for Kudu

Posted by "Alex Behm (Code Review)" <ge...@cloudera.org>.
Alex Behm has posted comments on this change.

Change subject: IMPALA-3856,IMPALA-3871: Fix BinaryPredicate normalization for Kudu
......................................................................


Patch Set 1:

(3 comments)

http://gerrit.cloudera.org:8080/#/c/3986/1/fe/src/main/java/com/cloudera/impala/analysis/BinaryPredicate.java
File fe/src/main/java/com/cloudera/impala/analysis/BinaryPredicate.java:

Line 126:     SlotRef ref = predicate.getBoundSlot();
I think we should make this procedure more specific. getBoundSlot() internally uses unwrapSlotRef() which drills through implicit casts, but we don't actually want that here.

Imo, we should check instanceof SlotRef on the children and not rely on getBoundSlot() or unwrapSlotRef()


Line 135:       predicate.foldConstantChildren(analyzer);
Some of the functions used here feel a little clunky with respect to exception behavior.

It's weird that this function throws for unsupported literal types. 

I think we should change foldConstantChildren() in one of the following ways:
* either not throw at all and just leave exprs that failed to fold
* only throw when the BE eval failed and add a boolean return value indicating whether all exprs succeeded in folding or not

Happy to discuss if you have other ideas for cleaning this up.


http://gerrit.cloudera.org:8080/#/c/3986/1/tests/query_test/test_kudu.py
File tests/query_test/test_kudu.py:

Line 100:   def test_kudu_expr(self, vector):
might be safer to mark this as serial due to setup and teardown. I know it's not required if only this one test is is not run serially, but as soon as you add another it's going to break.


-- 
To view, visit http://gerrit.cloudera.org:8080/3986
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Iae7612433a2e27f8887abe6624f9ee0f4867b934
Gerrit-PatchSet: 1
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Matthew Jacobs <mj...@cloudera.com>
Gerrit-Reviewer: Alex Behm <al...@cloudera.com>
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-3856,IMPALA-3871: Fix BinaryPredicate normalization for Kudu

Posted by "Alex Behm (Code Review)" <ge...@cloudera.org>.
Alex Behm has posted comments on this change.

Change subject: IMPALA-3856,IMPALA-3871: Fix BinaryPredicate normalization for Kudu
......................................................................


Patch Set 2:

(7 comments)

http://gerrit.cloudera.org:8080/#/c/3986/2/fe/src/main/java/com/cloudera/impala/analysis/BinaryPredicate.java
File fe/src/main/java/com/cloudera/impala/analysis/BinaryPredicate.java:

Line 117:    * Normalizes a 'predicate' consisting of one SlotRef and an expr that is constant into
... consisting of an uncast SlotRef and a constant Expr...

we usually use <SlotRef> <op> <LiteralExpr>


Line 123:       throws AnalysisException {
does not throw anymore, right?


Line 144:       LOG.debug("BinaryPredicate '" + predicate.toSql() + "' cannot be normalized: "
not sure we need this logging


Line 149:     if (!(predicate.getChild(0) instanceof SlotRef) ||
remove first condition since it's a precondition of reaching this part


http://gerrit.cloudera.org:8080/#/c/3986/2/fe/src/main/java/com/cloudera/impala/analysis/Expr.java
File fe/src/main/java/com/cloudera/impala/analysis/Expr.java:

Line 1201
Leave TODO. It's still not a generic constant folding function.


http://gerrit.cloudera.org:8080/#/c/3986/2/fe/src/main/java/com/cloudera/impala/analysis/LiteralExpr.java
File fe/src/main/java/com/cloudera/impala/analysis/LiteralExpr.java:

Line 54:   public static boolean isSupportedType(Type type) {
This seems more complicated than changing LiteralExpr.create() to return null because now we have to keep this new function in sync with LiteralExpr.create() (of which there are several variants).


http://gerrit.cloudera.org:8080/#/c/3986/2/testdata/workloads/functional-query/queries/QueryTest/kudu-expr.test
File testdata/workloads/functional-query/queries/QueryTest/kudu-expr.test:

Line 3: # IMPALA-3856: KuduScanNode crash when pushing predicates including a cast
I think these should really be planner tests. We should assert that these predicates are not part of the 'kudu predicates'.


-- 
To view, visit http://gerrit.cloudera.org:8080/3986
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Iae7612433a2e27f8887abe6624f9ee0f4867b934
Gerrit-PatchSet: 2
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Matthew Jacobs <mj...@cloudera.com>
Gerrit-Reviewer: Alex Behm <al...@cloudera.com>
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-3856,IMPALA-3871: Fix BinaryPredicate normalization for Kudu

Posted by "Matthew Jacobs (Code Review)" <ge...@cloudera.org>.
Matthew Jacobs has posted comments on this change.

Change subject: IMPALA-3856,IMPALA-3871: Fix BinaryPredicate normalization for Kudu
......................................................................


Patch Set 2:

(8 comments)

http://gerrit.cloudera.org:8080/#/c/3986/1/fe/src/main/java/com/cloudera/impala/analysis/BinaryPredicate.java
File fe/src/main/java/com/cloudera/impala/analysis/BinaryPredicate.java:

Line 126:     if (predicate.getChild(0) instanceof SlotRef) {
> I think we should make this procedure more specific. getBoundSlot() interna
Done


http://gerrit.cloudera.org:8080/#/c/3986/2/fe/src/main/java/com/cloudera/impala/analysis/BinaryPredicate.java
File fe/src/main/java/com/cloudera/impala/analysis/BinaryPredicate.java:

Line 117:    * Normalizes a 'predicate' consisting of one SlotRef and an expr that is constant into
> ... consisting of an uncast SlotRef and a constant Expr...
Done


Line 123:       throws AnalysisException {
> does not throw anymore, right?
Done


Line 144:       LOG.debug("BinaryPredicate '" + predicate.toSql() + "' cannot be normalized: "
> not sure we need this logging
Done


Line 149:     if (!(predicate.getChild(0) instanceof SlotRef) ||
> remove first condition since it's a precondition of reaching this part
Done


http://gerrit.cloudera.org:8080/#/c/3986/2/fe/src/main/java/com/cloudera/impala/analysis/Expr.java
File fe/src/main/java/com/cloudera/impala/analysis/Expr.java:

Line 1201
> Leave TODO. It's still not a generic constant folding function.
Done


http://gerrit.cloudera.org:8080/#/c/3986/2/fe/src/main/java/com/cloudera/impala/analysis/LiteralExpr.java
File fe/src/main/java/com/cloudera/impala/analysis/LiteralExpr.java:

Line 54:   public static boolean isSupportedType(Type type) {
> This seems more complicated than changing LiteralExpr.create() to return nu
Done


http://gerrit.cloudera.org:8080/#/c/3986/2/testdata/workloads/functional-query/queries/QueryTest/kudu-expr.test
File testdata/workloads/functional-query/queries/QueryTest/kudu-expr.test:

Line 3: # IMPALA-3856: KuduScanNode crash when pushing predicates including a cast
> I think these should really be planner tests. We should assert that these p
Done


-- 
To view, visit http://gerrit.cloudera.org:8080/3986
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Iae7612433a2e27f8887abe6624f9ee0f4867b934
Gerrit-PatchSet: 2
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Matthew Jacobs <mj...@cloudera.com>
Gerrit-Reviewer: Alex Behm <al...@cloudera.com>
Gerrit-Reviewer: Matthew Jacobs <mj...@cloudera.com>
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-3856,IMPALA-3871: Fix BinaryPredicate normalization for Kudu

Posted by "Alex Behm (Code Review)" <ge...@cloudera.org>.
Alex Behm has posted comments on this change.

Change subject: IMPALA-3856,IMPALA-3871: Fix BinaryPredicate normalization for Kudu
......................................................................


Patch Set 3: Code-Review+2

(3 comments)

http://gerrit.cloudera.org:8080/#/c/3986/3/testdata/workloads/functional-planner/queries/PlannerTest/kudu.test
File testdata/workloads/functional-planner/queries/PlannerTest/kudu.test:

Line 158: ---- DISTRIBUTEDPLAN
remove, PLAN is enough


Line 179: ---- DISTRIBUTEDPLAN
remove, PLAN is enough


http://gerrit.cloudera.org:8080/#/c/3986/3/tests/query_test/test_kudu.py
File tests/query_test/test_kudu.py:

Line 100:   def test_kudu_expr(self, vector):
might be safer to mark as serial as well because once we add another one of these non-serial tests, we'll have a setup/teardown race

alternatively, I'd also be ok with removing this EE test altogether because the planner test should be sufficient


-- 
To view, visit http://gerrit.cloudera.org:8080/3986
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Iae7612433a2e27f8887abe6624f9ee0f4867b934
Gerrit-PatchSet: 3
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Matthew Jacobs <mj...@cloudera.com>
Gerrit-Reviewer: Alex Behm <al...@cloudera.com>
Gerrit-Reviewer: Matthew Jacobs <mj...@cloudera.com>
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-3856,IMPALA-3871: Fix BinaryPredicate normalization for Kudu

Posted by "Internal Jenkins (Code Review)" <ge...@cloudera.org>.
Internal Jenkins has submitted this change and it was merged.

Change subject: IMPALA-3856,IMPALA-3871: Fix BinaryPredicate normalization for Kudu
......................................................................


IMPALA-3856,IMPALA-3871: Fix BinaryPredicate normalization for Kudu

Change-Id: Iae7612433a2e27f8887abe6624f9ee0f4867b934
Reviewed-on: http://gerrit.cloudera.org:8080/3986
Reviewed-by: Matthew Jacobs <mj...@cloudera.com>
Tested-by: Internal Jenkins
---
M fe/src/main/java/com/cloudera/impala/analysis/BinaryPredicate.java
M fe/src/main/java/com/cloudera/impala/analysis/Expr.java
M fe/src/main/java/com/cloudera/impala/analysis/LiteralExpr.java
M testdata/workloads/functional-planner/queries/PlannerTest/kudu.test
4 files changed, 54 insertions(+), 23 deletions(-)

Approvals:
  Matthew Jacobs: Looks good to me, approved
  Internal Jenkins: Verified



-- 
To view, visit http://gerrit.cloudera.org:8080/3986
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Iae7612433a2e27f8887abe6624f9ee0f4867b934
Gerrit-PatchSet: 5
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Matthew Jacobs <mj...@cloudera.com>
Gerrit-Reviewer: Alex Behm <al...@cloudera.com>
Gerrit-Reviewer: Internal Jenkins
Gerrit-Reviewer: Matthew Jacobs <mj...@cloudera.com>

[Impala-ASF-CR] IMPALA-3856,IMPALA-3871: Fix BinaryPredicate normalization for Kudu

Posted by "Matthew Jacobs (Code Review)" <ge...@cloudera.org>.
Matthew Jacobs has uploaded a new patch set (#2).

Change subject: IMPALA-3856,IMPALA-3871: Fix BinaryPredicate normalization for Kudu
......................................................................

IMPALA-3856,IMPALA-3871: Fix BinaryPredicate normalization for Kudu

Change-Id: Iae7612433a2e27f8887abe6624f9ee0f4867b934
---
M fe/src/main/java/com/cloudera/impala/analysis/BinaryPredicate.java
M fe/src/main/java/com/cloudera/impala/analysis/Expr.java
M fe/src/main/java/com/cloudera/impala/analysis/LiteralExpr.java
A testdata/workloads/functional-query/queries/QueryTest/kudu-expr.test
M tests/query_test/test_kudu.py
5 files changed, 84 insertions(+), 16 deletions(-)


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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Iae7612433a2e27f8887abe6624f9ee0f4867b934
Gerrit-PatchSet: 2
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Matthew Jacobs <mj...@cloudera.com>
Gerrit-Reviewer: Alex Behm <al...@cloudera.com>

[Impala-ASF-CR] IMPALA-3856,IMPALA-3871: Fix BinaryPredicate normalization for Kudu

Posted by "Matthew Jacobs (Code Review)" <ge...@cloudera.org>.
Matthew Jacobs has uploaded a new patch set (#3).

Change subject: IMPALA-3856,IMPALA-3871: Fix BinaryPredicate normalization for Kudu
......................................................................

IMPALA-3856,IMPALA-3871: Fix BinaryPredicate normalization for Kudu

Change-Id: Iae7612433a2e27f8887abe6624f9ee0f4867b934
---
M fe/src/main/java/com/cloudera/impala/analysis/BinaryPredicate.java
M fe/src/main/java/com/cloudera/impala/analysis/Expr.java
M fe/src/main/java/com/cloudera/impala/analysis/LiteralExpr.java
M testdata/workloads/functional-planner/queries/PlannerTest/kudu.test
A testdata/workloads/functional-query/queries/QueryTest/kudu-expr.test
M tests/query_test/test_kudu.py
6 files changed, 102 insertions(+), 23 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/86/3986/3
-- 
To view, visit http://gerrit.cloudera.org:8080/3986
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Iae7612433a2e27f8887abe6624f9ee0f4867b934
Gerrit-PatchSet: 3
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Matthew Jacobs <mj...@cloudera.com>
Gerrit-Reviewer: Alex Behm <al...@cloudera.com>

[Impala-ASF-CR] IMPALA-3856,IMPALA-3871: Fix BinaryPredicate normalization for Kudu

Posted by "Matthew Jacobs (Code Review)" <ge...@cloudera.org>.
Hello Alex Behm,

I'd like you to reexamine a change.  Please visit

    http://gerrit.cloudera.org:8080/3986

to look at the new patch set (#4).

Change subject: IMPALA-3856,IMPALA-3871: Fix BinaryPredicate normalization for Kudu
......................................................................

IMPALA-3856,IMPALA-3871: Fix BinaryPredicate normalization for Kudu

Change-Id: Iae7612433a2e27f8887abe6624f9ee0f4867b934
---
M fe/src/main/java/com/cloudera/impala/analysis/BinaryPredicate.java
M fe/src/main/java/com/cloudera/impala/analysis/Expr.java
M fe/src/main/java/com/cloudera/impala/analysis/LiteralExpr.java
M testdata/workloads/functional-planner/queries/PlannerTest/kudu.test
4 files changed, 54 insertions(+), 23 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/86/3986/4
-- 
To view, visit http://gerrit.cloudera.org:8080/3986
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Iae7612433a2e27f8887abe6624f9ee0f4867b934
Gerrit-PatchSet: 4
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Matthew Jacobs <mj...@cloudera.com>
Gerrit-Reviewer: Alex Behm <al...@cloudera.com>
Gerrit-Reviewer: Matthew Jacobs <mj...@cloudera.com>

[Impala-ASF-CR] IMPALA-3856,IMPALA-3871: Fix BinaryPredicate normalization for Kudu

Posted by "Matthew Jacobs (Code Review)" <ge...@cloudera.org>.
Matthew Jacobs has posted comments on this change.

Change subject: IMPALA-3856,IMPALA-3871: Fix BinaryPredicate normalization for Kudu
......................................................................


Patch Set 5:

Marcel, I made some of the follow-up changes for comments that you posted  after this went in. Those follow-up changes are minor and I just included them in this review which touches similar code anyway:
https://gerrit.cloudera.org/#/c/4120/

-- 
To view, visit http://gerrit.cloudera.org:8080/3986
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Iae7612433a2e27f8887abe6624f9ee0f4867b934
Gerrit-PatchSet: 5
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Matthew Jacobs <mj...@cloudera.com>
Gerrit-Reviewer: Alex Behm <al...@cloudera.com>
Gerrit-Reviewer: Internal Jenkins
Gerrit-Reviewer: Marcel Kornacker <ma...@cloudera.com>
Gerrit-Reviewer: Matthew Jacobs <mj...@cloudera.com>
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-3856,IMPALA-3871: Fix BinaryPredicate normalization for Kudu

Posted by "Marcel Kornacker (Code Review)" <ge...@cloudera.org>.
Marcel Kornacker has posted comments on this change.

Change subject: IMPALA-3856,IMPALA-3871: Fix BinaryPredicate normalization for Kudu
......................................................................


Patch Set 5:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/3986/5/fe/src/main/java/com/cloudera/impala/analysis/BinaryPredicate.java
File fe/src/main/java/com/cloudera/impala/analysis/BinaryPredicate.java:

Line 118:    * Normalizes a 'predicate' consisting of an uncast SlotRef and a constant Expr into
> For Kudu predicates, at least, we can't have the slotref wrapped by a cast.
maybe we should change the name, to warn potential future callers. the initial thinking behind putting this logic here was that it seems relatively general, so would be useful outside of kudu. i'm not sure that's still the case.


-- 
To view, visit http://gerrit.cloudera.org:8080/3986
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Iae7612433a2e27f8887abe6624f9ee0f4867b934
Gerrit-PatchSet: 5
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Matthew Jacobs <mj...@cloudera.com>
Gerrit-Reviewer: Alex Behm <al...@cloudera.com>
Gerrit-Reviewer: Internal Jenkins
Gerrit-Reviewer: Marcel Kornacker <ma...@cloudera.com>
Gerrit-Reviewer: Matthew Jacobs <mj...@cloudera.com>
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-3856,IMPALA-3871: Fix BinaryPredicate normalization for Kudu

Posted by "Matthew Jacobs (Code Review)" <ge...@cloudera.org>.
Matthew Jacobs has posted comments on this change.

Change subject: IMPALA-3856,IMPALA-3871: Fix BinaryPredicate normalization for Kudu
......................................................................


Patch Set 3:

(3 comments)

http://gerrit.cloudera.org:8080/#/c/3986/3/testdata/workloads/functional-planner/queries/PlannerTest/kudu.test
File testdata/workloads/functional-planner/queries/PlannerTest/kudu.test:

Line 158: ---- DISTRIBUTEDPLAN
> remove, PLAN is enough
Done


Line 179: ---- DISTRIBUTEDPLAN
> remove, PLAN is enough
Done


http://gerrit.cloudera.org:8080/#/c/3986/3/tests/query_test/test_kudu.py
File tests/query_test/test_kudu.py:

Line 100:   def test_kudu_expr(self, vector):
> might be safer to mark as serial as well because once we add another one of
gah the removal didn't make it's way in, thanks


-- 
To view, visit http://gerrit.cloudera.org:8080/3986
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Iae7612433a2e27f8887abe6624f9ee0f4867b934
Gerrit-PatchSet: 3
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Matthew Jacobs <mj...@cloudera.com>
Gerrit-Reviewer: Alex Behm <al...@cloudera.com>
Gerrit-Reviewer: Matthew Jacobs <mj...@cloudera.com>
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-3856,IMPALA-3871: Fix BinaryPredicate normalization for Kudu

Posted by "Matthew Jacobs (Code Review)" <ge...@cloudera.org>.
Matthew Jacobs has posted comments on this change.

Change subject: IMPALA-3856,IMPALA-3871: Fix BinaryPredicate normalization for Kudu
......................................................................


Patch Set 4: Code-Review+2

carrying Alex's +2

-- 
To view, visit http://gerrit.cloudera.org:8080/3986
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Iae7612433a2e27f8887abe6624f9ee0f4867b934
Gerrit-PatchSet: 4
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Matthew Jacobs <mj...@cloudera.com>
Gerrit-Reviewer: Alex Behm <al...@cloudera.com>
Gerrit-Reviewer: Matthew Jacobs <mj...@cloudera.com>
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-3856,IMPALA-3871: Fix BinaryPredicate normalization for Kudu

Posted by "Internal Jenkins (Code Review)" <ge...@cloudera.org>.
Internal Jenkins has posted comments on this change.

Change subject: IMPALA-3856,IMPALA-3871: Fix BinaryPredicate normalization for Kudu
......................................................................


Patch Set 4: Verified+1

-- 
To view, visit http://gerrit.cloudera.org:8080/3986
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Iae7612433a2e27f8887abe6624f9ee0f4867b934
Gerrit-PatchSet: 4
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Matthew Jacobs <mj...@cloudera.com>
Gerrit-Reviewer: Alex Behm <al...@cloudera.com>
Gerrit-Reviewer: Internal Jenkins
Gerrit-Reviewer: Matthew Jacobs <mj...@cloudera.com>
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-3856,IMPALA-3871: Fix BinaryPredicate normalization for Kudu

Posted by "Matthew Jacobs (Code Review)" <ge...@cloudera.org>.
Matthew Jacobs has posted comments on this change.

Change subject: IMPALA-3856,IMPALA-3871: Fix BinaryPredicate normalization for Kudu
......................................................................


Patch Set 5:

(4 comments)

http://gerrit.cloudera.org:8080/#/c/3986/5/fe/src/main/java/com/cloudera/impala/analysis/BinaryPredicate.java
File fe/src/main/java/com/cloudera/impala/analysis/BinaryPredicate.java:

Line 118:    * Normalizes a 'predicate' consisting of an uncast SlotRef and a constant Expr into
> what was wrong with the previous version of this function?
For Kudu predicates, at least, we can't have the slotref wrapped by a cast. So this fn now returns the very specific kind of predicate described here if possible.
This shouldn't break anything else because its only caller is the KuduScanNode. Would you prefer if I change the name of the fn to normalizeNoCastSlotRefComparison() (or similar)?


http://gerrit.cloudera.org:8080/#/c/3986/5/fe/src/main/java/com/cloudera/impala/analysis/Expr.java
File fe/src/main/java/com/cloudera/impala/analysis/Expr.java:

Line 1193:    * For children of 'this' that are constant expressions capable of being expressed
> which constants cannot be expressed as literals?
DATE/DATETIME/TIMESTAMP don't have LiteralExpr subclasses. I'll change.


http://gerrit.cloudera.org:8080/#/c/3986/5/fe/src/main/java/com/cloudera/impala/analysis/LiteralExpr.java
File fe/src/main/java/com/cloudera/impala/analysis/LiteralExpr.java:

Line 55:   public static LiteralExpr create(String value, Type type) throws AnalysisException {
> remove throw
analyze(), uncheckedCastTo(), and BoolLiteral()/NumericLiteral() all throw AnalysisEx.


Line 154:    * Returns null for types that cannot be expressed as literals, e.g. TIMESTAMP.
> you mean for which don't have a LiteralExpr subclass? 'cannot be expressed'
Yes, I'll change the comment


-- 
To view, visit http://gerrit.cloudera.org:8080/3986
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Iae7612433a2e27f8887abe6624f9ee0f4867b934
Gerrit-PatchSet: 5
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Matthew Jacobs <mj...@cloudera.com>
Gerrit-Reviewer: Alex Behm <al...@cloudera.com>
Gerrit-Reviewer: Internal Jenkins
Gerrit-Reviewer: Marcel Kornacker <ma...@cloudera.com>
Gerrit-Reviewer: Matthew Jacobs <mj...@cloudera.com>
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-3856,IMPALA-3871: Fix BinaryPredicate normalization for Kudu

Posted by "Marcel Kornacker (Code Review)" <ge...@cloudera.org>.
Marcel Kornacker has posted comments on this change.

Change subject: IMPALA-3856,IMPALA-3871: Fix BinaryPredicate normalization for Kudu
......................................................................


Patch Set 5:

(4 comments)

http://gerrit.cloudera.org:8080/#/c/3986/5/fe/src/main/java/com/cloudera/impala/analysis/BinaryPredicate.java
File fe/src/main/java/com/cloudera/impala/analysis/BinaryPredicate.java:

Line 118:    * Normalizes a 'predicate' consisting of an uncast SlotRef and a constant Expr into
what was wrong with the previous version of this function?

given just the description in the function comment, it's not clear why this is disabled by casting. you should leave a comment in here, so the next person doesn't try to add the casting logic again.

also, doesn't this break other things? i remember we specifically added the casting logic to address a problem.


http://gerrit.cloudera.org:8080/#/c/3986/5/fe/src/main/java/com/cloudera/impala/analysis/Expr.java
File fe/src/main/java/com/cloudera/impala/analysis/Expr.java:

Line 1193:    * For children of 'this' that are constant expressions capable of being expressed
which constants cannot be expressed as literals?


http://gerrit.cloudera.org:8080/#/c/3986/5/fe/src/main/java/com/cloudera/impala/analysis/LiteralExpr.java
File fe/src/main/java/com/cloudera/impala/analysis/LiteralExpr.java:

Line 55:   public static LiteralExpr create(String value, Type type) throws AnalysisException {
remove throw


Line 154:    * Returns null for types that cannot be expressed as literals, e.g. TIMESTAMP.
you mean for which don't have a LiteralExpr subclass? 'cannot be expressed' sounds like a sql limitation.


-- 
To view, visit http://gerrit.cloudera.org:8080/3986
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Iae7612433a2e27f8887abe6624f9ee0f4867b934
Gerrit-PatchSet: 5
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Matthew Jacobs <mj...@cloudera.com>
Gerrit-Reviewer: Alex Behm <al...@cloudera.com>
Gerrit-Reviewer: Internal Jenkins
Gerrit-Reviewer: Marcel Kornacker <ma...@cloudera.com>
Gerrit-Reviewer: Matthew Jacobs <mj...@cloudera.com>
Gerrit-HasComments: Yes