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

Project skips scan if the filter covers all the columns #117

Merged
merged 5 commits into from
Aug 18, 2022

Conversation

eddyxu
Copy link
Contributor

@eddyxu eddyxu commented Aug 18, 2022

This PR fixes a segfault for queries like

SELECT id FROM table WHERE id = 10

where the filters cover all the projected columns.

@eddyxu eddyxu added bug Something isn't working c++ C++ issues arrow Apache Arrow related issues labels Aug 18, 2022
@eddyxu eddyxu requested a review from changhiskhan August 18, 2022 20:33
@eddyxu eddyxu self-assigned this Aug 18, 2022
assert(values->num_rows() == batch->num_rows());
ARROW_ASSIGN_OR_RAISE(auto merged, lance::arrow::MergeRecordBatches(values, batch));
return merged;
if (scan_schema_->fields().empty()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

What happens if user passes in lance.scanner(ds, columns=[])? Will they get an empty table back or will an exception be raised?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we have not had the check, but I feel that it should not be a silent error, so it should raise an exception.

@changhiskhan
Copy link
Contributor

Assuming the tests pass

@eddyxu eddyxu merged commit a71b508 into main Aug 18, 2022
@eddyxu eddyxu deleted the lei/project_schema branch August 18, 2022 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrow Apache Arrow related issues bug Something isn't working c++ C++ issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants