jonkeane commented on a change in pull request #12769:
URL: https://github.com/apache/arrow/pull/12769#discussion_r840674052



##########
File path: r/src/tpch-gen.cpp
##########
@@ -0,0 +1,167 @@
+// 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 "./arrow_types.h"
+
+#if defined(ARROW_R_WITH_ARROW)
+
+#include <arrow/compute/api.h>
+#include <arrow/compute/exec/exec_plan.h>
+#include <arrow/compute/exec/tpch_node.h>
+#if defined(ARROW_R_WITH_DATASET)
+#include <arrow/dataset/api.h>
+#include <arrow/dataset/plan.h>
+#include <arrow/filesystem/filesystem.h>
+#include <arrow/filesystem/localfs.h>
+
+namespace compute = ::arrow::compute;
+namespace ds = ::arrow::dataset;
+namespace fs = ::arrow::fs;
+
+static std::shared_ptr<compute::ExecNode> MakeExecNodeOrStop(
+    const std::string& factory_name, compute::ExecPlan* plan,
+    std::vector<compute::ExecNode*> inputs, const compute::ExecNodeOptions& 
options) {
+  return std::shared_ptr<compute::ExecNode>(
+      ValueOrStop(compute::MakeExecNode(factory_name, plan, std::move(inputs), 
options)),
+      [](...) {
+        // empty destructor: ExecNode lifetime is managed by an ExecPlan
+      });
+}

Review comment:
       I basically copied this over from `r/src/compute-exec.cpp` which isn't 
the right thing to do here. I tried adding it to a header but then it 
complained about a duplicate symbol in this file and copmute-exec What's the 
appropriate way to share a function like this across two cpp files?
   
   Or I could put all of this into `r/src/compute-exec.cpp` and just gate the 
includes (since that file doesn't need to require all of the datasets and 
filesystem stuff to do most of its job?




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to