You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/03/09 01:54:58 UTC

[GitHub] [arrow] westonpace opened a new pull request #12586: Feature/arrow 15877 query testing tool

westonpace opened a new pull request #12586:
URL: https://github.com/apache/arrow/pull/12586


   This PR is based on #12537 and will need to remain in draft until that is merged.  In addition, I'd like to fit in a few more builtin queries in this initial PR.
   
   This PR creates a standalone query testing executable query_tester.
   
   The tool takes a number of command line options today:
   
   ```
   Usage: query_tester [options] query 
   
   Positional arguments:
   query            	name of the query to run [required]
   
   Optional arguments:
   -h --help        	shows help message and exits
   -v --version     	prints version information and exits
   --num-iterations 	[default: 1]
   --cpu-threads    	size to use for the CPU thread pool, default controlled by Arrow
   --io-threads     	size to use for the I/O thread pool, default controlled by Arrow
   --validate       	if set the program will validate the query results [default: false] (not yet implemented)
   ```
   
   The tool will first look for a Substrait query in the `queries` folder (there is an example of TPC-H Q1 in JSON format).  At the moment this isn't very useful as our Substrait support is very limited.
   
   The tool will then look for builtin queries, I'd like to add support for all of the TPC-H builtin queries.
   
   There is a `datasets` folder that is also created.  In the future I'd like to add support for downloading remote datasets to this folder.
   
   The current output simply prints a few statistics:
   
   ```
   (conbench3) pace@pace-desktop:~/dev/arrow/dev/qtester/debug-build$ ./query_tester tpch-1 --num-iterations 10
   Average       Duration: 1.19292s (+/- 0.00569406s)
   Average Output  Rows/S: 3.35311rps
   Average Output Bytes/S: 409.08bps
   ```
   
   Note that `Output Rows/S` and `Output Bytes/S` is not very useful for TPC-H queries (which aggregate most of their data so they have very little output for the amount of work done).  I've prototyped adding a much more exhaustive breakdown of time spent by intercepting OT events but I'd like to save that work for a future PR.


-- 
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 #12586: ARROW-15877: [C++] Add a C++ query testing tool

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #12586:
URL: https://github.com/apache/arrow/pull/12586#issuecomment-1062530608


   https://issues.apache.org/jira/browse/ARROW-15877


-- 
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 #12586: Feature/arrow 15877 query testing tool

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #12586:
URL: https://github.com/apache/arrow/pull/12586#issuecomment-1062474260


   <!--
     Licensed to the Apache Software Foundation (ASF) under one
     or more contributor license agreements.  See the NOTICE file
     distributed with this work for additional information
     regarding copyright ownership.  The ASF licenses this file
     to you under the Apache License, Version 2.0 (the
     "License"); you may not use this file except in compliance
     with the License.  You may obtain a copy of the License at
   
       http://www.apache.org/licenses/LICENSE-2.0
   
     Unless required by applicable law or agreed to in writing,
     software distributed under the License is distributed on an
     "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
     KIND, either express or implied.  See the License for the
     specific language governing permissions and limitations
     under the License.
   -->
   
   Thanks for opening a pull request!
   
   If this is not a [minor PR](https://github.com/apache/arrow/blob/master/CONTRIBUTING.md#Minor-Fixes). Could you open an issue for this pull request on JIRA? https://issues.apache.org/jira/browse/ARROW
   
   Opening JIRAs 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 pull request title in the following format?
   
       ARROW-${JIRA_ID}: [${COMPONENT}] ${SUMMARY}
   
   or
   
       MINOR: [${COMPONENT}] ${SUMMARY}
   
   See also:
   
     * [Other pull requests](https://github.com/apache/arrow/pulls/)
     * [Contribution Guidelines - How to contribute patches](https://arrow.apache.org/docs/developers/contributing.html#how-to-contribute-patches)
   


-- 
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 change in pull request #12586: ARROW-15877: [C++] Add a C++ query testing tool

Posted by GitBox <gi...@apache.org>.
westonpace commented on a change in pull request #12586:
URL: https://github.com/apache/arrow/pull/12586#discussion_r824048475



##########
File path: cpp/src/arrow/compute/exec/tpch_benchmark.cc
##########
@@ -0,0 +1,176 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#include "benchmark/benchmark.h"
+
+#include "arrow/testing/future_util.h"
+#include "arrow/compute/exec/test_util.h"
+#include "arrow/compute/exec/tpch_node.h"
+#include "arrow/util/make_unique.h"
+#include "arrow/compute/cast.h"
+
+namespace arrow
+{
+namespace compute
+{
+
+std::shared_ptr<ExecPlan> Plan_Q1(AsyncGenerator<util::optional<ExecBatch>> &sink_gen, int scale_factor)

Review comment:
       Yes, I created `tpch1()` by leveraging this.  Once the PR adding `tpch_benchmark.cc` merges I will update this PR to remove `tpch_benchmark.cc` in favor of this (or perhaps keep the benchmark but link to builtin queries).




-- 
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] joosthooz commented on a change in pull request #12586: ARROW-15877: [C++] Add a C++ query testing tool

Posted by GitBox <gi...@apache.org>.
joosthooz commented on a change in pull request #12586:
URL: https://github.com/apache/arrow/pull/12586#discussion_r823762111



##########
File path: cpp/src/arrow/compute/exec/tpch_benchmark.cc
##########
@@ -0,0 +1,176 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#include "benchmark/benchmark.h"
+
+#include "arrow/testing/future_util.h"
+#include "arrow/compute/exec/test_util.h"
+#include "arrow/compute/exec/tpch_node.h"
+#include "arrow/util/make_unique.h"
+#include "arrow/compute/cast.h"
+
+namespace arrow
+{
+namespace compute
+{
+
+std::shared_ptr<ExecPlan> Plan_Q1(AsyncGenerator<util::optional<ExecBatch>> &sink_gen, int scale_factor)

Review comment:
       This code is almost identical to `tpch1()` in `builtin_queries.cc`




-- 
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