| 743 | } // namespace |
| 744 | |
| 745 | Result<std::string> DeclarationToString(const Declaration& declaration, |
| 746 | FunctionRegistry* function_registry) { |
| 747 | // We pass in the default memory pool and the CPU executor but nothing we are doing |
| 748 | // should be starting new thread tasks or making large allocations. |
| 749 | ExecContext exec_context(default_memory_pool(), ::arrow::internal::GetCpuThreadPool(), |
| 750 | function_registry); |
| 751 | ARROW_ASSIGN_OR_RAISE(std::shared_ptr<ExecPlan> exec_plan, |
| 752 | ExecPlan::Make(exec_context)); |
| 753 | ARROW_ASSIGN_OR_RAISE(ExecNode * last_node, declaration.AddToPlan(exec_plan.get())); |
| 754 | ARROW_ASSIGN_OR_RAISE(last_node, EnsureSink(last_node, exec_plan.get())); |
| 755 | ARROW_RETURN_NOT_OK(exec_plan->Validate()); |
| 756 | return exec_plan->ToString(); |
| 757 | } |
| 758 | |
| 759 | Future<std::shared_ptr<Table>> DeclarationToTableAsync(Declaration declaration, |
| 760 | ExecContext exec_context) { |