Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure decimal statistics are written correctly in Rust #1208

Closed
wjones127 opened this issue Mar 6, 2023 · 0 comments · Fixed by #1397
Closed

Ensure decimal statistics are written correctly in Rust #1208

wjones127 opened this issue Mar 6, 2023 · 0 comments · Fixed by #1397
Labels
binding/rust Issues for the Rust crate bug Something isn't working good first issue Good for newcomers

Comments

@wjones127
Copy link
Collaborator

We are currently writing the underlying i128 value, but we should be writing the equivalent floating point value.

Here is an example from Spark:

{"add":{"path":"part-00000-28925d3a-bdf2-411e-bca9-b067444cbcb0-c000.snappy.parquet","partitionValues":{},"size":5489,"modificationTime":1666652374000,"dataChange":true,"stats":"{\"numRecords\":1,\"minValues\":{\"integer\":1,\"double\":1.234,\"decimal\":-5.67800,\"string\":\"string\",\"date\":\"2022-10-24\",\"timestamp\":\"2022-10-24T22:59:34.067Z\",\"struct\":{\"struct_element\":\"struct_value\"},\"nested_struct\":{\"struct_element\":{\"nested_struct_element\":\"nested_struct_value\"}}},\"maxValues\":{\"integer\":1,\"double\":1.234,\"decimal\":-5.67800,\"string\":\"string\",\"date\":\"2022-10-24\",\"timestamp\":\"2022-10-24T22:59:34.067Z\",\"struct\":{\"struct_element\":\"struct_value\"},\"nested_struct\":{\"struct_element\":{\"nested_struct_element\":\"nested_struct_value\"}}},\"nullCount\":{\"integer\":0,\"null\":1,\"boolean\":0,\"double\":0,\"decimal\":0,\"string\":0,\"binary\":0,\"date\":0,\"timestamp\":0,\"struct\":{\"struct_element\":0},\"map\":0,\"array\":0,\"nested_struct\":{\"struct_element\":{\"nested_struct_element\":0}},\"struct_of_array_of_map\":{\"struct_element\":0}}}","tags":{"INSERTION_TIME":"1666652374000000","OPTIMIZE_TARGET_SIZE":"268435456"}}}

@wjones127 wjones127 added bug Something isn't working good first issue Good for newcomers binding/rust Issues for the Rust crate labels Mar 6, 2023
roeap pushed a commit to roeap/delta-rs that referenced this issue Jun 2, 2023
# Description

* Removed the data copies in a tight loop, which were extremely bad for
performance when writing files > 100MB.
* Rewrote statistics handling to collect null values from metadata, just
like min and max.
* Added support for more types in statistics.

# Related Issue(s)

- closes delta-io#1394
- closes delta-io#1209 
- closes delta-io#1208


# Documentation

<!---
Share links to useful documentation
--->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
binding/rust Issues for the Rust crate bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant