paleolimbot commented on code in PR #13541: URL: https://github.com/apache/arrow/pull/13541#discussion_r925888709
########## r/src/compute-exec.cpp: ########## @@ -125,6 +125,46 @@ std::shared_ptr<arrow::Schema> ExecNode_output_schema( return node->output_schema(); } +// [[arrow::export]] +std::string ExecPlan_ToString(const std::shared_ptr<compute::ExecPlan>& plan) { + return plan->ToString(); +} + +// [[arrow::export]] +std::string ExecPlan_ToStringWithSink( + const std::shared_ptr<compute::ExecPlan>& plan, + const std::shared_ptr<compute::ExecNode>& final_node, cpp11::list sort_options, + int64_t head = -1) { Review Comment: I think it would have to be a `std::pair<ExecPlain, RecordBatchReader>` like in the UDFs PR, but I also think that this was a rabbit hole that I shouldn't have led you down...the simpler solution is to add a `ExecPlan_ToString()` method like you had before and just call it after `ExecPlan_run()`. The downside of that is that you will end up calling `plan->StartProducing()` when you don't actually intend to consume any batches from the output. Perhaps a good way to get this work merged sooner rather than later would be to mark that as a follow-up (explain query without starting to produce). -- 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