vibhatha commented on a change in pull request #12267:
URL: https://github.com/apache/arrow/pull/12267#discussion_r806541037
##########
File path: cpp/src/arrow/compute/exec/source_node.cc
##########
@@ -174,12 +177,82 @@ struct SourceNode : ExecNode {
AsyncGenerator<util::optional<ExecBatch>> generator_;
};
+struct TableSourceNode : public SourceNode {
+ TableSourceNode(ExecPlan* plan, std::shared_ptr<Table> table, int64_t
batch_size)
+ : SourceNode(plan, table->schema(), TableGenerator(*table.get(),
batch_size)) {}
+
+ static Result<ExecNode*> Make(ExecPlan* plan, std::vector<ExecNode*> inputs,
+ const ExecNodeOptions& options) {
+ RETURN_NOT_OK(ValidateExecNodeInputs(plan, inputs, 0, "TableSourceNode"));
+ const auto& table_options = checked_cast<const
TableSourceNodeOptions&>(options);
+ const auto table = table_options.table;
+ const int64_t batch_size = table_options.batch_size;
+
+ RETURN_NOT_OK(ValidateTableSourceNodeInpute(table, batch_size,
"TableSourceNode"));
+
+ return plan->EmplaceNode<TableSourceNode>(plan, table, batch_size);
+ }
+
+ const char* kind_name() const override { return "TableSourceNode"; }
+
+ static arrow::Status ValidateTableSourceNodeInpute(const
std::shared_ptr<Table> table,
Review comment:
👍
--
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]