| 203 | } |
| 204 | |
| 205 | BoundTableScanInfo bindTableScanSourceInfo(Binder& binder, TableFunction func, |
| 206 | const std::string& sourceName, std::unique_ptr<TableFuncBindData> bindData, |
| 207 | const std::vector<std::string>& columnNames, const std::vector<LogicalType>& columnTypes) { |
| 208 | expression_vector columns; |
| 209 | if (!columnTypes.empty()) { |
| 210 | if (bindData->getNumColumns() != columnTypes.size()) { |
| 211 | throw BinderException(std::format("{} has {} columns but {} columns were expected.", |
| 212 | sourceName, bindData->getNumColumns(), columnTypes.size())); |
| 213 | } |
| 214 | for (auto i = 0u; i < bindData->getNumColumns(); ++i) { |
| 215 | auto column = |
| 216 | binder.createInvisibleVariable(columnNames[i], bindData->columns[i]->getDataType()); |
| 217 | binder.replaceExpressionInScope(bindData->columns[i]->toString(), columnNames[i], |
| 218 | column); |
| 219 | columns.push_back(column); |
| 220 | } |
| 221 | bindData->columns = columns; |
| 222 | } |
| 223 | return BoundTableScanInfo(func, std::move(bindData)); |
| 224 | } |
| 225 | |
| 226 | std::unique_ptr<BoundBaseScanSource> Binder::bindParameterScanSource( |
| 227 | const BaseScanSource& scanSource, const options_t& options, |
no test coverage detected