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

compact fails with merged schemas #2347

Closed
cmettler opened this issue Mar 27, 2024 · 0 comments · Fixed by #2358
Closed

compact fails with merged schemas #2347

cmettler opened this issue Mar 27, 2024 · 0 comments · Fixed by #2358
Labels
bug Something isn't working

Comments

@cmettler
Copy link

Environment

Delta-rs version: deltalake-0.16.3

Binding: python


Bug

What happened:
writing two dataframes with different schemas with schema_mode='merge' causes a compact to fail

What you expected to happen:
succesfully compact the files with the merged schema

How to reproduce it:

df1 = pd.DataFrame({'A':[1]})
write_deltalake(target_table, df1,engine="rust",storage_options=storage_options,mode='append',schema_mode='merge')

df2 = pd.DataFrame({'B':[2]})
write_deltalake(target_table, df2,engine="rust",storage_options=storage_options,mode='append',schema_mode='merge')

dt = DeltaTable(target_table,storage_options=storage_options)
dt.optimize.compact()

fails with: SchemaMismatchError: Could not find column B

@cmettler cmettler added the bug Something isn't working label Mar 27, 2024
ion-elgreco added a commit that referenced this issue Mar 29, 2024
# Description
Default should be always to add missing columns in compaction.

# Related Issue(s)
- fixes #2347
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
Development

Successfully merging a pull request may close this issue.

1 participant