Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-08-28 08:26:53

0001 // Licensed to the Apache Software Foundation (ASF) under one
0002 // or more contributor license agreements.  See the NOTICE file
0003 // distributed with this work for additional information
0004 // regarding copyright ownership.  The ASF licenses this file
0005 // to you under the Apache License, Version 2.0 (the
0006 // "License"); you may not use this file except in compliance
0007 // with the License.  You may obtain a copy of the License at
0008 //
0009 //   http://www.apache.org/licenses/LICENSE-2.0
0010 //
0011 // Unless required by applicable law or agreed to in writing,
0012 // software distributed under the License is distributed on an
0013 // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
0014 // KIND, either express or implied.  See the License for the
0015 // specific language governing permissions and limitations
0016 // under the License.
0017 
0018 #pragma once
0019 
0020 #include <memory>
0021 #include <optional>
0022 #include <string>
0023 #include <vector>
0024 
0025 #include "arrow/acero/type_fwd.h"
0026 #include "arrow/acero/visibility.h"
0027 #include "arrow/result.h"
0028 #include "arrow/status.h"
0029 
0030 namespace arrow {
0031 namespace acero {
0032 namespace internal {
0033 
0034 class ARROW_ACERO_EXPORT TpchGen {
0035  public:
0036   virtual ~TpchGen() = default;
0037 
0038   /*
0039    * \brief Create a factory for nodes that generate TPC-H data
0040    *
0041    * Note: Individual tables will reference each other.  It is important that you only
0042    * create a single TpchGen instance for each plan and then you can create nodes for each
0043    * table from that single TpchGen instance. Note: Every batch will be scheduled as a new
0044    * task using the ExecPlan's scheduler.
0045    */
0046   static Result<std::unique_ptr<TpchGen>> Make(
0047       ExecPlan* plan, double scale_factor = 1.0, int64_t batch_size = 4096,
0048       std::optional<int64_t> seed = std::nullopt);
0049 
0050   // The below methods will create and add an ExecNode to the plan that generates
0051   // data for the desired table. If columns is empty, all columns will be generated.
0052   // The methods return the added ExecNode, which should be used for inputs.
0053   virtual Result<ExecNode*> Supplier(std::vector<std::string> columns = {}) = 0;
0054   virtual Result<ExecNode*> Part(std::vector<std::string> columns = {}) = 0;
0055   virtual Result<ExecNode*> PartSupp(std::vector<std::string> columns = {}) = 0;
0056   virtual Result<ExecNode*> Customer(std::vector<std::string> columns = {}) = 0;
0057   virtual Result<ExecNode*> Orders(std::vector<std::string> columns = {}) = 0;
0058   virtual Result<ExecNode*> Lineitem(std::vector<std::string> columns = {}) = 0;
0059   virtual Result<ExecNode*> Nation(std::vector<std::string> columns = {}) = 0;
0060   virtual Result<ExecNode*> Region(std::vector<std::string> columns = {}) = 0;
0061 };
0062 
0063 }  // namespace internal
0064 }  // namespace acero
0065 }  // namespace arrow