-
Notifications
You must be signed in to change notification settings - Fork 4k
GH-33760: [R][C++] Handle nested field refs in scanner #33770
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -742,6 +742,7 @@ test_that("Can use nested field refs", { | |
| ) | ||
|
|
||
| # Now with Dataset: make sure column pushdown in ScanNode works | ||
| skip_if_not_available("dataset") | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in #33778 already!
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Great, thanks, I'll rebase and remove this. |
||
| expect_equal( | ||
| nested_data %>% | ||
| InMemoryDataset$create() %>% | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used a set here because my R test failed because it was generating duplicated fields in the schema--the projection expression included the nested field in two different places. Maybe
->argumentsdoes deduplication so this wasn't a problem with non-nested refs. But IDK if this is the right choice, if someone cares about order that gets lost, or if there's a better way. What do you think @westonpace ? (I didn't run the C++ tests yet so maybe there are order-dependent tests that fail.)Also, this function seems like a natural place to use
FieldsInExpression(from expression.cc)--is there a reason it wasn't used here? It wouldn't solve the duplication issue because you could still have two nested field refs pointing to different fields within the same top-level struct, but it would let you assume that everything you're iterating over is a FieldRef.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We very much care about order here :). Fortunately,
std::setis an ordered set so the order should not be lost.