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

[Rust] Read Partially from a plain encoded batch #443

Merged
merged 8 commits into from
Jan 20, 2023

Conversation

eddyxu
Copy link
Contributor

@eddyxu eddyxu commented Jan 19, 2023

No description provided.

@eddyxu eddyxu changed the title [Rust] Read partial from a Batch [Rust] Read Partially from a plain encoded batch Jan 20, 2023
@eddyxu eddyxu requested a review from changhiskhan January 20, 2023 00:11
@eddyxu eddyxu self-assigned this Jan 20, 2023
@eddyxu eddyxu marked this pull request as ready for review January 20, 2023 00:12
start, end, self.length
)));
}
let start_offset = match self.data_type {
Copy link
Contributor

Choose a reason for hiding this comment

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

Let’s make a “index_to_offset” function?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

};
let range = Range {
start: self.position,
end: self.position + array_bytes,
start: self.position + start_offset,
Copy link
Contributor

Choose a reason for hiding this comment

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

I vaguely remember that the C++ implementation was more complicated than this. Any edge cases that’s not covered here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This does not cover the logic in C++ PlainEncoder::Take(indices) yet.
For C++, PlainEncoder::ToArray(...) this PR reaches the parity.
https://github.com/eto-ai/lance/blob/main/cpp/src/lance/encodings/plain.cc#L127-L149

Added 2 more tests to cover edge cases nonetheless.

@changhiskhan changhiskhan merged commit a450899 into main Jan 20, 2023
@changhiskhan changhiskhan deleted the lei/plain_decoder_point_query branch January 20, 2023 01:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants