| 87 | } |
| 88 | |
| 89 | std::unique_ptr<PhysicalOperator> TableFunction::getPhysicalPlan(PlanMapper* planMapper, |
| 90 | const LogicalOperator* logicalOp) { |
| 91 | std::vector<DataPos> outPosV; |
| 92 | auto& call = logicalOp->constCast<LogicalTableFunctionCall>(); |
| 93 | auto outSchema = call.getSchema(); |
| 94 | for (auto& expr : call.getBindData()->columns) { |
| 95 | outPosV.emplace_back(planMapper->getDataPos(*expr, *outSchema)); |
| 96 | } |
| 97 | auto info = TableFunctionCallInfo(); |
| 98 | info.function = call.getTableFunc(); |
| 99 | info.bindData = call.getBindData()->copy(); |
| 100 | info.outPosV = outPosV; |
| 101 | auto initInput = |
| 102 | TableFuncInitSharedStateInput(info.bindData.get(), planMapper->executionContext); |
| 103 | auto sharedState = info.function.initSharedStateFunc(initInput); |
| 104 | // Filter columns for print info based on column skips |
| 105 | binder::expression_vector printExprs; |
| 106 | auto columnSkips = call.getBindData()->getColumnSkips(); |
| 107 | for (auto i = 0u; i < call.getBindData()->columns.size(); ++i) { |
| 108 | if (columnSkips.empty() || !columnSkips[i]) { |
| 109 | printExprs.push_back(call.getBindData()->columns[i]); |
| 110 | } |
| 111 | } |
| 112 | auto desc = call.getBindData()->getDescription(); |
| 113 | auto printInfo = std::make_unique<TableFunctionCallPrintInfo>( |
| 114 | desc.empty() ? call.getTableFunc().name : desc, printExprs); |
| 115 | return std::make_unique<TableFunctionCall>(std::move(info), sharedState, |
| 116 | planMapper->getOperatorID(), std::move(printInfo)); |
| 117 | } |
| 118 | |
| 119 | offset_t TableFunction::emptyTableFunc(const TableFuncInput&, TableFuncOutput&) { |
| 120 | // DO NOTHING. |
nothing calls this directly
no test coverage detected