Uh oh!
There was an error while loading. Please reload this page.
Support pushdown multi-columns in PageIndex pruning. - #3967
Conversation
| offset_indexes: &'a Vec<Vec<PageLocation>>, | ||
| parquet_schema: &'a Schema, | ||
| col_id: usize, | ||
| col_page_indexes: &'a Index, |
There was a problem hiding this comment.
simplify the PagesPruningStatistics no need pass all cols index!
| // | ||
| // returned: NNNNNNNNY | ||
| // set `need_combine` true will combine result: Select(2) + Select(1) + Skip(2) -> Select(3) + Skip(2) | ||
| pub(crate) fn intersect_row_selection( |
Signed-off-by: yangjiang <yangjiang@ebay.com>
| debug!("Error evaluating page index predicate values {}", e); | ||
| error!("Error evaluating page index predicate values {}", e); | ||
| metrics.predicate_evaluation_errors.add(1); | ||
| return Ok(vec![RowSelector::select(group.num_rows() as usize)]); |
There was a problem hiding this comment.
@alamb related to #4002 add one fallback, which select all rows.
got
❯ select count(*) from foo where container = 'backend_container_1';
[2022-10-29T15:51:31Z ERROR datafusion::physical_plan::file_format::parquet] Error evaluating page index predicate values Error during planning: Can not create statistics record batch: Invalid argument error: Column 'container_min' is declared as non-nullable but contains null values
+-----------------+
| COUNT(UInt8(1)) |
+-----------------+
| 15963 |
+-----------------+
1 row in set. Query took 0.035 seconds.
There was a problem hiding this comment.
cool! I hope to have #3976 ready for review later today -- with that additional testing coverage I will feel pretty good about this particular optimization 🎉
alamb
commented
Nov 1, 2022
Sorry @Ted-Jiang -- i will review this PR today |
alamb
commented
Nov 1, 2022
@Ted-Jiang - I took the liberty of merging up from master and fixing a merge conflict |
alamb
left a comment
There was a problem hiding this comment.
This looks great @Ted-Jiang 🦾 🏆 -- I think it can be merged as is.
I am impressed with the tests in this PR and I also verified that this optimization passes my parquet predicate torture integration test #4062 that found #4002
I have some follow up suggestions but I think we can do them as follow on PRs if you prefer
Other items to do:
- Add statistics to verify and report on the efficiency of page index pruning (I will file a follow on ticket)
- Add some more variations to the parquet predicate integration tests to ensure multiple pages are being used (will file a follow on ticket)
Uh oh!
There was an error while loading. Please reload this page.
| }), | ||
| ); | ||
| } else { | ||
| // fallback select all rows |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| } | ||
| } | ||
| _ => { | ||
| if a.row_count < b.row_count { |
There was a problem hiding this comment.
Shouldn't this be taking which one of a or b was skipped (rather than just the one that was smaller)? I tried messing around and trying to write some test that failed, but was not able to
There was a problem hiding this comment.
I think two element at least one is skip, we can sure about skip the min len is correct🤔
| // create filter (year = 2009 and id = 1) or (year = 2010) | ||
| // this filter use two columns will not push down | ||
| // todo but after use CNF rewrite it could rewrite to (year = 2009 or year = 2010) and (id = 1 or year = 2010) |
There was a problem hiding this comment.
Not sure about the CNF rewrite comment here
There was a problem hiding this comment.
Maybe we file a ticket do some tests.
There was a problem hiding this comment.
I am not sure what tests you have in mind here so I did not file a ticket -- perhaps you could add to one of the existing tickets (#4087 ?) or file a new one?
Ted-Jiang
commented
Nov 2, 2022
Thanks for the helping!😄
Agree! will try to familiar with the IT, support these✌️ |
Signed-off-by: yangjiang <yangjiang@ebay.com>
Signed-off-by: yangjiang <yangjiang@ebay.com>
alamb
commented
Nov 2, 2022
Looks good -- thanks @Ted-Jiang -- I'll merge this in and file some follow on tickets for the remaining items |
alamb
commented
Nov 2, 2022
I filed #4085 to track enabling this feature by default |
alamb
commented
Nov 2, 2022
Filed #4086 to track adding statistics |
alamb
commented
Nov 2, 2022
Filed #4087 for increasing test coverage |
ursabot
commented
Nov 2, 2022
Benchmark runs are scheduled for baseline = 065a478 and contender = 1a5f6ab. 1a5f6ab is a master commit associated with this PR. Results will be available as each benchmark for each run completes. |
* Support pushdown multi-columns in PageIndex pruning. Signed-off-by: yangjiang <yangjiang@ebay.com> * fix test Signed-off-by: yangjiang <yangjiang@ebay.com> * fix comments Signed-off-by: yangjiang <yangjiang@ebay.com> * avoid extract predicates when enable is false Signed-off-by: yangjiang <yangjiang@ebay.com> Signed-off-by: yangjiang <yangjiang@ebay.com> Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
Signed-off-by: yangjiang yangjiang@ebay.com
Which issue does this PR close?
Closes#3834.
Closes#4002
Rationale for this change
What changes are included in this PR?
Thanks the original pic from @alamb ❤️
Finally do the intersection get selector(200~244)
Are there any user-facing changes?