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

Fetch Dataset Versions #272

Merged
merged 8 commits into from
Oct 30, 2022
Merged

Fetch Dataset Versions #272

merged 8 commits into from
Oct 30, 2022

Conversation

eddyxu
Copy link
Contributor

@eddyxu eddyxu commented Oct 28, 2022

Provide LanceDataset::versions() and LanceDataset::latest_version() methods to fetch available versions.

@eddyxu eddyxu marked this pull request as ready for review October 28, 2022 20:34
@eddyxu eddyxu requested a review from changhiskhan October 28, 2022 20:44
@eddyxu eddyxu self-assigned this Oct 28, 2022
@eddyxu eddyxu added c++ C++ issues arrow Apache Arrow related issues labels Oct 28, 2022
Copy link
Contributor

@changhiskhan changhiskhan left a comment

Choose a reason for hiding this comment

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

will pyarrow.dataset.dataset be able to read this at all? or we need lance.dataset for this to work with versioning?

@@ -85,4 +85,6 @@ void Manifest::AppendFragments(const std::vector<std::shared_ptr<DataFragment>>&
fragments_.insert(std::end(fragments_), std::begin(fragments), std::end(fragments));
}

arrow::DatasetVersion Manifest::ToDatasetVersion() const { return arrow::DatasetVersion{version_}; }
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: not sure what's the right C++ convention but here's we're not turning a Manifest into a DatastVersion, instead we're getting it's version_ as a Datasetversion right? Isn't GetDatasetVersion more appropriate?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sgtm. will change.


ARROW_ASSIGN_OR_RAISE(auto file_infos, impl_->fs->GetFileInfo(selector));
for (const auto& finfo : file_infos) {
ARROW_ASSIGN_OR_RAISE(auto manifest, OpenManifest(impl_->fs, finfo.path()));
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this need an explicit close or are these automatically cleaned up?

Copy link
Contributor Author

@eddyxu eddyxu Oct 30, 2022

Choose a reason for hiding this comment

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

this opens as arrow::RandomInputFile which will be closed once it is out of scope.

std::make_shared<lance::format::DataFragment>(lance::format::DataFile(path, field_ids)));
}
return fragments;
return paths | views::transform([&field_ids](auto& path) {
Copy link
Contributor

Choose a reason for hiding this comment

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

just confirming: these don't need any error handling because they're not actually opening the resources right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yea, there is no system call in this transform.

@eddyxu
Copy link
Contributor Author

eddyxu commented Oct 30, 2022

will pyarrow.dataset.dataset be able to read this at all? or we need lance.dataset for this to work with versioning?

We need lance.dataset until there is a way to reflect pyarrow.Dataset from pyarrow.FileFormat.

@eddyxu eddyxu merged commit 78eb27e into main Oct 30, 2022
@eddyxu eddyxu deleted the lei/dataset_versions branch October 30, 2022 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrow Apache Arrow related issues c++ C++ issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants