Zoltan Borok-Nagy has posted comments on this change. ( 
https://gerrit.cloudera.org/25392 )

Change subject: IMPALA-15760: Calcite Planner: Exponents above 38 do not parse
......................................................................


Patch Set 1:

(3 comments)

Thanks for fixing this!

https://gerrit.cloudera.org/#/c/25392/1/java/calcite-planner/src/main/codegen/templates/Parser.jj
File java/calcite-planner/src/main/codegen/templates/Parser.jj:

https://gerrit.cloudera.org/#/c/25392/1/java/calcite-planner/src/main/codegen/templates/Parser.jj@4711
PS1, Line 4711:           return t.isDecimal()
inferType() returns TINYINT/SMALLINT/BIGINT for 1e0/1e3/1e18, so these now go 
through createApproxNumeric() and become DOUBLE. Before this patch, and in the 
original planner, select 1e3 is SMALLINT, and 1e18 + 1 would now lose precision.
Could you fall back to the approximate literal only when 
TypesUtil.computeDecimalType(bd) returns null?


https://gerrit.cloudera.org/#/c/25392/1/java/calcite-planner/src/main/codegen/templates/Parser.jj@4715
PS1, Line 4715: "
nit: add space after colon


https://gerrit.cloudera.org/#/c/25392/1/testdata/workloads/functional-query/queries/QueryTest/calcite.test
File testdata/workloads/functional-query/queries/QueryTest/calcite.test:

https://gerrit.cloudera.org/#/c/25392/1/testdata/workloads/functional-query/queries/QueryTest/calcite.test@1652
PS1, Line 1652: select 1e-46
Please also cover the case from the title (1e40), the boundaries (1e38, 1e-39) 
and one whole-number case such as 1e3 (TYPES SMALLINT), so the issue above is 
covered by a test.



--
To view, visit https://gerrit.cloudera.org/25392
To unsubscribe, visit https://gerrit.cloudera.org/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I636a374d9ea30582f57eccea6635eed2651489a5
Gerrit-Change-Number: 25392
Gerrit-PatchSet: 1
Gerrit-Owner: Steve Carlin <[email protected]>
Gerrit-Reviewer: Aman Sinha <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Joe McDonnell <[email protected]>
Gerrit-Reviewer: Michael Smith <[email protected]>
Gerrit-Reviewer: Quanlong Huang <[email protected]>
Gerrit-Reviewer: Zoltan Borok-Nagy <[email protected]>
Gerrit-Comment-Date: Tue, 10 Nov 2026 15:56:02 +0000
Gerrit-HasComments: Yes

Reply via email to