amol- commented on code in PR #13409: URL: https://github.com/apache/arrow/pull/13409#discussion_r913867548
########## cpp/src/arrow/compute/exec/options.cc: ########## @@ -49,17 +49,28 @@ std::string ToString(JoinType t) { } Result<std::shared_ptr<SourceNodeOptions>> SourceNodeOptions::FromTable( - const Table& table, arrow::internal::Executor* exc) { + const Table& table, arrow::internal::Executor* executor) { std::shared_ptr<RecordBatchReader> reader = std::make_shared<TableBatchReader>(table); - if (exc == nullptr) return Status::TypeError("No executor provided."); + if (executor == nullptr) return Status::TypeError("No executor provided."); // Map the RecordBatchReader to a SourceNode - ARROW_ASSIGN_OR_RAISE(auto batch_gen, MakeReaderGenerator(std::move(reader), exc)); + ARROW_ASSIGN_OR_RAISE(auto batch_gen, MakeReaderGenerator(std::move(reader), executor)); return std::shared_ptr<SourceNodeOptions>( new SourceNodeOptions(table.schema(), batch_gen)); } +Result<std::shared_ptr<SourceNodeOptions>> SourceNodeOptions::FromRecordBatchReader( + std::shared_ptr<RecordBatchReader> reader, std::shared_ptr<Schema> schema, + arrow::internal::Executor* executor) { + if (executor == nullptr) return Status::TypeError("No executor provided."); + + // Map the RecordBatchReader to a SourceNode + ARROW_ASSIGN_OR_RAISE(auto batch_gen, MakeReaderGenerator(std::move(reader), executor)); + + return std::shared_ptr<SourceNodeOptions>(new SourceNodeOptions(schema, batch_gen)); Review Comment: :+1: -- 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-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org