| 43 | namespace engine { |
| 44 | |
| 45 | Result<std::shared_ptr<RecordBatchReader>> ExecuteSerializedPlan( |
| 46 | const Buffer& substrait_buffer, const ExtensionIdRegistry* registry, |
| 47 | compute::FunctionRegistry* func_registry, const ConversionOptions& conversion_options, |
| 48 | bool use_threads, MemoryPool* memory_pool) { |
| 49 | ARROW_ASSIGN_OR_RAISE(PlanInfo plan_info, |
| 50 | DeserializePlan(substrait_buffer, registry, |
| 51 | /*ext_set_out=*/nullptr, conversion_options)); |
| 52 | acero::QueryOptions query_options; |
| 53 | query_options.memory_pool = memory_pool; |
| 54 | query_options.function_registry = func_registry; |
| 55 | query_options.use_threads = use_threads; |
| 56 | query_options.field_names = plan_info.names; |
| 57 | return acero::DeclarationToReader(std::move(plan_info.root.declaration), |
| 58 | std::move(query_options)); |
| 59 | } |
| 60 | |
| 61 | Result<std::shared_ptr<Buffer>> SerializeJsonPlan(const std::string& substrait_json) { |
| 62 | return engine::internal::SubstraitFromJSON("Plan", substrait_json); |