Kayvan-Zahiri opened a new issue, #14213:
URL: https://github.com/apache/gravitino/issues/14213
### Version
main branch, Python 3.12
### Describe what's wrong
The Python client rejects finite `Decimal` values with positive exponents
even when the expanded value fits Gravitino's decimal precision.
`Literals.decimal_literal(Decimal("1E+3"))` should represent 1000 as
decimal(4,0), but calculates scale -3 and fails validation.
### Error message and/or stacktrace
`ValueError: Decimal scale must be in range [0, precision (1)]: -3`
### How to reproduce
```python
from decimal import Decimal
from gravitino.api.rel.expressions.literals.literals import Literals
Literals.decimal_literal(Decimal("1E+3"))
```
### Additional context
`Decimal("-1.23E+4")` fails similarly. A locally tested fix counts
positive-exponent zeroes in precision, clamps scale to zero, and preserves the
original Decimal value. Fractional scale remains unchanged and expanded values
above 38 digits remain rejected. Reproduced with Codex assistance; no server or
credentials involved.
--
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]