Skip to content

ARROW-15271: [R] Refactor do_exec_plan to return a RecordBatchReader - #13170

Closed
nealrichardson wants to merge 5 commits into
apache:masterfrom
nealrichardson:exec-to-rbr
Closed

ARROW-15271: [R] Refactor do_exec_plan to return a RecordBatchReader#13170
nealrichardson wants to merge 5 commits into
apache:masterfrom
nealrichardson:exec-to-rbr

Conversation

@nealrichardson

@nealrichardsonnealrichardson commented May 16, 2022

Copy link
Copy Markdown
Member

Ticket title is misleading: this PR actually removes do_exec_plan(). plan$Run() now always returns a RBR; the two cases where Tables are used to post-process ExecPlan results are encapsulated in Run() now.

There is one catch that still needs addressing, but I'll make another jira for it: you can provide schema metadata to the WriteNode but not the other SinkNodes, so anything that preserves R metadata needs to handle that separately because Run() will drop it. This seems to be a limitation of the C++ library.(edit: I see where I can inject this in compute::MakeGeneratorReader in the thing that consumes the sink node, I had made a note about that on the JIRA previously. I still will take this up in ARROW-16607.)

One other change here: map_batches() now returns a RBR and requires that the function it maps returns something that is coercible to a RecordBatch.

@github-actions

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

⚠️ Ticket has not been started in JIRA, please click 'Start Progress'.

@paleolimbotpaleolimbot left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is awesome! I took a look through for anything that seemed asmiss and didn't find anything.

Comment threadr/R/record-batch-reader.R Outdated
Comment threadr/R/dplyr-collect.R Outdated

@wjones127wjones127 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This looks good, I think the change to forcing the map_batches() lambda return a RecordBatch simplifies the API nicely, so I'm in favor of that.

I just had one question on use of ADQ vs RBR.

Comment threadr/R/dataset-scan.R Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

+1 that would be nice.

Comment threadr/R/dataset-scan.R Outdated
Comment threadr/R/record-batch-reader.R Outdated
Comment threadr/R/duckdb.R
} else {
duckdb::duckdb_fetch_record_batch(res)
}
duckdb::duckdb_fetch_record_batch(res)

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

@jonkeane FYI. See also #11730 (comment) for historical context

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm glad we can get this cleaned up 🎉

@nealrichardson
nealrichardson deleted the exec-to-rbr branch May 18, 2022 23:27
@ursabot

Copy link
Copy Markdown

Benchmark runs are scheduled for baseline = 663dc32 and contender = dc39f83. dc39f83 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Finished ⬇️0.0% ⬆️0.0%] ec2-t3-xlarge-us-east-2
[Failed ⬇️11.53% ⬆️0.0%] test-mac-arm
[Failed ⬇️0.37% ⬆️0.37%] ursa-i9-9960x
[Finished ⬇️0.32% ⬆️0.0%] ursa-thinkcentre-m75q
Buildkite builds:
[Finished] dc39f83e ec2-t3-xlarge-us-east-2
[Failed] dc39f83e test-mac-arm
[Failed] dc39f83e ursa-i9-9960x
[Finished] dc39f83e ursa-thinkcentre-m75q
[Finished] 663dc325 ec2-t3-xlarge-us-east-2
[Failed] 663dc325 test-mac-arm
[Failed] 663dc325 ursa-i9-9960x
[Finished] 663dc325 ursa-thinkcentre-m75q
Supported benchmarks:
ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
test-mac-arm: Supported benchmark langs: C++, Python, R
ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java

@ursabot

Copy link
Copy Markdown

['Python', 'R'] benchmarks have high level of regressions.
ursa-i9-9960x

kou pushed a commit that referenced this pull request Feb 20, 2023
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@nealrichardson@ursabot@jonkeane@wjones127@paleolimbot