Skip to content

refactor!: more logical writes#4090

Merged
roeap merged 1 commit intodelta-io:mainfrom
roeap:refactor/more-logical-writes
Jan 18, 2026
Merged

refactor!: more logical writes#4090
roeap merged 1 commit intodelta-io:mainfrom
roeap:refactor/more-logical-writes

Conversation

@roeap
Copy link
Copy Markdown
Collaborator

@roeap roeap commented Jan 17, 2026

Description

It seems we may have found an avenue into moving further into logical planning that does not break stuff 😆. This PR updates the write operation to no longer make use of DataFrame and use logical plans.

Turns out that handling generated columns is a significant part of this. I'll try and remove the the usage of current gc-related function in a follow-up. This touches merge though, so keeping it separate.

@github-actions github-actions Bot added binding/python Issues for the Python package binding/rust Issues for the Rust crate labels Jan 17, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 17, 2026

Codecov Report

❌ Patch coverage is 87.36059% with 34 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.01%. Comparing base (4231bac) to head (dbde71f).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
crates/core/src/operations/write/mod.rs 76.66% 5 Missing and 9 partials ⚠️
...tes/core/src/operations/write/generated_columns.rs 94.70% 3 Missing and 6 partials ⚠️
crates/core/src/operations/load_cdf.rs 33.33% 0 Missing and 6 partials ⚠️
crates/core/src/operations/write/execution.rs 71.42% 0 Missing and 4 partials ⚠️
python/src/lib.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4090      +/-   ##
==========================================
+ Coverage   75.99%   76.01%   +0.02%     
==========================================
  Files         164      164              
  Lines       44502    44579      +77     
  Branches    44502    44579      +77     
==========================================
+ Hits        33818    33887      +69     
- Misses       9016     9022       +6     
- Partials     1668     1670       +2     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@roeap roeap changed the title refactor: more logical writes refactor!: more logical writes Jan 17, 2026
@roeap roeap marked this pull request as ready for review January 17, 2026 22:52
@roeap roeap force-pushed the refactor/more-logical-writes branch 2 times, most recently from f808c1a to 60dc572 Compare January 18, 2026 02:12
@abhiaagarwal
Copy link
Copy Markdown
Collaborator

Turns out that handling generated columns is a significant part of this.

When I was working on my branch, this was also a problem. I think the right way to solve it would be to use a session at ingestion time to convert the SQL -> logical plan and store that. That, of course, could lead to inconsistencies between the functions that the generated columns had access to and what we use in planning.

@roeap roeap force-pushed the refactor/more-logical-writes branch from 60dc572 to dbde71f Compare January 18, 2026 02:43
@roeap
Copy link
Copy Markdown
Collaborator Author

roeap commented Jan 18, 2026

Yes @abhiaagarwal! In general we need to defer physical planning as much as possible and see that we have clear APIs and guidelines for managing sessions.

let mut actions = this.check_preconditions().await?;

let Some(mut source) = this.input.take() else {
return Err(WriteError::MissingData.into());
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check_preconditions already does this check

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, saw that when looking into that fn ... but i wanted to cleanly take the input and not have the unwrap ... so purely cosmetic :).

Comment on lines +23 to +24
.table_configuration()
.is_feature_enabled(&TableFeature::GeneratedColumns)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this feature be in the snapshot with protocol v4 writer? If not then the behavior is not the same

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point! and yes, this method will check feature enablement via version and feature lists.

Copy link
Copy Markdown
Collaborator

@ion-elgreco ion-elgreco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm! Feel free to merge if my comment about gc_is_enabled function maintains previous behavior

@roeap roeap merged commit d06da38 into delta-io:main Jan 18, 2026
29 checks passed
@roeap roeap deleted the refactor/more-logical-writes branch January 18, 2026 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

binding/python Issues for the Python package binding/rust Issues for the Rust crate

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants