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

fix: stats is optional in add action #2841

Merged
merged 1 commit into from
Sep 10, 2024

Conversation

jkylling
Copy link
Contributor

@jkylling jkylling commented Sep 3, 2024

Description

The stats field in add actions is optional, https://github.com/delta-io/delta/blob/master/PROTOCOL.md#add-file-and-remove-file

We currently silently skip reading add actions from snapshots without stats.

Related Issue(s)

Documentation

@github-actions github-actions bot added the binding/rust Issues for the Rust crate label Sep 3, 2024
rtyler
rtyler previously approved these changes Sep 3, 2024
Copy link

codecov bot commented Sep 3, 2024

Codecov Report

Attention: Patch coverage is 90.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 72.48%. Comparing base (1392ac3) to head (4d1a156).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
crates/core/src/protocol/mod.rs 85.71% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2841      +/-   ##
==========================================
- Coverage   72.50%   72.48%   -0.02%     
==========================================
  Files         132      132              
  Lines       40049    40057       +8     
  Branches    40049    40057       +8     
==========================================
- Hits        29038    29036       -2     
  Misses       9159     9159              
- Partials     1852     1862      +10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rtyler
Copy link
Member

rtyler commented Sep 3, 2024

@jkylling I am trying to add a test case to validate this scenario and cannot reproduce the issue since my Add actions with no stats are coming through. Lots of our tests have Add actions with no stats too 😕

@jkylling
Copy link
Contributor Author

jkylling commented Sep 3, 2024

@jkylling I am trying to add a test case to validate this scenario and cannot reproduce the issue since my Add actions with no stats are coming through. Lots of our tests have Add actions with no stats too 😕

This code path seems to only be triggered when reading checkpoints without a stats column? It might be delta-rs always includes a stats column, even if all its values are null. I encountered this on a table written by Databricks Spark.

@jkylling
Copy link
Contributor Author

jkylling commented Sep 3, 2024

@rtyler if we remove stats from the checkpoint schema the checkpoint_writer::simple_checkpoint_simple_checkpoint_test fails on main because some files are missing. Please see 6da8b6b

@jkylling jkylling requested a review from rtyler September 3, 2024 17:54
@ion-elgreco
Copy link
Collaborator

@jkylling can you add a test for this

auto-merge was automatically disabled September 10, 2024 08:50

Head branch was pushed to by a user without write access

@jkylling
Copy link
Contributor Author

jkylling commented Sep 10, 2024

@rtyler @ion-elgreco I've added a test with a checkpoint without a stats column. Please have a look.

@rtyler rtyler added this pull request to the merge queue Sep 10, 2024
Merged via the queue into delta-io:main with commit df504fa Sep 10, 2024
20 of 21 checks passed
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants