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

Change subject: IMPALA-15611: Convert VARIANT decimals in typed variant_get()
......................................................................


Patch Set 2:

(6 comments)

Thanks for the comments!

https://gerrit.cloudera.org/#/c/25184/1//COMMIT_MSG
Commit Message:

https://gerrit.cloudera.org/#/c/25184/1//COMMIT_MSG@9
PS1, Line 9: type
> What is the situation with DECIMAL(N,M)? Shouldn't that be the basic non-lo
Filed IMPALA-15811 for this.


https://gerrit.cloudera.org/#/c/25184/1//COMMIT_MSG@10
PS1, Line 10: the DECIMAL4, DECIMAL8 and DECIMAL16 physical types for every 
numeric
> How do we print this when converting to json? Do we keep full precision by
We print the exact decimal, there is no conversion to double (see ids 52 and 53 
in iceberg-v3-variant.test). Added a BE test for the STRING target too.


https://gerrit.cloudera.org/#/c/25184/1//COMMIT_MSG@24
PS1, Line 24: xact value: like the JSON
> I think the serializer currently only checks the scale and not the precisio
Right. Fixed the serializer in this CR and updated the message.


https://gerrit.cloudera.org/#/c/25184/1/be/src/exprs/variant-functions-ir.cc
File be/src/exprs/variant-functions-ir.cc:

https://gerrit.cloudera.org/#/c/25184/1/be/src/exprs/variant-functions-ir.cc@137
PS1, Line 137: bool GetDecimal(const VariantValue& sub, Decimal16Value* dv, 
int* scale) {
> I think there's an issue, not within this CR. We check and reject when unsc
Good catch, fixed it here: the serializer now rejects an unscaled value that 
doesn't fit the precision as malformed. Added tests to variant-util-test.cc.


https://gerrit.cloudera.org/#/c/25184/1/be/src/exprs/variant-functions-ir.cc@138
PS1, Line 138:   DCHECK(sub.GetBasicType() == VariantBasicType::PRIMITIVE);
> The callers guard it currently but I think we could make it safer as the co
Done


https://gerrit.cloudera.org/#/c/25184/1/be/src/exprs/variant-functions-test.cc
File be/src/exprs/variant-functions-test.cc:

https://gerrit.cloudera.org/#/c/25184/1/be/src/exprs/variant-functions-test.cc@479
PS1, Line 479: // rounds half away from zero, and a rounded value outside the 
target range overflows.
> can we also try out the negative side -128.5 to TINYINT, which rounds to -1
Done, added -128.5 (out of range) and -128.4 (-128).



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Id7ba21c38e19440cf0a5161c7f1d753f570d8009
Gerrit-Change-Number: 25184
Gerrit-PatchSet: 2
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: Peter Rozsa <[email protected]>
Gerrit-Reviewer: Zoltan Borok-Nagy <[email protected]>
Gerrit-Comment-Date: Mon, 16 Nov 2026 17:00:24 +0000
Gerrit-HasComments: Yes

Reply via email to