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

unable to read delta table when table contains both null and non-null add stats #2477

Closed
yjshen opened this issue May 3, 2024 · 0 comments · Fixed by #2476
Closed

unable to read delta table when table contains both null and non-null add stats #2477

yjshen opened this issue May 3, 2024 · 0 comments · Fixed by #2476
Labels
bug Something isn't working

Comments

@yjshen
Copy link
Contributor

yjshen commented May 3, 2024

Environment

Delta-rs version: the latest

Binding: rust

Environment:

  • Cloud provider:
  • OS:
  • Other:

Bug

What happened:
Unable to read table when it contains both commit of add action with stats, and commit of add action without stats.

What you expected to happen:
Able to read the file whether stats exists for all actions

How to reproduce it:
A simple table with several add actions, either in one commit or several commits. Some of the add action has stats, while some has stats_parsed: null.

More details:

@yjshen yjshen added the bug Something isn't working label May 3, 2024
ion-elgreco pushed a commit that referenced this issue May 6, 2024
…nd non-null add stats (#2476)

# Description
To fix the issue when a delta table contains add action with
stats_parsed: null.

As shown in the test case, `001.json` contains an Add action with stats,
while `002.json` contains an Add action with `stats_parsed: null`,
before this fix, it will complain:

```
Arrow { source: InvalidArgumentError("all columns in a record batch must have the same length") }
```

The issue is that the array for `num_records` has two values, while for
other stats such as null_count, the None value is filtered out by
`flat_map`, so there is only one value in the array.


# Related Issue(s)
closes #2477 

# 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
bug Something isn't working
Projects
None yet
1 participant