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

Preserve decoded arrays from filtering #24

Closed
wants to merge 1 commit into from

Conversation

thinkharderdev
Copy link

For kicks I took a crack at what preserving the decoded arrays might look like and this is what I came up with

Some(selection) => selection.and(&raw),
None => raw,
})
let batch = RecordBatch::concat(&schema, &batches)?;
Copy link
Owner

@tustvold tustvold Aug 6, 2022

Choose a reason for hiding this comment

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

If you have a not very selective predicate, won't this massively balloon your memory consumption? As you will effectively hydrate the entire projected row group into a RecordBatch?

Edit: Perhaps that is fine, and we could just have a caveat that the entire projected row group must fit into memory for pushed down predicates. DataFusion could then make a judgement call based on the size of the column chunks 🤔

Edit Edit: We could even push this into the parquet reader

Copy link
Author

Choose a reason for hiding this comment

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

Not sure I follow. What would get pushed into the parquet reader?

Copy link
Owner

Choose a reason for hiding this comment

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

If we've buffered too much in memory, which is highly likely with any non-selective predicate, the parquet reader could drop the buffer, and fall back to decoding it again

Copy link
Author

Choose a reason for hiding this comment

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

If we've buffered too much in memory, which is highly likely with any non-selective predicate, the parquet reader could drop the buffer, and fall back to decoding it again

Ah, yeah that makes sense

@tustvold tustvold closed this Sep 26, 2022
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