MCPcopy Create free account
hub / github.com/LadybugDB/ladybug / planCopyTo

Method planCopyTo

src/planner/plan/plan_copy.cpp:126–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

124}
125
126LogicalPlan 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

Callers

nothing calls this directly

Calls 9

getRegularQueryMethod · 0.45
getColumnsMethod · 0.45
getStatementResultMethod · 0.45
push_backMethod · 0.45
toStringMethod · 0.45
getStatementTypeMethod · 0.45
copyMethod · 0.45
getBindDataMethod · 0.45
getExportFuncMethod · 0.45

Tested by

no test coverage detected