Arnab Karmakar has posted comments on this change. ( https://gerrit.cloudera.org/25459 )
Change subject: IMPALA-15811: Support DECIMAL(p,s) as a variant_get() target type ...................................................................... Patch Set 3: (6 comments) Thanks for working on this! https://gerrit.cloudera.org/#/c/25459/3/be/src/exprs/variant-functions-ir.cc File be/src/exprs/variant-functions-ir.cc: https://gerrit.cloudera.org/#/c/25459/3/be/src/exprs/variant-functions-ir.cc@364 PS3, Line 364: // PARSE_UNDERFLOW means that digits beyond 'scale' were rounded. We could add that underflow also comes from an exponent that is too negative like 1e-200 would give 0. https://gerrit.cloudera.org/#/c/25459/3/be/src/exprs/variant-functions-test.cc File be/src/exprs/variant-functions-test.cc: https://gerrit.cloudera.org/#/c/25459/3/be/src/exprs/variant-functions-test.cc@686 PS3, Line 686: and the last one needs nit: It sounds a little unclear. https://gerrit.cloudera.org/#/c/25459/3/be/src/exprs/variant-functions-test.cc@740 PS3, Line 740: We can add some more string path cases like exponent notation ("1.5e2"), a rounding carry ("9.995" at (10,2) gives 10.00) and a tiny exponent ("1e-200" gives 0). Also integer boundaries. https://gerrit.cloudera.org/#/c/25459/3/docs/topics/impala_variant.xml File docs/topics/impala_variant.xml: https://gerrit.cloudera.org/#/c/25459/3/docs/topics/impala_variant.xml@175 PS3, Line 175: Impala can parse as an integer. A decimal is rounded to the nearest integer, I think we dont read DECIMAL_V2 and round is hardcoded to true, so would it be good to document this here that variant_get() always rounds. https://gerrit.cloudera.org/#/c/25459/3/docs/topics/impala_variant.xml@188 PS3, Line 188: keeps every : digit if they are large enough nit: "if the precision is large enough" sounds more clear. https://gerrit.cloudera.org/#/c/25459/3/fe/src/test/java/org/apache/impala/analysis/AnalyzeExprsTest.java File fe/src/test/java/org/apache/impala/analysis/AnalyzeExprsTest.java: https://gerrit.cloudera.org/#/c/25459/3/fe/src/test/java/org/apache/impala/analysis/AnalyzeExprsTest.java@3610 PS3, Line 3610: 12345678901 nit: The regex in FunctionCallExpr limits digits to 9 each and we get "unsupported target type" but something like "invalid precision" would be clearer. -- To view, visit https://gerrit.cloudera.org/25459 To unsubscribe, visit https://gerrit.cloudera.org/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I07a1aab68238b4af8760f647848aaf07cc5d497d Gerrit-Change-Number: 25459 Gerrit-PatchSet: 3 Gerrit-Owner: Zoltan Borok-Nagy <[email protected]> Gerrit-Reviewer: Arnab Karmakar <[email protected]> Gerrit-Reviewer: Csaba Ringhofer <[email protected]> Gerrit-Reviewer: Impala Public Jenkins <[email protected]> Gerrit-Comment-Date: Mon, 23 Nov 2026 04:26:10 +0000 Gerrit-HasComments: Yes
