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

feat: support where clause #38

Merged
merged 2 commits into from Sep 29, 2021
Merged

feat: support where clause #38

merged 2 commits into from Sep 29, 2021

Conversation

wangrunji0408
Copy link
Member

This PR adds support for SQL where clause, including:

  • plan node and executor of filter.
  • binding and evaluation for unary operations.

For simplicity, the visibility field was removed from the DataChunk struct. Instead, we provide a filter method to generate new array(chunk) directly.

@wangrunji0408 wangrunji0408 added the enhancement New feature or request label Sep 29, 2021
Copy link
Member

@skyzh skyzh left a comment

Choose a reason for hiding this comment

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

Rest LGTM

pub fn array_at(&self, idx: usize) -> &ArrayImpl {
&self.arrays[idx]
}

pub fn filter(&self, visibility: impl Iterator<Item = bool> + Clone) -> Self {
Copy link
Member

Choose a reason for hiding this comment

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

It is a little bit weird to + Clone on Iterator. I'm in favor of using &[bool] or &Bitmap for visibility.

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually the input of visibility is a PrimitiveArray<bool>. We can't get &[bool] or &Bitmap without additional memory allocation(

@wangrunji0408 wangrunji0408 merged commit 1f1100c into main Sep 29, 2021
@wangrunji0408 wangrunji0408 deleted the wrj-filter branch September 29, 2021 14:36
@wangrunji0408 wangrunji0408 mentioned this pull request Oct 15, 2021
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants