[Impala-ASF-CR] IMPALA-7805: Emit zero as "0" in toSql()
Paul Rogers has uploaded this change for review. ( http://gerrit.cloudera.org:8080/11878 Change subject: IMPALA-7805: Emit zero as "0" in toSql() .. IMPALA-7805: Emit zero as "0" in toSql() It turns out that Impala has a somewhat Baroque way to represent the value of a numeric 0. NumericLiteral.toSql() uses the Java BigDecimal class to convert a numeric value to a string for use in explained plans and in verifying expression rewrites. The default Java behavior is to consider scale when rendering numbers, including 0. Thus, depending on precision and scale, you may get: 0 0.0 0.00 0.000 ... 0E-38 However, mathematically, zero is zero. Plans attach no special meaning to the extra decimal points or trailing zeros. To make testing easier, changed the behavior to always emit "0" when the value is zero, regardless of precision or scale. Testing: Reran the planner tests and modified captured plans that had the 0.0, 0.00 variations of zero. Since this change affects only EXPLAIN output, it cannot affect the operation of queries. If may impact other tests that compare EXPLAIN output to a "golden" copy. Change-Id: I0b2f2f34fe5e6003de407301310ccf433841b9f1 --- M fe/src/main/java/org/apache/impala/analysis/NumericLiteral.java M testdata/workloads/functional-planner/queries/PlannerTest/kudu-selectivity.test M testdata/workloads/functional-planner/queries/PlannerTest/tpch-all.test M testdata/workloads/functional-planner/queries/PlannerTest/tpch-kudu.test M testdata/workloads/functional-planner/queries/PlannerTest/tpch-nested.test M testdata/workloads/functional-planner/queries/PlannerTest/tpch-views.test 6 files changed, 28 insertions(+), 21 deletions(-) git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/78/11878/1 -- To view, visit http://gerrit.cloudera.org:8080/11878 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I0b2f2f34fe5e6003de407301310ccf433841b9f1 Gerrit-Change-Number: 11878 Gerrit-PatchSet: 1 Gerrit-Owner: Paul Rogers
[Impala-ASF-CR] IMPALA-7805: Emit zero as "0" in toSql()
Philip Zeyliger has posted comments on this change. ( http://gerrit.cloudera.org:8080/11878 ) Change subject: IMPALA-7805: Emit zero as "0" in toSql() .. Patch Set 1: Code-Review+1 -- To view, visit http://gerrit.cloudera.org:8080/11878 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0b2f2f34fe5e6003de407301310ccf433841b9f1 Gerrit-Change-Number: 11878 Gerrit-PatchSet: 1 Gerrit-Owner: Paul Rogers Gerrit-Reviewer: Impala Public Jenkins Gerrit-Reviewer: Philip Zeyliger Gerrit-Comment-Date: Mon, 05 Nov 2018 23:26:09 + Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-7805: Emit zero as "0" in toSql()
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/11878 ) Change subject: IMPALA-7805: Emit zero as "0" in toSql() .. Patch Set 1: Build Successful https://jenkins.impala.io/job/gerrit-code-review-checks/1285/ : 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/11878 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0b2f2f34fe5e6003de407301310ccf433841b9f1 Gerrit-Change-Number: 11878 Gerrit-PatchSet: 1 Gerrit-Owner: Paul Rogers Gerrit-Reviewer: Impala Public Jenkins Gerrit-Reviewer: Philip Zeyliger Gerrit-Comment-Date: Mon, 05 Nov 2018 23:54:12 + Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-7805: Emit zero as "0" in toSql()
Paul Rogers has uploaded a new patch set (#2). ( http://gerrit.cloudera.org:8080/11878 ) Change subject: IMPALA-7805: Emit zero as "0" in toSql() .. IMPALA-7805: Emit zero as "0" in toSql() It turns out that Impala has a somewhat Baroque way to represent the value of a numeric 0. NumericLiteral.toSql() uses the Java BigDecimal class to convert a numeric value to a string for use in explained plans and in verifying expression rewrites. The default Java behavior is to consider scale when rendering numbers, including 0. Thus, depending on precision and scale, you may get: 0 0.0 0.00 0.000 ... 0E-38 However, mathematically, zero is zero. Plans attach no special meaning to the extra decimal points or trailing zeros. To make testing easier, changed the behavior to always emit "0" when the value is zero, regardless of precision or scale. Testing: Reran the planner tests and modified captured plans that had the 0.0, 0.00 variations of zero. Since this change affects only EXPLAIN output, it cannot affect the operation of queries. If may impact other tests that compare EXPLAIN output to a "golden" copy. Change-Id: I0b2f2f34fe5e6003de407301310ccf433841b9f1 --- M fe/src/main/java/org/apache/impala/analysis/NumericLiteral.java M testdata/workloads/functional-planner/queries/PlannerTest/kudu-selectivity.test M testdata/workloads/functional-planner/queries/PlannerTest/tpch-all.test M testdata/workloads/functional-planner/queries/PlannerTest/tpch-kudu.test M testdata/workloads/functional-planner/queries/PlannerTest/tpch-nested.test M testdata/workloads/functional-planner/queries/PlannerTest/tpch-views.test 6 files changed, 28 insertions(+), 21 deletions(-) git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/78/11878/2 -- To view, visit http://gerrit.cloudera.org:8080/11878 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit-Change-Id: I0b2f2f34fe5e6003de407301310ccf433841b9f1 Gerrit-Change-Number: 11878 Gerrit-PatchSet: 2 Gerrit-Owner: Paul Rogers Gerrit-Reviewer: Impala Public Jenkins Gerrit-Reviewer: Philip Zeyliger
[Impala-ASF-CR] IMPALA-7805: Emit zero as "0" in toSql()
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/11878 ) Change subject: IMPALA-7805: Emit zero as "0" in toSql() .. Patch Set 2: Build Successful https://jenkins.impala.io/job/gerrit-code-review-checks/1336/ : 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/11878 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0b2f2f34fe5e6003de407301310ccf433841b9f1 Gerrit-Change-Number: 11878 Gerrit-PatchSet: 2 Gerrit-Owner: Paul Rogers Gerrit-Reviewer: Impala Public Jenkins Gerrit-Reviewer: Philip Zeyliger Gerrit-Comment-Date: Thu, 08 Nov 2018 23:20:13 + Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-7805: Emit zero as "0" in toSql()
Tim Armstrong has posted comments on this change. ( http://gerrit.cloudera.org:8080/11878 ) Change subject: IMPALA-7805: Emit zero as "0" in toSql() .. Patch Set 2: Code-Review+2 -- To view, visit http://gerrit.cloudera.org:8080/11878 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0b2f2f34fe5e6003de407301310ccf433841b9f1 Gerrit-Change-Number: 11878 Gerrit-PatchSet: 2 Gerrit-Owner: Paul Rogers Gerrit-Reviewer: Impala Public Jenkins Gerrit-Reviewer: Philip Zeyliger Gerrit-Reviewer: Tim Armstrong Gerrit-Comment-Date: Wed, 14 Nov 2018 01:23:44 + Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-7805: Emit zero as "0" in toSql()
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/11878 ) Change subject: IMPALA-7805: Emit zero as "0" in toSql() .. Patch Set 3: Code-Review+2 -- To view, visit http://gerrit.cloudera.org:8080/11878 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0b2f2f34fe5e6003de407301310ccf433841b9f1 Gerrit-Change-Number: 11878 Gerrit-PatchSet: 3 Gerrit-Owner: Paul Rogers Gerrit-Reviewer: Impala Public Jenkins Gerrit-Reviewer: Philip Zeyliger Gerrit-Reviewer: Tim Armstrong Gerrit-Comment-Date: Wed, 14 Nov 2018 06:11:35 + Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-7805: Emit zero as "0" in toSql()
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/11878 ) Change subject: IMPALA-7805: Emit zero as "0" in toSql() .. Patch Set 3: Build started: https://jenkins.impala.io/job/gerrit-verify-dryrun/3459/ DRY_RUN=false -- To view, visit http://gerrit.cloudera.org:8080/11878 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0b2f2f34fe5e6003de407301310ccf433841b9f1 Gerrit-Change-Number: 11878 Gerrit-PatchSet: 3 Gerrit-Owner: Paul Rogers Gerrit-Reviewer: Impala Public Jenkins Gerrit-Reviewer: Philip Zeyliger Gerrit-Reviewer: Tim Armstrong Gerrit-Comment-Date: Wed, 14 Nov 2018 06:11:36 + Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-7805: Emit zero as "0" in toSql()
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/11878 ) Change subject: IMPALA-7805: Emit zero as "0" in toSql() .. Patch Set 3: Verified+1 -- To view, visit http://gerrit.cloudera.org:8080/11878 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0b2f2f34fe5e6003de407301310ccf433841b9f1 Gerrit-Change-Number: 11878 Gerrit-PatchSet: 3 Gerrit-Owner: Paul Rogers Gerrit-Reviewer: Impala Public Jenkins Gerrit-Reviewer: Philip Zeyliger Gerrit-Reviewer: Tim Armstrong Gerrit-Comment-Date: Wed, 14 Nov 2018 10:30:28 + Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-7805: Emit zero as "0" in toSql()
Impala Public Jenkins has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/11878 ) Change subject: IMPALA-7805: Emit zero as "0" in toSql() .. IMPALA-7805: Emit zero as "0" in toSql() It turns out that Impala has a somewhat Baroque way to represent the value of a numeric 0. NumericLiteral.toSql() uses the Java BigDecimal class to convert a numeric value to a string for use in explained plans and in verifying expression rewrites. The default Java behavior is to consider scale when rendering numbers, including 0. Thus, depending on precision and scale, you may get: 0 0.0 0.00 0.000 ... 0E-38 However, mathematically, zero is zero. Plans attach no special meaning to the extra decimal points or trailing zeros. To make testing easier, changed the behavior to always emit "0" when the value is zero, regardless of precision or scale. Testing: Reran the planner tests and modified captured plans that had the 0.0, 0.00 variations of zero. Since this change affects only EXPLAIN output, it cannot affect the operation of queries. If may impact other tests that compare EXPLAIN output to a "golden" copy. Change-Id: I0b2f2f34fe5e6003de407301310ccf433841b9f1 Reviewed-on: http://gerrit.cloudera.org:8080/11878 Reviewed-by: Impala Public Jenkins Tested-by: Impala Public Jenkins --- M fe/src/main/java/org/apache/impala/analysis/NumericLiteral.java M testdata/workloads/functional-planner/queries/PlannerTest/kudu-selectivity.test M testdata/workloads/functional-planner/queries/PlannerTest/tpch-all.test M testdata/workloads/functional-planner/queries/PlannerTest/tpch-kudu.test M testdata/workloads/functional-planner/queries/PlannerTest/tpch-nested.test M testdata/workloads/functional-planner/queries/PlannerTest/tpch-views.test 6 files changed, 28 insertions(+), 21 deletions(-) Approvals: Impala Public Jenkins: Looks good to me, approved; Verified -- To view, visit http://gerrit.cloudera.org:8080/11878 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I0b2f2f34fe5e6003de407301310ccf433841b9f1 Gerrit-Change-Number: 11878 Gerrit-PatchSet: 4 Gerrit-Owner: Paul Rogers Gerrit-Reviewer: Impala Public Jenkins Gerrit-Reviewer: Philip Zeyliger Gerrit-Reviewer: Tim Armstrong