You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "mapleFU (via GitHub)" <gi...@apache.org> on 2023/05/06 10:35:46 UTC

[GitHub] [arrow] mapleFU opened a new pull request, #35464: GH-35125: [C++][Acero] Add a self-defined io-executor in QueryOptions

mapleFU opened a new pull request, #35464:
URL: https://github.com/apache/arrow/pull/35464

   <!--
   Thanks for opening a pull request!
   If this is your first pull request you can find detailed information on how 
   to contribute here:
     * [New Contributor's Guide](https://arrow.apache.org/docs/dev/developers/guide/step_by_step/pr_lifecycle.html#reviews-and-merge-of-the-pull-request)
     * [Contributing Overview](https://arrow.apache.org/docs/dev/developers/overview.html)
   
   
   If this is not a [minor PR](https://github.com/apache/arrow/blob/main/CONTRIBUTING.md#Minor-Fixes). Could you open an issue for this pull request on GitHub? https://github.com/apache/arrow/issues/new/choose
   
   Opening GitHub issues ahead of time contributes to the [Openness](http://theapacheway.com/open/#:~:text=Openness%20allows%20new%20users%20the,must%20happen%20in%20the%20open.) of the Apache Arrow project.
   
   Then could you also rename the pull request title in the following format?
   
       GH-${GITHUB_ISSUE_ID}: [${COMPONENT}] ${SUMMARY}
   
   or
   
       MINOR: [${COMPONENT}] ${SUMMARY}
   
   In the case of PARQUET issues on JIRA the title also supports:
   
       PARQUET-${JIRA_ISSUE_ID}: [${COMPONENT}] ${SUMMARY}
   
   -->
   
   ### Rationale for this change
   
   <!--
    Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
    Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.  
   -->
   
   Support a custom io-executor in Acero QueryOptions.
   
   ### What changes are included in this PR?
   
   <!--
   There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
   -->
   
   Allow user to define a customed io-executor.
   
   ### Are these changes tested?
   
   <!--
   We typically require tests for all PRs in order to:
   1. Prevent the code from being accidentally broken by subsequent changes
   2. Serve as another way to document the expected behavior of the code
   
   If tests are not included in your PR, please explain why (for example, are they covered by existing tests)?
   -->
   
   Currently not
   
   ### Are there any user-facing changes?
   
   User can specify an io-executor
   
   <!--
   If there are user-facing changes then we may require documentation to be updated before approving the PR.
   -->
   
   <!--
   If there are any breaking changes to public APIs, please uncomment the line below and explain which changes are breaking.
   -->
   <!-- **This PR includes breaking changes to public APIs.** -->
   
   <!--
   Please uncomment the line below (and provide explanation) if the changes fix either (a) a security vulnerability, (b) a bug that caused incorrect or invalid data to be produced, or (c) a bug that causes a crash (even when the API contract is upheld). We use this to highlight fixes to issues that may affect users without their knowledge. For this reason, fixing bugs that cause errors don't count, since those are usually obvious.
   -->
   <!-- **This PR contains a "Critical Fix".** -->


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] pitrou commented on a diff in pull request #35464: GH-35125: [C++][Acero] Add a self-defined io-executor in QueryOptions

Posted by "pitrou (via GitHub)" <gi...@apache.org>.
pitrou commented on code in PR #35464:
URL: https://github.com/apache/arrow/pull/35464#discussion_r1188883409


##########
cpp/src/arrow/acero/query_context.cc:
##########
@@ -23,10 +23,17 @@ namespace arrow {
 using arrow::internal::CpuInfo;
 namespace acero {
 
+io::IOContext getIoContext(QueryOptions& opts, ExecContext& exec_context) {

Review Comment:
   Several things:
   1) Please make this `static` or put this into the anonymous namespace, to minimize the exported symbols 
   2) Please avoid non-const references: you can pass `const QueryOptions&` and `const ExecContext&`
   3) Naming should be CamelCase
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] mapleFU commented on pull request #35464: GH-35125: [C++][Acero] Add a self-defined io-executor in QueryOptions

Posted by "mapleFU (via GitHub)" <gi...@apache.org>.
mapleFU commented on PR #35464:
URL: https://github.com/apache/arrow/pull/35464#issuecomment-1543373838

   Got it, thanks! I'm a bit busy these days, I'll finish it and testing this weekend.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] github-actions[bot] commented on pull request #35464: GH-35125: [C++][Acero] Add a self-defined io-executor in QueryOptions

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #35464:
URL: https://github.com/apache/arrow/pull/35464#issuecomment-1537112722

   * Closes: #35125


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] mapleFU commented on pull request #35464: GH-35125: [C++][Acero] Add a self-defined io-executor in QueryOptions

Posted by "mapleFU (via GitHub)" <gi...@apache.org>.
mapleFU commented on PR #35464:
URL: https://github.com/apache/arrow/pull/35464#issuecomment-1557484605

   @westonpace comment fixed, mind take a look?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] ursabot commented on pull request #35464: GH-35125: [C++][Acero] Add a self-defined io-executor in QueryOptions

Posted by "ursabot (via GitHub)" <gi...@apache.org>.
ursabot commented on PR #35464:
URL: https://github.com/apache/arrow/pull/35464#issuecomment-1570001370

   ['Python', 'R'] benchmarks have high level of regressions.
   [ursa-i9-9960x](https://conbench.ursa.dev/compare/runs/be1c653741ec4196b6d639957b0473fe...42a90b8f67fd4bf7aaa1f7728afaa5ca/)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] westonpace commented on a diff in pull request #35464: GH-35125: [C++][Acero] Add a self-defined io-executor in QueryOptions

Posted by "westonpace (via GitHub)" <gi...@apache.org>.
westonpace commented on code in PR #35464:
URL: https://github.com/apache/arrow/pull/35464#discussion_r1201100481


##########
cpp/src/arrow/acero/query_context.cc:
##########
@@ -23,10 +23,19 @@ namespace arrow {
 using arrow::internal::CpuInfo;
 namespace acero {
 
+namespace {
+io::IOContext GetIoContext(QueryOptions& opts, const ExecContext& exec_context) {

Review Comment:
   ```suggestion
   io::IOContext GetIoContext(const QueryOptions& opts, const ExecContext& exec_context) {
   ```
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] mapleFU commented on a diff in pull request #35464: GH-35125: [C++][Acero] Add a self-defined io-executor in QueryOptions

Posted by "mapleFU (via GitHub)" <gi...@apache.org>.
mapleFU commented on code in PR #35464:
URL: https://github.com/apache/arrow/pull/35464#discussion_r1201436576


##########
cpp/src/arrow/acero/query_context.cc:
##########
@@ -23,10 +23,19 @@ namespace arrow {
 using arrow::internal::CpuInfo;
 namespace acero {
 
+namespace {
+io::IOContext GetIoContext(QueryOptions& opts, const ExecContext& exec_context) {

Review Comment:
   I think exec_context can be make as constant, but custom_io_executor should be non-const, so QueryOptions cannot have const. Should I use `mutable` for `io::Executor custom_io_executor` or some other methods?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] mapleFU commented on pull request #35464: GH-35125: [C++][Acero] Add a self-defined io-executor in QueryOptions

Posted by "mapleFU (via GitHub)" <gi...@apache.org>.
mapleFU commented on PR #35464:
URL: https://github.com/apache/arrow/pull/35464#issuecomment-1537112786

   ```c++
   Result<std::shared_ptr<Table>> DeclarationToTable(Declaration declaration,
                                                     QueryOptions query_options) {
     if (query_options.custom_cpu_executor != nullptr) {
       return Status::Invalid("Cannot use synchronous methods with a custom CPU executor");
     }
   ```
   
   By the way, should I notice and add io-executor here? @westonpace 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] westonpace merged pull request #35464: GH-35125: [C++][Acero] Add a self-defined io-executor in QueryOptions

Posted by "westonpace (via GitHub)" <gi...@apache.org>.
westonpace merged PR #35464:
URL: https://github.com/apache/arrow/pull/35464


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] mapleFU commented on a diff in pull request #35464: GH-35125: [C++][Acero] Add a self-defined io-executor in QueryOptions

Posted by "mapleFU (via GitHub)" <gi...@apache.org>.
mapleFU commented on code in PR #35464:
URL: https://github.com/apache/arrow/pull/35464#discussion_r1198564484


##########
cpp/src/arrow/acero/query_context.cc:
##########
@@ -23,10 +23,17 @@ namespace arrow {
 using arrow::internal::CpuInfo;
 namespace acero {
 
+io::IOContext getIoContext(QueryOptions& opts, ExecContext& exec_context) {

Review Comment:
   I think `exec_context` can be make as constant, but `custom_io_executor` should be non-const, so `QueryOptions` cannot have `const`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] github-actions[bot] commented on pull request #35464: GH-35125: [C++][Acero] Add a self-defined io-executor in QueryOptions

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #35464:
URL: https://github.com/apache/arrow/pull/35464#issuecomment-1537112730

   :warning: GitHub issue #35125 **has been automatically assigned in GitHub** to PR creator.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] westonpace commented on pull request #35464: GH-35125: [C++][Acero] Add a self-defined io-executor in QueryOptions

Posted by "westonpace (via GitHub)" <gi...@apache.org>.
westonpace commented on PR #35464:
URL: https://github.com/apache/arrow/pull/35464#issuecomment-1542544611

   > By the way, should I notice and add io-executor here? @westonpace
   
   No, that's ok.  In a synchronous context we need to specify the CPU executor (because we are going to use a serial executor).  However, it is ok if there is a custom IO executor.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] mapleFU commented on pull request #35464: GH-35125: [C++][Acero] Add a self-defined io-executor in QueryOptions

Posted by "mapleFU (via GitHub)" <gi...@apache.org>.
mapleFU commented on PR #35464:
URL: https://github.com/apache/arrow/pull/35464#issuecomment-1559569582

   @westonpace I've fixed the comments :-)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] ursabot commented on pull request #35464: GH-35125: [C++][Acero] Add a self-defined io-executor in QueryOptions

Posted by "ursabot (via GitHub)" <gi...@apache.org>.
ursabot commented on PR #35464:
URL: https://github.com/apache/arrow/pull/35464#issuecomment-1569301291

   Benchmark runs are scheduled for baseline = 6d2df074e624a6a4462a1539be8dadf19cf39df4 and contender = 6bd31f37ae66bd35594b077cb2f830be57e08acd. 6bd31f37ae66bd35594b077cb2f830be57e08acd is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
   Conbench compare runs links:
   [Finished :arrow_down:0.0% :arrow_up:0.0%] [ec2-t3-xlarge-us-east-2](https://conbench.ursa.dev/compare/runs/6b6b14deeb7f40778466a8657b02fad7...b47e55bc5cf14b8eb49dbb40bb32e37c/)
   [Failed] [test-mac-arm](https://conbench.ursa.dev/compare/runs/73f8925ff44f4d4294708a02c9a935ce...334d43221e3d463b97fb2dcff7ab9162/)
   [Failed :arrow_down:6.43% :arrow_up:0.0%] [ursa-i9-9960x](https://conbench.ursa.dev/compare/runs/be1c653741ec4196b6d639957b0473fe...42a90b8f67fd4bf7aaa1f7728afaa5ca/)
   [Failed :arrow_down:0.03% :arrow_up:0.0%] [ursa-thinkcentre-m75q](https://conbench.ursa.dev/compare/runs/58a2528e7e6c4b7ab0cb916380988191...e2d4098e45314242b5ae15e7133f6ece/)
   Buildkite builds:
   [Finished] [`6bd31f37` ec2-t3-xlarge-us-east-2](https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-ec2-t3-xlarge-us-east-2/builds/2933)
   [Failed] [`6bd31f37` test-mac-arm](https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-test-mac-arm/builds/2969)
   [Failed] [`6bd31f37` ursa-i9-9960x](https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-ursa-i9-9960x/builds/2934)
   [Failed] [`6bd31f37` ursa-thinkcentre-m75q](https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-ursa-thinkcentre-m75q/builds/2959)
   [Finished] [`6d2df074` ec2-t3-xlarge-us-east-2](https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-ec2-t3-xlarge-us-east-2/builds/2932)
   [Failed] [`6d2df074` test-mac-arm](https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-test-mac-arm/builds/2968)
   [Failed] [`6d2df074` ursa-i9-9960x](https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-ursa-i9-9960x/builds/2933)
   [Finished] [`6d2df074` ursa-thinkcentre-m75q](https://buildkite.com/apache-arrow/arrow-bci-benchmark-on-ursa-thinkcentre-m75q/builds/2958)
   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
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org