You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@impala.apache.org by "Tim Armstrong (Code Review)" <ge...@cloudera.org> on 2019/08/09 02:48:07 UTC

[Impala-ASF-CR] IMPALA-8848: fix UNION missing input cardinality bug

Tim Armstrong has uploaded this change for review. ( http://gerrit.cloudera.org:8080/14036


Change subject: IMPALA-8848: fix UNION missing input cardinality bug
......................................................................

IMPALA-8848: fix UNION missing input cardinality bug

If a UNION has input of unknown size, we should
mark the output cardinality as unknown.

The previous behaviour was to report a cardinality of
0, which is unsafe because the planner may make further
decisions under the incorrect assumption that the output
of the UNION is tiny.

Testing:
An existing CardinalityTest already tested this but had
the wrong estimate.

Change-Id: Ic3ed670ffb685d8ff24824933ca303f3219737bb
---
M fe/src/main/java/org/apache/impala/planner/UnionNode.java
M fe/src/test/java/org/apache/impala/planner/CardinalityTest.java
2 files changed, 13 insertions(+), 4 deletions(-)



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic3ed670ffb685d8ff24824933ca303f3219737bb
Gerrit-Change-Number: 14036
Gerrit-PatchSet: 1
Gerrit-Owner: Tim Armstrong <ta...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>

[Impala-ASF-CR] IMPALA-8848: fix UNION missing input cardinality bug

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/14036 )

Change subject: IMPALA-8848: fix UNION missing input cardinality bug
......................................................................


Patch Set 4: Verified+1


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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic3ed670ffb685d8ff24824933ca303f3219737bb
Gerrit-Change-Number: 14036
Gerrit-PatchSet: 4
Gerrit-Owner: Tim Armstrong <ta...@cloudera.com>
Gerrit-Reviewer: Bharath Vissapragada <bh...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-Comment-Date: Sat, 10 Aug 2019 23:01:44 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-8848: fix UNION missing input cardinality bug

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/14036 )

Change subject: IMPALA-8848: fix UNION missing input cardinality bug
......................................................................


Patch Set 2:

Build Successful 

https://jenkins.impala.io/job/gerrit-code-review-checks/4199/ : Initial code review checks passed. Use gerrit-verify-dryrun-external or gerrit-verify-dryrun to run full precommit tests.


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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic3ed670ffb685d8ff24824933ca303f3219737bb
Gerrit-Change-Number: 14036
Gerrit-PatchSet: 2
Gerrit-Owner: Tim Armstrong <ta...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Comment-Date: Fri, 09 Aug 2019 03:28:02 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-8848: fix UNION missing input cardinality bug

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/14036 )

Change subject: IMPALA-8848: fix UNION missing input cardinality bug
......................................................................


Patch Set 4: Code-Review+2


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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic3ed670ffb685d8ff24824933ca303f3219737bb
Gerrit-Change-Number: 14036
Gerrit-PatchSet: 4
Gerrit-Owner: Tim Armstrong <ta...@cloudera.com>
Gerrit-Reviewer: Bharath Vissapragada <bh...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-Comment-Date: Sat, 10 Aug 2019 18:50:31 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-8848: fix UNION missing input cardinality bug

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/14036 )

Change subject: IMPALA-8848: fix UNION missing input cardinality bug
......................................................................


Patch Set 4:

Build started: https://jenkins.impala.io/job/gerrit-verify-dryrun/4768/ DRY_RUN=false


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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic3ed670ffb685d8ff24824933ca303f3219737bb
Gerrit-Change-Number: 14036
Gerrit-PatchSet: 4
Gerrit-Owner: Tim Armstrong <ta...@cloudera.com>
Gerrit-Reviewer: Bharath Vissapragada <bh...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-Comment-Date: Sat, 10 Aug 2019 18:50:32 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-8848: fix UNION missing input cardinality bug

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/14036 )

Change subject: IMPALA-8848: fix UNION missing input cardinality bug
......................................................................

IMPALA-8848: fix UNION missing input cardinality bug

If a UNION has children, and none of those children has
a known cardinality, then we can make no reasonable
estimate of the output cardinality, so the planner
should consider the output cardinality to be unknown.

The previous behaviour was to report a cardinality of
0, which is unsafe because the planner may make further
decisions under the incorrect assumption that the output
of the UNION is tiny.

Testing:
An existing CardinalityTest already tested this but had
the wrong estimate.

Change-Id: Ic3ed670ffb685d8ff24824933ca303f3219737bb
Reviewed-on: http://gerrit.cloudera.org:8080/14036
Reviewed-by: Impala Public Jenkins <im...@cloudera.com>
Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
M fe/src/main/java/org/apache/impala/planner/UnionNode.java
M fe/src/test/java/org/apache/impala/planner/CardinalityTest.java
2 files changed, 27 insertions(+), 4 deletions(-)

Approvals:
  Impala Public Jenkins: Looks good to me, approved; Verified

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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ic3ed670ffb685d8ff24824933ca303f3219737bb
Gerrit-Change-Number: 14036
Gerrit-PatchSet: 5
Gerrit-Owner: Tim Armstrong <ta...@cloudera.com>
Gerrit-Reviewer: Bharath Vissapragada <bh...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>

[Impala-ASF-CR] IMPALA-8848: fix UNION missing input cardinality bug

Posted by "Tim Armstrong (Code Review)" <ge...@cloudera.org>.
Tim Armstrong has posted comments on this change. ( http://gerrit.cloudera.org:8080/14036 )

Change subject: IMPALA-8848: fix UNION missing input cardinality bug
......................................................................


Patch Set 2:

(4 comments)

http://gerrit.cloudera.org:8080/#/c/14036/2//COMMIT_MSG
Commit Message:

http://gerrit.cloudera.org:8080/#/c/14036/2//COMMIT_MSG@9
PS2, Line 9: If a UNION has input of unknown size, we should
> nit: I got confused by this statement for a minute. Rephrase may be? (to cl
Done


http://gerrit.cloudera.org:8080/#/c/14036/2/fe/src/main/java/org/apache/impala/planner/UnionNode.java
File fe/src/main/java/org/apache/impala/planner/UnionNode.java:

http://gerrit.cloudera.org:8080/#/c/14036/2/fe/src/main/java/org/apache/impala/planner/UnionNode.java@124
PS2, Line 124:  
> nit:..atleast..?
Done


http://gerrit.cloudera.org:8080/#/c/14036/2/fe/src/main/java/org/apache/impala/planner/UnionNode.java@127
PS2, Line 127:       cardinality_ = checkedAdd(totalChildCardinality, constExprLists_.size());
> nit:Preconditions.check(constExprLists_.size() > 0)?
constExprLists could be empty, this calculation is correct when constExprLists.size() == 0, unless I missed something.


http://gerrit.cloudera.org:8080/#/c/14036/2/fe/src/test/java/org/apache/impala/planner/CardinalityTest.java
File fe/src/test/java/org/apache/impala/planner/CardinalityTest.java:

http://gerrit.cloudera.org:8080/#/c/14036/2/fe/src/test/java/org/apache/impala/planner/CardinalityTest.java@724
PS2, Line 724:         path, UnionNode.class);
> Should we also add a test to cover something like
Done - good idea



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic3ed670ffb685d8ff24824933ca303f3219737bb
Gerrit-Change-Number: 14036
Gerrit-PatchSet: 2
Gerrit-Owner: Tim Armstrong <ta...@cloudera.com>
Gerrit-Reviewer: Bharath Vissapragada <bh...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-Comment-Date: Fri, 09 Aug 2019 23:54:56 +0000
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-8848: fix UNION missing input cardinality bug

Posted by "Tim Armstrong (Code Review)" <ge...@cloudera.org>.
Tim Armstrong has uploaded a new patch set (#2). ( http://gerrit.cloudera.org:8080/14036 )

Change subject: IMPALA-8848: fix UNION missing input cardinality bug
......................................................................

IMPALA-8848: fix UNION missing input cardinality bug

If a UNION has input of unknown size, we should
mark the output cardinality as unknown.

The previous behaviour was to report a cardinality of
0, which is unsafe because the planner may make further
decisions under the incorrect assumption that the output
of the UNION is tiny.

Testing:
An existing CardinalityTest already tested this but had
the wrong estimate.

Change-Id: Ic3ed670ffb685d8ff24824933ca303f3219737bb
---
M fe/src/main/java/org/apache/impala/planner/UnionNode.java
M fe/src/test/java/org/apache/impala/planner/CardinalityTest.java
2 files changed, 20 insertions(+), 4 deletions(-)


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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ic3ed670ffb685d8ff24824933ca303f3219737bb
Gerrit-Change-Number: 14036
Gerrit-PatchSet: 2
Gerrit-Owner: Tim Armstrong <ta...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>

[Impala-ASF-CR] IMPALA-8848: fix UNION missing input cardinality bug

Posted by "Tim Armstrong (Code Review)" <ge...@cloudera.org>.
Hello Bharath Vissapragada, Impala Public Jenkins, 

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

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

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

Change subject: IMPALA-8848: fix UNION missing input cardinality bug
......................................................................

IMPALA-8848: fix UNION missing input cardinality bug

If a UNION has children, and none of those children has
a known cardinality, then we can make no reasonable
estimate of the output cardinality, so the planner
should consider the output cardinality to be unknown.

The previous behaviour was to report a cardinality of
0, which is unsafe because the planner may make further
decisions under the incorrect assumption that the output
of the UNION is tiny.

Testing:
An existing CardinalityTest already tested this but had
the wrong estimate.

Change-Id: Ic3ed670ffb685d8ff24824933ca303f3219737bb
---
M fe/src/main/java/org/apache/impala/planner/UnionNode.java
M fe/src/test/java/org/apache/impala/planner/CardinalityTest.java
2 files changed, 27 insertions(+), 4 deletions(-)


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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ic3ed670ffb685d8ff24824933ca303f3219737bb
Gerrit-Change-Number: 14036
Gerrit-PatchSet: 3
Gerrit-Owner: Tim Armstrong <ta...@cloudera.com>
Gerrit-Reviewer: Bharath Vissapragada <bh...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>

[Impala-ASF-CR] IMPALA-8848: fix UNION missing input cardinality bug

Posted by "Bharath Vissapragada (Code Review)" <ge...@cloudera.org>.
Bharath Vissapragada has posted comments on this change. ( http://gerrit.cloudera.org:8080/14036 )

Change subject: IMPALA-8848: fix UNION missing input cardinality bug
......................................................................


Patch Set 2:

(4 comments)

lgtm, just a bunch of clarifying questions and nits.

http://gerrit.cloudera.org:8080/#/c/14036/2//COMMIT_MSG
Commit Message:

http://gerrit.cloudera.org:8080/#/c/14036/2//COMMIT_MSG@9
PS2, Line 9: If a UNION has input of unknown size, we should
nit: I got confused by this statement for a minute. Rephrase may be? (to clarify that atleast one child with a valid cardinality is needed)


http://gerrit.cloudera.org:8080/#/c/14036/2/fe/src/main/java/org/apache/impala/planner/UnionNode.java
File fe/src/main/java/org/apache/impala/planner/UnionNode.java:

http://gerrit.cloudera.org:8080/#/c/14036/2/fe/src/main/java/org/apache/impala/planner/UnionNode.java@124
PS2, Line 124:  
nit:..atleast..?


http://gerrit.cloudera.org:8080/#/c/14036/2/fe/src/main/java/org/apache/impala/planner/UnionNode.java@127
PS2, Line 127:       cardinality_ = checkedAdd(totalChildCardinality, constExprLists_.size());
nit:Preconditions.check(constExprLists_.size() > 0)?


http://gerrit.cloudera.org:8080/#/c/14036/2/fe/src/test/java/org/apache/impala/planner/CardinalityTest.java
File fe/src/test/java/org/apache/impala/planner/CardinalityTest.java:

http://gerrit.cloudera.org:8080/#/c/14036/2/fe/src/test/java/org/apache/impala/planner/CardinalityTest.java@724
PS2, Line 724:         path, UnionNode.class);
Should we also add a test to cover something like

select * from tbl_has_valid_cards union select * from tbl_without_valid_cards ?



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic3ed670ffb685d8ff24824933ca303f3219737bb
Gerrit-Change-Number: 14036
Gerrit-PatchSet: 2
Gerrit-Owner: Tim Armstrong <ta...@cloudera.com>
Gerrit-Reviewer: Bharath Vissapragada <bh...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Comment-Date: Fri, 09 Aug 2019 16:25:06 +0000
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-8848: fix UNION missing input cardinality bug

Posted by "Bharath Vissapragada (Code Review)" <ge...@cloudera.org>.
Bharath Vissapragada has posted comments on this change. ( http://gerrit.cloudera.org:8080/14036 )

Change subject: IMPALA-8848: fix UNION missing input cardinality bug
......................................................................


Patch Set 3: Code-Review+2

(1 comment)

http://gerrit.cloudera.org:8080/#/c/14036/2/fe/src/main/java/org/apache/impala/planner/UnionNode.java
File fe/src/main/java/org/apache/impala/planner/UnionNode.java:

http://gerrit.cloudera.org:8080/#/c/14036/2/fe/src/main/java/org/apache/impala/planner/UnionNode.java@127
PS2, Line 127:       cardinality_ = checkedAdd(totalChildCardinality, constExprLists_.size());
> constExprLists could be empty, this calculation is correct when constExprLi
nvm, not sure what I was thinking.



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic3ed670ffb685d8ff24824933ca303f3219737bb
Gerrit-Change-Number: 14036
Gerrit-PatchSet: 3
Gerrit-Owner: Tim Armstrong <ta...@cloudera.com>
Gerrit-Reviewer: Bharath Vissapragada <bh...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-Comment-Date: Sat, 10 Aug 2019 18:28:50 +0000
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-8848: fix UNION missing input cardinality bug

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/14036 )

Change subject: IMPALA-8848: fix UNION missing input cardinality bug
......................................................................


Patch Set 3:

Build Successful 

https://jenkins.impala.io/job/gerrit-code-review-checks/4212/ : Initial code review checks passed. Use gerrit-verify-dryrun-external or gerrit-verify-dryrun to run full precommit tests.


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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic3ed670ffb685d8ff24824933ca303f3219737bb
Gerrit-Change-Number: 14036
Gerrit-PatchSet: 3
Gerrit-Owner: Tim Armstrong <ta...@cloudera.com>
Gerrit-Reviewer: Bharath Vissapragada <bh...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-Comment-Date: Sat, 10 Aug 2019 00:34:42 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-8848: fix UNION missing input cardinality bug

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/14036 )

Change subject: IMPALA-8848: fix UNION missing input cardinality bug
......................................................................


Patch Set 1:

Build Successful 

https://jenkins.impala.io/job/gerrit-code-review-checks/4198/ : Initial code review checks passed. Use gerrit-verify-dryrun-external or gerrit-verify-dryrun to run full precommit tests.


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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic3ed670ffb685d8ff24824933ca303f3219737bb
Gerrit-Change-Number: 14036
Gerrit-PatchSet: 1
Gerrit-Owner: Tim Armstrong <ta...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Comment-Date: Fri, 09 Aug 2019 03:28:09 +0000
Gerrit-HasComments: No