1//===----------------------------------------------------------------------===//
2// DuckDB
3//
4// duckdb/planner/operator/logical_copy_from_file.hpp
5//
6//
7//===----------------------------------------------------------------------===//
8
9#pragma once
10
11#include "duckdb/parser/parsed_data/copy_info.hpp"
12#include "duckdb/planner/logical_operator.hpp"
13
14namespace duckdb {
15
16class LogicalCopyFromFile : public LogicalOperator {
17public:
18 LogicalCopyFromFile(idx_t table_index, unique_ptr<CopyInfo> info, vector<SQLType> sql_types)
19 : LogicalOperator(LogicalOperatorType::COPY_FROM_FILE), table_index(table_index), info(move(info)),
20 sql_types(sql_types) {
21 }
22
23 idx_t table_index;
24 unique_ptr<CopyInfo> info;
25 vector<SQLType> sql_types;
26
27public:
28 vector<ColumnBinding> GetColumnBindings() override {
29 return GenerateColumnBindings(table_index, sql_types.size());
30 }
31
32protected:
33 void ResolveTypes() override {
34 for (auto &type : sql_types) {
35 types.push_back(GetInternalType(type));
36 }
37 }
38};
39} // namespace duckdb
40