| 1 | #include "duckdb/function/table_function.hpp" |
| 2 | |
| 3 | namespace duckdb { |
| 4 | |
| 5 | GlobalTableFunctionState::~GlobalTableFunctionState() { |
| 6 | } |
| 7 | |
| 8 | LocalTableFunctionState::~LocalTableFunctionState() { |
| 9 | } |
| 10 | |
| 11 | TableFunctionInfo::~TableFunctionInfo() { |
| 12 | } |
| 13 | |
| 14 | TableFunction::TableFunction(string name, vector<LogicalType> arguments, table_function_t function, |
| 15 | table_function_bind_t bind, table_function_init_global_t init_global, |
| 16 | table_function_init_local_t init_local) |
| 17 | : SimpleNamedParameterFunction(std::move(name), std::move(arguments)), bind(bind), bind_replace(nullptr), |
| 18 | init_global(init_global), init_local(init_local), function(function), in_out_function(nullptr), |
| 19 | in_out_function_final(nullptr), statistics(nullptr), dependency(nullptr), cardinality(nullptr), |
| 20 | pushdown_complex_filter(nullptr), to_string(nullptr), table_scan_progress(nullptr), get_batch_index(nullptr), |
| 21 | get_batch_info(nullptr), serialize(nullptr), deserialize(nullptr), projection_pushdown(false), |
| 22 | filter_pushdown(false), filter_prune(false) { |
| 23 | } |
| 24 | |
| 25 | TableFunction::TableFunction(const vector<LogicalType> &arguments, table_function_t function, |
| 26 | table_function_bind_t bind, table_function_init_global_t init_global, |
| 27 | table_function_init_local_t init_local) |
| 28 | : TableFunction(string(), arguments, function, bind, init_global, init_local) { |
| 29 | } |
| 30 | TableFunction::TableFunction() |
| 31 | : SimpleNamedParameterFunction("" , {}), bind(nullptr), bind_replace(nullptr), init_global(nullptr), |
| 32 | init_local(nullptr), function(nullptr), in_out_function(nullptr), statistics(nullptr), dependency(nullptr), |
| 33 | cardinality(nullptr), pushdown_complex_filter(nullptr), to_string(nullptr), table_scan_progress(nullptr), |
| 34 | get_batch_index(nullptr), get_batch_info(nullptr), serialize(nullptr), deserialize(nullptr), |
| 35 | projection_pushdown(false), filter_pushdown(false), filter_prune(false) { |
| 36 | } |
| 37 | |
| 38 | bool TableFunction::Equal(const TableFunction &rhs) const { |
| 39 | // number of types |
| 40 | if (this->arguments.size() != rhs.arguments.size()) { |
| 41 | return false; |
| 42 | } |
| 43 | // argument types |
| 44 | for (idx_t i = 0; i < this->arguments.size(); ++i) { |
| 45 | if (this->arguments[i] != rhs.arguments[i]) { |
| 46 | return false; |
| 47 | } |
| 48 | } |
| 49 | // varargs |
| 50 | if (this->varargs != rhs.varargs) { |
| 51 | return false; |
| 52 | } |
| 53 | |
| 54 | return true; // they are equal |
| 55 | } |
| 56 | |
| 57 | } // namespace duckdb |
| 58 | |