You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@impala.apache.org by "anujphadke (Code Review)" <ge...@cloudera.org> on 2018/07/23 21:44:18 UTC

[Impala-ASF-CR] IMPALA-7242/IMPALA-7243: check for overflow when converting IntVal to DecimalValue

anujphadke has uploaded this change for review. ( http://gerrit.cloudera.org:8080/11020


Change subject: IMPALA-7242/IMPALA-7243: check for overflow when converting IntVal to DecimalValue
......................................................................

IMPALA-7242/IMPALA-7243: check for overflow when converting IntVal to DecimalValue

This change adds a check for an overflow which can happen during
converting num_buckets from IntVal to a DecimalValue during width_bucket
evaluation. An overflow can result in hitting a DCHECK if it needs int256
for intermediate evaluations or returns a wrong result otherwise.

Change-Id: Ie5808802096bb0e6cfd4ab6464538474e42cab60
---
M be/src/exprs/expr-test.cc
M be/src/exprs/math-functions-ir.cc
2 files changed, 18 insertions(+), 1 deletion(-)



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie5808802096bb0e6cfd4ab6464538474e42cab60
Gerrit-Change-Number: 11020
Gerrit-PatchSet: 1
Gerrit-Owner: anujphadke <ap...@cloudera.com>

[Impala-ASF-CR] IMPALA-7242/IMPALA-7243: check for overflow when converting IntVal to DecimalValue

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

Change subject: IMPALA-7242/IMPALA-7243: check for overflow when converting IntVal to DecimalValue
......................................................................


Patch Set 1:

Build Started https://jenkins.impala.io/job/gerrit-code-review-checks/14/ 

Running initial code review checks.


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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie5808802096bb0e6cfd4ab6464538474e42cab60
Gerrit-Change-Number: 11020
Gerrit-PatchSet: 1
Gerrit-Owner: anujphadke <ap...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Comment-Date: Mon, 23 Jul 2018 21:44:29 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-7242/IMPALA-7243: check for overflow when converting IntVal to DecimalValue

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

Change subject: IMPALA-7242/IMPALA-7243: check for overflow when converting IntVal to DecimalValue
......................................................................


Patch Set 2: Verified+1


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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie5808802096bb0e6cfd4ab6464538474e42cab60
Gerrit-Change-Number: 11020
Gerrit-PatchSet: 2
Gerrit-Owner: anujphadke <ap...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-Reviewer: anujphadke <ap...@cloudera.com>
Gerrit-Comment-Date: Tue, 07 Aug 2018 00:36:14 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-7242/IMPALA-7243: check for overflow when converting IntVal to DecimalValue

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

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

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

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

Change subject: IMPALA-7242/IMPALA-7243: check for overflow when converting IntVal to DecimalValue
......................................................................

IMPALA-7242/IMPALA-7243: check for overflow when converting IntVal to DecimalValue

This change adds a check for an overflow which can happen during
converting num_buckets from IntVal to a DecimalValue during width_bucket
evaluation. An overflow can result in hitting a DCHECK if it needs int256
for intermediate evaluations or returns a wrong result otherwise.

Change-Id: Ie5808802096bb0e6cfd4ab6464538474e42cab60
---
M be/src/exprs/expr-test.cc
M be/src/exprs/math-functions-ir.cc
2 files changed, 17 insertions(+), 1 deletion(-)


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

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

[Impala-ASF-CR] IMPALA-7242/IMPALA-7243: check for overflow when converting IntVal to DecimalValue

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

Change subject: IMPALA-7242/IMPALA-7243: check for overflow when converting IntVal to DecimalValue
......................................................................


Patch Set 2:

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


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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie5808802096bb0e6cfd4ab6464538474e42cab60
Gerrit-Change-Number: 11020
Gerrit-PatchSet: 2
Gerrit-Owner: anujphadke <ap...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-Comment-Date: Mon, 06 Aug 2018 21:31:49 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-7242/IMPALA-7243: check for overflow when converting IntVal to DecimalValue

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

Change subject: IMPALA-7242/IMPALA-7243: check for overflow when converting IntVal to DecimalValue
......................................................................


Patch Set 2:

(2 comments)

http://gerrit.cloudera.org:8080/#/c/11020/1/be/src/exprs/expr-test.cc
File be/src/exprs/expr-test.cc:

http://gerrit.cloudera.org:8080/#/c/11020/1/be/src/exprs/expr-test.cc@5382
PS1, Line 5382:   // IMPALA-7242/IMPALA-7243: check for overflow when converting IntVal to DecimalValue
> Can you mention the JIRA number here for context?
Done


http://gerrit.cloudera.org:8080/#/c/11020/1/be/src/exprs/math-functions-ir.cc
File be/src/exprs/math-functions-ir.cc:

http://gerrit.cloudera.org:8080/#/c/11020/1/be/src/exprs/math-functions-ir.cc@541
PS1, Line 541:     stringstream error_msg;
> Just to be clear, this one would be nice but is optional since it's consist
Having issues building impala locally to verify. 
I have fixed the comment. I will send a follow up patch and replace this.



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie5808802096bb0e6cfd4ab6464538474e42cab60
Gerrit-Change-Number: 11020
Gerrit-PatchSet: 2
Gerrit-Owner: anujphadke <ap...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-Reviewer: anujphadke <ap...@cloudera.com>
Gerrit-Comment-Date: Mon, 06 Aug 2018 21:32:25 +0000
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-7242/IMPALA-7243: check for overflow when converting IntVal to DecimalValue

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/11020 )

Change subject: IMPALA-7242/IMPALA-7243: check for overflow when converting IntVal to DecimalValue
......................................................................

IMPALA-7242/IMPALA-7243: check for overflow when converting IntVal to DecimalValue

This change adds a check for an overflow which can happen during
converting num_buckets from IntVal to a DecimalValue during width_bucket
evaluation. An overflow can result in hitting a DCHECK if it needs int256
for intermediate evaluations or returns a wrong result otherwise.

Change-Id: Ie5808802096bb0e6cfd4ab6464538474e42cab60
Reviewed-on: http://gerrit.cloudera.org:8080/11020
Reviewed-by: Tim Armstrong <ta...@cloudera.com>
Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
M be/src/exprs/expr-test.cc
M be/src/exprs/math-functions-ir.cc
2 files changed, 17 insertions(+), 1 deletion(-)

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

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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ie5808802096bb0e6cfd4ab6464538474e42cab60
Gerrit-Change-Number: 11020
Gerrit-PatchSet: 3
Gerrit-Owner: anujphadke <ap...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-Reviewer: anujphadke <ap...@cloudera.com>

[Impala-ASF-CR] IMPALA-7242/IMPALA-7243: check for overflow when converting IntVal to DecimalValue

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

Change subject: IMPALA-7242/IMPALA-7243: check for overflow when converting IntVal to DecimalValue
......................................................................


Patch Set 1:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/11020/1/be/src/exprs/math-functions-ir.cc
File be/src/exprs/math-functions-ir.cc:

http://gerrit.cloudera.org:8080/#/c/11020/1/be/src/exprs/math-functions-ir.cc@541
PS1, Line 541:     stringstream error_msg;
> Nit: we prefer Substitute() over stringstream where possible (although I gu
Just to be clear, this one would be nice but is optional since it's consistent with the other code



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie5808802096bb0e6cfd4ab6464538474e42cab60
Gerrit-Change-Number: 11020
Gerrit-PatchSet: 1
Gerrit-Owner: anujphadke <ap...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-Comment-Date: Mon, 06 Aug 2018 20:37:29 +0000
Gerrit-HasComments: Yes

[Impala-ASF-CR] IMPALA-7242/IMPALA-7243: check for overflow when converting IntVal to DecimalValue

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

Change subject: IMPALA-7242/IMPALA-7243: check for overflow when converting IntVal to DecimalValue
......................................................................


Patch Set 2:

Build Successful 

https://jenkins.impala.io/job/gerrit-code-review-checks/211/ : 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/11020
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie5808802096bb0e6cfd4ab6464538474e42cab60
Gerrit-Change-Number: 11020
Gerrit-PatchSet: 2
Gerrit-Owner: anujphadke <ap...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-Reviewer: anujphadke <ap...@cloudera.com>
Gerrit-Comment-Date: Mon, 06 Aug 2018 22:00:26 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-7242/IMPALA-7243: check for overflow when converting IntVal to DecimalValue

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

Change subject: IMPALA-7242/IMPALA-7243: check for overflow when converting IntVal to DecimalValue
......................................................................


Patch Set 1:

Build Successful 

https://jenkins.impala.io/job/gerrit-code-review-checks/14/ : Initial code review checks passed. Use gerrit-verify-dryrun-external or gerrit-verify-dryrun to run full precommit tests. This is experimental - please report any issues to tarmstrong@cloudera.com or on this JIRA: https://issues.apache.org/jira/browse/IMPALA-7317


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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie5808802096bb0e6cfd4ab6464538474e42cab60
Gerrit-Change-Number: 11020
Gerrit-PatchSet: 1
Gerrit-Owner: anujphadke <ap...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Comment-Date: Mon, 23 Jul 2018 22:16:16 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-7242/IMPALA-7243: check for overflow when converting IntVal to DecimalValue

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

Change subject: IMPALA-7242/IMPALA-7243: check for overflow when converting IntVal to DecimalValue
......................................................................


Patch Set 2: Code-Review+2


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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie5808802096bb0e6cfd4ab6464538474e42cab60
Gerrit-Change-Number: 11020
Gerrit-PatchSet: 2
Gerrit-Owner: anujphadke <ap...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-Comment-Date: Mon, 06 Aug 2018 21:31:37 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-7242/IMPALA-7243: check for overflow when converting IntVal to DecimalValue

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

Change subject: IMPALA-7242/IMPALA-7243: check for overflow when converting IntVal to DecimalValue
......................................................................


Patch Set 1:

(2 comments)

Couple of minor comments, but looks good.

http://gerrit.cloudera.org:8080/#/c/11020/1/be/src/exprs/expr-test.cc
File be/src/exprs/expr-test.cc:

http://gerrit.cloudera.org:8080/#/c/11020/1/be/src/exprs/expr-test.cc@5382
PS1, Line 5382:   // Test when converting num_buckets from a IntVal to Decimal16Val causes an
Can you mention the JIRA number here for context?


http://gerrit.cloudera.org:8080/#/c/11020/1/be/src/exprs/math-functions-ir.cc
File be/src/exprs/math-functions-ir.cc:

http://gerrit.cloudera.org:8080/#/c/11020/1/be/src/exprs/math-functions-ir.cc@541
PS1, Line 541:     stringstream error_msg;
Nit: we prefer Substitute() over stringstream where possible (although I guess we're already using it for other cases above).



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie5808802096bb0e6cfd4ab6464538474e42cab60
Gerrit-Change-Number: 11020
Gerrit-PatchSet: 1
Gerrit-Owner: anujphadke <ap...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <ta...@cloudera.com>
Gerrit-Comment-Date: Tue, 24 Jul 2018 22:34:30 +0000
Gerrit-HasComments: Yes