Zoltan Borok-Nagy 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 5: (6 comments) Thanks for the comments! 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, or that the > We could add that underflow also comes from an exponent that is too negativ Done. 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: // 12.34 has two integer digits, 99.5 rounds to 100, and 9876543210.123456789 with > nit: It sounds a little unclear. Updated the comment. https://gerrit.cloudera.org/#/c/25459/3/be/src/exprs/variant-functions-test.cc@740 PS3, Line 740: EXPECT_EQ("10.00", GetDecimal(v, "$.carry", 10, 2)); > We can add some more string path cases like exponent notation ("1.5e2"), a Added: "1.5e2", "9.995" at (10,2) and (3,2), "1e-200", "1e200", the bounds of DECIMAL(10,2), and the int64 bounds for the integer path. 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 Done, both bullets now say that the value is rounded half away from zero also if DECIMAL_V2 is false. Also in the commit message. https://gerrit.cloudera.org/#/c/25459/3/docs/topics/impala_variant.xml@189 PS3, Line 189: number. The result has the given precision and scale, so a decimal keeps every > nit: "if the precision is large enough" sounds more clear. Rephrased to "if the precision and the scale are large enough", because a smaller scale rounds. 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: "variant_get() invalid target type 'decimal(12345678901)': " > nit: The regex in FunctionCallExpr limits digits to 9 each and we get "unsu Done, the pattern accepts any number of digits, and a precision or scale that does not fit an int gives "invalid target type ...: Decimal precision must be <= 38: 12345678901". -- 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: 5 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-Reviewer: Zoltan Borok-Nagy <[email protected]> Gerrit-Comment-Date: Mon, 23 Nov 2026 14:34:19 +0000 Gerrit-HasComments: Yes
