| 124 | } |
| 125 | |
| 126 | LogicalPlan Planner::planCopyTo(const BoundStatement& statement) { |
| 127 | auto& boundCopyTo = statement.constCast<BoundCopyTo>(); |
| 128 | auto regularQuery = boundCopyTo.getRegularQuery(); |
| 129 | std::vector<std::string> columnNames; |
| 130 | for (auto& column : regularQuery->getStatementResult()->getColumns()) { |
| 131 | columnNames.push_back(column->toString()); |
| 132 | } |
| 133 | DASSERT(regularQuery->getStatementType() == StatementType::QUERY); |
| 134 | auto plan = planStatement(*regularQuery); |
| 135 | auto copyTo = make_shared<LogicalCopyTo>(boundCopyTo.getBindData()->copy(), |
| 136 | boundCopyTo.getExportFunc(), plan.getLastOperator()); |
| 137 | plan.setLastOperator(std::move(copyTo)); |
| 138 | return plan; |
| 139 | } |
| 140 | |
| 141 | } // namespace planner |
| 142 | } // namespace lbug |
nothing calls this directly
no test coverage detected