westonpace commented on code in PR #13069: URL: https://github.com/apache/arrow/pull/13069#discussion_r867035845
########## cpp/src/arrow/compute/exec/options.h: ########## @@ -232,10 +232,13 @@ class ARROW_EXPORT SinkNodeConsumer { /// \brief Add a sink node which consumes data within the exec plan run class ARROW_EXPORT ConsumingSinkNodeOptions : public ExecNodeOptions { public: - explicit ConsumingSinkNodeOptions(std::shared_ptr<SinkNodeConsumer> consumer) - : consumer(std::move(consumer)) {} + explicit ConsumingSinkNodeOptions(std::shared_ptr<SinkNodeConsumer> consumer, + std::vector<std::string> names = {}) + : consumer(std::move(consumer)), names(std::move(names)) {} std::shared_ptr<SinkNodeConsumer> consumer; + /// \brief Names to rename the sink's schema fields to Review Comment: ```suggestion /// \brief Names to rename the sink's schema fields to /// /// If specified then names must be provided for all fields ``` ########## cpp/src/arrow/engine/substrait/serde.cc: ########## @@ -67,15 +67,19 @@ Result<std::vector<compute::Declaration>> DeserializePlan( std::vector<compute::Declaration> sink_decls; for (const substrait::PlanRel& plan_rel : plan.relations()) { + ARROW_ASSIGN_OR_RAISE( + auto decl, + FromProto(plan_rel.has_root() ? plan_rel.root().input() : plan_rel.rel(), + ext_set)); + std::vector<std::string> names; if (plan_rel.has_root()) { - return Status::NotImplemented("substrait::PlanRel with custom output field names"); + names.assign(plan_rel.root().names().begin(), plan_rel.root().names().end()); } - ARROW_ASSIGN_OR_RAISE(auto decl, FromProto(plan_rel.rel(), ext_set)); // pipe each relation into a consuming_sink node auto sink_decl = compute::Declaration::Sequence({ std::move(decl), - {"consuming_sink", compute::ConsumingSinkNodeOptions{consumer_factory()}}, + {"consuming_sink", compute::ConsumingSinkNodeOptions{consumer_factory(), names}}, Review Comment: ```suggestion {"consuming_sink", compute::ConsumingSinkNodeOptions{consumer_factory(), std::move(names)}}, ``` -- 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