jackylee-ch opened a new pull request, #945:
URL: https://github.com/apache/paimon-rust/pull/945
`variant_get(col, path, 'int'|'long')` rejected variant numbers with a
fractional part: decimals with a non-zero fraction hit `rescale_decimal(.., 0)`
and errored, while `double`/`float` fell through to `Err`. So
`variant_get(parse_json('{"a":19.99}'), '$.a', 'int')` failed with "Invalid
Variant cast" instead of returning `19`.
Truncate toward zero (SQL/Spark `RoundingMode.DOWN`) for decimal, double,
and float, keeping the integral-fit check — `-3.9` becomes `-3`, not `-4`.
String variants are unchanged, matching Spark's NULL-on-non-integer-string
behavior.
Added a test asserting `19.99 -> 19`, `-3.9 -> -3`, `try_variant_get -> 19`,
and `2.5e0 -> 2`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]