You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What happened:
A string value from the source is converted to python decimal.Decimal using decimal.create_decimal(str).
When this value is written to deltalake using write_deltalake, the datatype is created as decimal with exact precision of the incoming value, for ex: decimal(2,1). Next time, when I try to append a value with a higher precision, it throws the error: Parser error: parse decimal overflow
What you expected to happen:
expectation is to load the data without errors.
merge_schema feature could increase the precision when incoming data is of higher precision(?)
First execution: python ./simple-writer.py "8.6" will succeed
Second execution: python ./simple-writer.py "30.6" will fail with Parser error: parse decimal overflow
More details:
The text was updated successfully, but these errors were encountered:
@neo4py I don't think we can increase the precision while doing mergeSchema. from this discussion at delta: delta-io/delta#514 (comment), they also don't allow it since it can cause loss of information.
I suggest you create the table first with the DeltaTable.create() api and then explicitly mention what type of precision your decimal column needs
Actually it is a bug in the rust Writer, didn't see that the second write action succeeds and puts the table in an invalid state. That needs to be handled and there should be a raise before writing.
ion-elgreco
changed the title
Decimal overflow error with schema_mode=merge in Python deltalake 0.16.0
Rust writer should raise when decimal types are incompatible (currently writers and puts table in invalid state)
Mar 24, 2024
Environment: PyPI deltalake 0.16.0
Delta-rs version: deltalake 0.16.0
Binding: Python
Environment:
Bug
What happened:
A string value from the source is converted to python
decimal.Decimal
usingdecimal.create_decimal(str)
.When this value is written to deltalake using
write_deltalake
, the datatype is created as decimal with exact precision of the incoming value, for ex:decimal(2,1)
. Next time, when I try to append a value with a higher precision, it throws the error:Parser error: parse decimal overflow
What you expected to happen:
expectation is to load the data without errors.
merge_schema feature could increase the precision when incoming data is of higher precision(?)
How to reproduce it:
First execution:
python ./simple-writer.py "8.6"
will succeedSecond execution:
python ./simple-writer.py "30.6"
will fail withParser error: parse decimal overflow
More details:
The text was updated successfully, but these errors were encountered: