Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat!: allow passing down existing dataset for write #3119

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

wjones127
Copy link
Contributor

@wjones127 wjones127 commented Nov 11, 2024

BREAKING CHANGE: return value in Rust of write_fragments() has changed to Result<Transaction>.

@codecov-commenter
Copy link

codecov-commenter commented Nov 12, 2024

Codecov Report

Attention: Patch coverage is 74.76636% with 135 lines in your changes missing coverage. Please review.

Project coverage is 77.92%. Comparing base (f60283e) to head (da2fadd).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
rust/lance/src/dataset/write/insert.rs 75.19% 56 Missing and 7 partials ⚠️
rust/lance/src/dataset/write/commit.rs 77.61% 44 Missing and 1 partial ⚠️
rust/lance/src/dataset/write.rs 56.52% 18 Missing and 2 partials ⚠️
rust/lance/src/dataset.rs 78.78% 4 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3119      +/-   ##
==========================================
+ Coverage   77.87%   77.92%   +0.05%     
==========================================
  Files         240      242       +2     
  Lines       81630    81903     +273     
  Branches    81630    81903     +273     
==========================================
+ Hits        63566    63825     +259     
- Misses      14830    14860      +30     
+ Partials     3234     3218      -16     
Flag Coverage Δ
unittests 77.92% <74.76%> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@wjones127 wjones127 changed the title perf: allow passing down existing dataset for write feat!: allow passing down existing dataset for write Nov 13, 2024
@github-actions github-actions bot added enhancement New feature or request java labels Nov 13, 2024
@wjones127 wjones127 marked this pull request as ready for review November 14, 2024 19:12
Copy link
Collaborator

@LuQQiu LuQQiu left a comment

Choose a reason for hiding this comment

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

Left some questions, thanks!

}

/// Whether to use move-stable row ids. This makes the `_rowid` column stable
/// after compaction, but not updates.
Copy link
Collaborator

Choose a reason for hiding this comment

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

even during re-compaction?
interesting, not updates, will update create new rows with new _rowid?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Even during re-compaction, yeah. We don't keep them during updates because that requires invalidating the secondary indices.

You can read more in the design docs:

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks Will! will take a look at the design docs!

///
/// This can be used to stage changes or to handle "secondary" datasets
/// whose lineage is tracked elsewhere.
pub fn with_detached(mut self, detached: bool) -> Self {
Copy link
Collaborator

Choose a reason for hiding this comment

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

interesting, sounds like git

Copy link
Collaborator

Choose a reason for hiding this comment

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

anybody is using this feature or why this feature is asked?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's kind of like git. Though there only one branch, and everything else is detached.

Weston added this feature to support "balanced storage" for large blob columns. Basically we used this to create a separate hidden dataset that stores the blob data, and by doing this we could compact that data at a different rate than other columns.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Interesting, may be with 2.1 we don't need to have this kind of detached dataset for blob?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually it was designed with 2.1 in mind. The ideal rows per file differs so much between small and wide columns that they need to essentially be in different datasets to offer good enough OLAP and random access performance. We wrap it up quite seamlessly though, so for the most part it feels like just another column.

/// Pass an object store registry to use.
///
/// If an object store is passed, this registry will be ignored.
pub fn with_object_store_registry(
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: is there a macro we can use to generate this builder boilerplate?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I could maybe write a macro, but doesn't seem that worth it to me.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
4 participants