karmendra8386 commented on PR #14806:
URL: https://github.com/apache/gravitino/pull/14806#issuecomment-6803914250

   Thanks for the review, Jerry — both points addressed.
   
   On parity, I traced it through: the Python literal goes on the wire as a 
value string with an explicit type — for Decimal("1E+3") it's {"dataType": 
"decimal(4,0)", "value": "1E+3"}, since DTOConverters.to_function_arg sends 
str(value) plus the type. On the server, JsonUtils parses "decimal(4,0)" into 
DecimalType.of(4, 0), which passes checkPrecisionScale, and 
DTOConverters.fromFunctionArg builds Literals.of(value, dataType) — the value 
stays a string and nothing calls Decimal.of(BigDecimal) on it, so the server 
accepts it. The rejection you found happens when constructing a Java Decimal 
itself (its constructor derives scale -3 from the BigDecimal), so the Java 
client can't build this literal, but the wire form is fine. I also added a 
short docstring on decimal_literal noting the normalization and this difference.
   
   On NaN/Infinity: added in 1ba24b934 — decimal_literal now raises 
ValueError("Decimal literal must be a finite number") for non-finite values, 
with a regression test covering NaN, Infinity and -Infinity. Full client-python 
suite: 1,435 passed; pylint 10/10 on the changed files.
   


-- 
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]

Reply via email to