-
Notifications
You must be signed in to change notification settings - Fork 254
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
feat: allow replacement of entire datafile when the schema lines up correctly #3408
Conversation
f636176
to
7881bf7
Compare
@@ -23,21 +23,25 @@ | |||
//! them to be compatible. | |||
//! | |||
//! | | Append | Delete / Update | Overwrite/Create | Create Index | Rewrite | Merge | Project | UpdateConfig | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed (1), (2), (3) to emoji so the table width align better
c1845b6
to
c615eb0
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3408 +/- ##
==========================================
- Coverage 78.86% 78.77% -0.10%
==========================================
Files 250 250
Lines 91602 91711 +109
Branches 91602 91711 +109
==========================================
Hits 72244 72244
- Misses 16395 16503 +108
- Partials 2963 2964 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
a532430
to
4d50cac
Compare
6feccd3
to
895d8d0
Compare
7f65391
to
d757a62
Compare
d757a62
to
bea9bd0
Compare
b300e35
to
990c612
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
YOLO approval if we can add that warning. Will come back and think about this more later.
} => pb::transaction::Operation::DataReplacement(pb::transaction::DataReplacement { | ||
old_fragment_ids: old_fragment_ids.clone(), | ||
new_datafiles: new_datafiles.iter().map(pb::DataFile::from).collect(), | ||
}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we will eventually want some rust-level tests of data replacement but could potentially be done in a future PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those are in dataset.rs but github is folding the file for some reason :(
#[tokio::test] | ||
async fn test_datafile_partial_replacement() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to see one more test case to verify you tombstone fields correctly:
- write
a, b
- Column replacement on
b
- Assert that fragment has to data files:
- file 1 has column id [0, -2] (-2 is the column id tombstone)
- file 2 has column ids [1]
See this merge insert test for an example of where else this happens:
lance/rust/lance/src/dataset/write/merge_insert.rs
Lines 2046 to 2053 in c73d717
let has_added_files = |frag: &Fragment| { | |
assert_eq!(frag.files.len(), 2); | |
let data_files = &frag.files; | |
// Updated columns should be only columns in new data files | |
// -2 field ids are tombstoned. | |
assert_eq!(&data_files[0].fields, &[0, -2, -2]); | |
assert_eq!(&data_files[1].fields, &[2, 1]); | |
}; |
990c612
to
0dc4169
Compare
0dc4169
to
390c58e
Compare
For internal design doc see notion or ping me
What this PR implements
![image](https://private-user-images.githubusercontent.com/12615154/408829029-85219024-a4a4-4b9a-bfb7-2b2f4990e68d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxMDY3MDUsIm5iZiI6MTczOTEwNjQwNSwicGF0aCI6Ii8xMjYxNTE1NC80MDg4MjkwMjktODUyMTkwMjQtYTRhNC00YjlhLWJmYjctMmIyZjQ5OTBlNjhkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA5VDEzMDY0NVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTg1OWY1ZTgwMjM5Yjg2ZTY1ZDM2MTZlMTBmZTk4YTQyOWU4NTE1ZWQ2MmMwZWViMGY1YzRkMGM1NzdhYzY3N2YmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.atwk3IHaFM10XM-XOXu15_6yHVcVb3_eM2pYeBSmNp8)
Plan of attack:
TODO: