duckdb 0.7.2-dev1901.0 → 0.7.2-dev2233.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/binding.gyp +2 -0
- package/package.json +1 -1
- package/src/duckdb/extension/parquet/column_reader.cpp +3 -0
- package/src/duckdb/extension/parquet/include/parquet_writer.hpp +1 -1
- package/src/duckdb/extension/parquet/parquet_metadata.cpp +4 -2
- package/src/duckdb/src/catalog/catalog_entry/duck_index_entry.cpp +1 -1
- package/src/duckdb/src/common/arrow/arrow_appender.cpp +69 -44
- package/src/duckdb/src/common/arrow/arrow_converter.cpp +1 -1
- package/src/duckdb/src/common/arrow/arrow_wrapper.cpp +20 -2
- package/src/duckdb/src/common/box_renderer.cpp +4 -2
- package/src/duckdb/src/common/constants.cpp +10 -1
- package/src/duckdb/src/common/filename_pattern.cpp +41 -0
- package/src/duckdb/src/common/hive_partitioning.cpp +144 -15
- package/src/duckdb/src/common/radix_partitioning.cpp +101 -369
- package/src/duckdb/src/common/row_operations/row_aggregate.cpp +8 -9
- package/src/duckdb/src/common/row_operations/row_external.cpp +1 -1
- package/src/duckdb/src/common/row_operations/row_gather.cpp +5 -3
- package/src/duckdb/src/common/row_operations/row_match.cpp +117 -22
- package/src/duckdb/src/common/row_operations/row_scatter.cpp +2 -2
- package/src/duckdb/src/common/sort/partition_state.cpp +1 -1
- package/src/duckdb/src/common/sort/sort_state.cpp +2 -1
- package/src/duckdb/src/common/sort/sorted_block.cpp +1 -1
- package/src/duckdb/src/common/types/{column_data_allocator.cpp → column/column_data_allocator.cpp} +2 -2
- package/src/duckdb/src/common/types/{column_data_collection.cpp → column/column_data_collection.cpp} +29 -6
- package/src/duckdb/src/common/types/{column_data_collection_segment.cpp → column/column_data_collection_segment.cpp} +2 -1
- package/src/duckdb/src/common/types/{column_data_consumer.cpp → column/column_data_consumer.cpp} +1 -1
- package/src/duckdb/src/common/types/{partitioned_column_data.cpp → column/partitioned_column_data.cpp} +11 -9
- package/src/duckdb/src/common/types/row/partitioned_tuple_data.cpp +316 -0
- package/src/duckdb/src/common/types/{row_data_collection.cpp → row/row_data_collection.cpp} +1 -1
- package/src/duckdb/src/common/types/{row_data_collection_scanner.cpp → row/row_data_collection_scanner.cpp} +2 -2
- package/src/duckdb/src/common/types/{row_layout.cpp → row/row_layout.cpp} +1 -1
- package/src/duckdb/src/common/types/row/tuple_data_allocator.cpp +465 -0
- package/src/duckdb/src/common/types/row/tuple_data_collection.cpp +511 -0
- package/src/duckdb/src/common/types/row/tuple_data_iterator.cpp +96 -0
- package/src/duckdb/src/common/types/row/tuple_data_layout.cpp +119 -0
- package/src/duckdb/src/common/types/row/tuple_data_scatter_gather.cpp +1200 -0
- package/src/duckdb/src/common/types/row/tuple_data_segment.cpp +170 -0
- package/src/duckdb/src/common/types/vector.cpp +1 -1
- package/src/duckdb/src/execution/aggregate_hashtable.cpp +252 -290
- package/src/duckdb/src/execution/join_hashtable.cpp +192 -328
- package/src/duckdb/src/execution/operator/aggregate/physical_window.cpp +4 -4
- package/src/duckdb/src/execution/operator/helper/physical_execute.cpp +3 -3
- package/src/duckdb/src/execution/operator/helper/physical_limit_percent.cpp +2 -3
- package/src/duckdb/src/execution/operator/helper/physical_result_collector.cpp +2 -3
- package/src/duckdb/src/execution/operator/join/perfect_hash_join_executor.cpp +36 -21
- package/src/duckdb/src/execution/operator/join/physical_blockwise_nl_join.cpp +2 -2
- package/src/duckdb/src/execution/operator/join/physical_cross_product.cpp +1 -1
- package/src/duckdb/src/execution/operator/join/physical_delim_join.cpp +2 -2
- package/src/duckdb/src/execution/operator/join/physical_hash_join.cpp +166 -144
- package/src/duckdb/src/execution/operator/join/physical_index_join.cpp +5 -5
- package/src/duckdb/src/execution/operator/join/physical_join.cpp +2 -10
- package/src/duckdb/src/execution/operator/join/physical_positional_join.cpp +0 -1
- package/src/duckdb/src/execution/operator/order/physical_top_n.cpp +2 -2
- package/src/duckdb/src/execution/operator/persistent/base_csv_reader.cpp +3 -0
- package/src/duckdb/src/execution/operator/persistent/buffered_csv_reader.cpp +71 -22
- package/src/duckdb/src/execution/operator/persistent/csv_buffer.cpp +17 -13
- package/src/duckdb/src/execution/operator/persistent/csv_reader_options.cpp +0 -7
- package/src/duckdb/src/execution/operator/persistent/parallel_csv_reader.cpp +124 -29
- package/src/duckdb/src/execution/operator/persistent/physical_copy_to_file.cpp +13 -11
- package/src/duckdb/src/execution/operator/persistent/physical_delete.cpp +3 -2
- package/src/duckdb/src/execution/operator/persistent/physical_export.cpp +25 -24
- package/src/duckdb/src/execution/operator/persistent/physical_insert.cpp +1 -1
- package/src/duckdb/src/execution/operator/persistent/physical_update.cpp +4 -3
- package/src/duckdb/src/execution/operator/scan/physical_table_scan.cpp +1 -1
- package/src/duckdb/src/execution/operator/schema/physical_create_type.cpp +1 -1
- package/src/duckdb/src/execution/operator/set/physical_recursive_cte.cpp +3 -3
- package/src/duckdb/src/execution/partitionable_hashtable.cpp +9 -37
- package/src/duckdb/src/execution/physical_operator.cpp +1 -1
- package/src/duckdb/src/execution/physical_plan/plan_comparison_join.cpp +19 -18
- package/src/duckdb/src/execution/physical_plan/plan_copy_to_file.cpp +2 -1
- package/src/duckdb/src/execution/physical_plan/plan_execute.cpp +2 -2
- package/src/duckdb/src/execution/physical_plan/plan_explain.cpp +5 -6
- package/src/duckdb/src/execution/physical_plan/plan_expression_get.cpp +2 -2
- package/src/duckdb/src/execution/physical_plan/plan_recursive_cte.cpp +3 -3
- package/src/duckdb/src/execution/physical_plan_generator.cpp +1 -1
- package/src/duckdb/src/execution/radix_partitioned_hashtable.cpp +39 -17
- package/src/duckdb/src/function/aggregate/sorted_aggregate_function.cpp +2 -2
- package/src/duckdb/src/function/table/pragma_detailed_profiling_output.cpp +5 -5
- package/src/duckdb/src/function/table/pragma_last_profiling_output.cpp +2 -2
- package/src/duckdb/src/function/table/read_csv.cpp +124 -58
- package/src/duckdb/src/function/table/version/pragma_version.cpp +2 -2
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/index_catalog_entry.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/arrow/arrow_appender.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/constants.hpp +2 -0
- package/src/duckdb/src/include/duckdb/common/exception.hpp +3 -0
- package/src/duckdb/src/include/duckdb/common/fast_mem.hpp +528 -0
- package/src/duckdb/src/include/duckdb/common/filename_pattern.hpp +34 -0
- package/src/duckdb/src/include/duckdb/common/helper.hpp +10 -0
- package/src/duckdb/src/include/duckdb/common/hive_partitioning.hpp +13 -3
- package/src/duckdb/src/include/duckdb/common/optional_ptr.hpp +8 -0
- package/src/duckdb/src/include/duckdb/common/perfect_map_set.hpp +34 -0
- package/src/duckdb/src/include/duckdb/common/radix_partitioning.hpp +80 -27
- package/src/duckdb/src/include/duckdb/common/reference_map.hpp +38 -0
- package/src/duckdb/src/include/duckdb/common/row_operations/row_operations.hpp +7 -6
- package/src/duckdb/src/include/duckdb/common/sort/comparators.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/sort/partition_state.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/sort/sort.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/sort/sorted_block.hpp +2 -2
- package/src/duckdb/src/include/duckdb/common/types/batched_data_collection.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/types/{column_data_allocator.hpp → column/column_data_allocator.hpp} +4 -4
- package/src/duckdb/src/include/duckdb/common/types/{column_data_collection.hpp → column/column_data_collection.hpp} +4 -4
- package/src/duckdb/src/include/duckdb/common/types/{column_data_collection_iterators.hpp → column/column_data_collection_iterators.hpp} +2 -2
- package/src/duckdb/src/include/duckdb/common/types/{column_data_collection_segment.hpp → column/column_data_collection_segment.hpp} +3 -3
- package/src/duckdb/src/include/duckdb/common/types/{column_data_consumer.hpp → column/column_data_consumer.hpp} +8 -4
- package/src/duckdb/src/include/duckdb/common/types/{column_data_scan_states.hpp → column/column_data_scan_states.hpp} +1 -1
- package/src/duckdb/src/include/duckdb/common/types/{partitioned_column_data.hpp → column/partitioned_column_data.hpp} +15 -7
- package/src/duckdb/src/include/duckdb/common/types/row/partitioned_tuple_data.hpp +140 -0
- package/src/duckdb/src/include/duckdb/common/types/{row_data_collection.hpp → row/row_data_collection.hpp} +1 -1
- package/src/duckdb/src/include/duckdb/common/types/{row_data_collection_scanner.hpp → row/row_data_collection_scanner.hpp} +2 -2
- package/src/duckdb/src/include/duckdb/common/types/{row_layout.hpp → row/row_layout.hpp} +3 -1
- package/src/duckdb/src/include/duckdb/common/types/row/tuple_data_allocator.hpp +116 -0
- package/src/duckdb/src/include/duckdb/common/types/row/tuple_data_collection.hpp +239 -0
- package/src/duckdb/src/include/duckdb/common/types/row/tuple_data_iterator.hpp +64 -0
- package/src/duckdb/src/include/duckdb/common/types/row/tuple_data_layout.hpp +113 -0
- package/src/duckdb/src/include/duckdb/common/types/row/tuple_data_segment.hpp +124 -0
- package/src/duckdb/src/include/duckdb/common/types/row/tuple_data_states.hpp +74 -0
- package/src/duckdb/src/include/duckdb/common/types/validity_mask.hpp +3 -0
- package/src/duckdb/src/include/duckdb/common/types/value.hpp +4 -12
- package/src/duckdb/src/include/duckdb/execution/aggregate_hashtable.hpp +34 -31
- package/src/duckdb/src/include/duckdb/execution/base_aggregate_hashtable.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/execution_context.hpp +3 -2
- package/src/duckdb/src/include/duckdb/execution/expression_executor.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/join_hashtable.hpp +41 -67
- package/src/duckdb/src/include/duckdb/execution/nested_loop_join.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_execute.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_result_collector.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/join/outer_join_marker.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/join/perfect_hash_join_executor.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_cross_product.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_hash_join.hpp +0 -2
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_index_join.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_positional_join.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/buffered_csv_reader.hpp +4 -1
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/csv_buffer.hpp +8 -3
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/csv_reader_options.hpp +5 -7
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/parallel_csv_reader.hpp +5 -1
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_copy_to_file.hpp +4 -1
- package/src/duckdb/src/include/duckdb/execution/operator/scan/physical_column_data_scan.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/set/physical_recursive_cte.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/partitionable_hashtable.hpp +2 -2
- package/src/duckdb/src/include/duckdb/function/function.hpp +2 -0
- package/src/duckdb/src/include/duckdb/function/table/read_csv.hpp +25 -0
- package/src/duckdb/src/include/duckdb/main/client_data.hpp +3 -0
- package/src/duckdb/src/include/duckdb/main/config.hpp +0 -2
- package/src/duckdb/src/include/duckdb/main/materialized_query_result.hpp +1 -1
- package/src/duckdb/src/include/duckdb/main/query_result.hpp +14 -1
- package/src/duckdb/src/include/duckdb/optimizer/expression_rewriter.hpp +3 -3
- package/src/duckdb/src/include/duckdb/optimizer/join_order/cardinality_estimator.hpp +16 -16
- package/src/duckdb/src/include/duckdb/optimizer/join_order/join_node.hpp +8 -8
- package/src/duckdb/src/include/duckdb/optimizer/join_order/join_order_optimizer.hpp +23 -15
- package/src/duckdb/src/include/duckdb/optimizer/join_order/join_relation.hpp +9 -10
- package/src/duckdb/src/include/duckdb/optimizer/join_order/query_graph.hpp +18 -11
- package/src/duckdb/src/include/duckdb/parallel/meta_pipeline.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/exported_table_data.hpp +5 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/vacuum_info.hpp +3 -2
- package/src/duckdb/src/include/duckdb/parser/query_error_context.hpp +4 -2
- package/src/duckdb/src/include/duckdb/parser/transformer.hpp +9 -35
- package/src/duckdb/src/include/duckdb/planner/binder.hpp +24 -23
- package/src/duckdb/src/include/duckdb/planner/expression_binder.hpp +3 -3
- package/src/duckdb/src/include/duckdb/planner/operator/logical_column_data_get.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/operator/logical_copy_to_file.hpp +3 -1
- package/src/duckdb/src/include/duckdb/storage/table/table_index_list.hpp +1 -1
- package/src/duckdb/src/main/appender.cpp +6 -6
- package/src/duckdb/src/main/client_context.cpp +1 -1
- package/src/duckdb/src/main/connection.cpp +2 -2
- package/src/duckdb/src/main/query_result.cpp +13 -0
- package/src/duckdb/src/main/settings/settings.cpp +3 -4
- package/src/duckdb/src/optimizer/expression_rewriter.cpp +4 -4
- package/src/duckdb/src/optimizer/join_order/cardinality_estimator.cpp +91 -105
- package/src/duckdb/src/optimizer/join_order/join_node.cpp +5 -8
- package/src/duckdb/src/optimizer/join_order/join_order_optimizer.cpp +163 -160
- package/src/duckdb/src/optimizer/join_order/join_relation_set.cpp +30 -30
- package/src/duckdb/src/optimizer/join_order/query_graph.cpp +37 -38
- package/src/duckdb/src/parallel/executor.cpp +1 -1
- package/src/duckdb/src/parallel/meta_pipeline.cpp +2 -2
- package/src/duckdb/src/parser/transform/helpers/transform_cte.cpp +1 -1
- package/src/duckdb/src/parser/transform/tableref/transform_subquery.cpp +1 -1
- package/src/duckdb/src/parser/transformer.cpp +50 -9
- package/src/duckdb/src/planner/binder/expression/bind_operator_expression.cpp +13 -0
- package/src/duckdb/src/planner/binder/statement/bind_copy.cpp +15 -5
- package/src/duckdb/src/planner/binder/statement/bind_create.cpp +19 -17
- package/src/duckdb/src/planner/binder/statement/bind_create_table.cpp +4 -4
- package/src/duckdb/src/planner/binder/statement/bind_export.cpp +20 -21
- package/src/duckdb/src/planner/binder/tableref/bind_basetableref.cpp +24 -22
- package/src/duckdb/src/planner/binder/tableref/bind_subqueryref.cpp +2 -2
- package/src/duckdb/src/planner/binder/tableref/bind_table_function.cpp +9 -0
- package/src/duckdb/src/planner/binder.cpp +16 -19
- package/src/duckdb/src/planner/expression_binder.cpp +8 -8
- package/src/duckdb/src/planner/operator/logical_copy_to_file.cpp +3 -3
- package/src/duckdb/src/storage/checkpoint_manager.cpp +23 -23
- package/src/duckdb/src/storage/standard_buffer_manager.cpp +1 -1
- package/src/duckdb/src/storage/table_index_list.cpp +3 -3
- package/src/duckdb/src/verification/statement_verifier.cpp +1 -1
- package/src/duckdb/third_party/libpg_query/src_backend_parser_gram.cpp +5552 -5598
- package/src/duckdb/ub_src_common.cpp +2 -0
- package/src/duckdb/ub_src_common_types.cpp +0 -16
- package/src/duckdb/ub_src_common_types_column.cpp +10 -0
- package/src/duckdb/ub_src_common_types_row.cpp +20 -0
@@ -11,18 +11,20 @@
|
|
11
11
|
#include "duckdb/common/common.hpp"
|
12
12
|
#include "duckdb/common/vector.hpp"
|
13
13
|
#include "duckdb/common/exception_format_value.hpp"
|
14
|
+
#include "duckdb/common/optional_ptr.hpp"
|
14
15
|
|
15
16
|
namespace duckdb {
|
16
17
|
class SQLStatement;
|
17
18
|
|
18
19
|
class QueryErrorContext {
|
19
20
|
public:
|
20
|
-
explicit QueryErrorContext(SQLStatement
|
21
|
+
explicit QueryErrorContext(optional_ptr<SQLStatement> statement_ = nullptr,
|
22
|
+
idx_t query_location_ = DConstants::INVALID_INDEX)
|
21
23
|
: statement(statement_), query_location(query_location_) {
|
22
24
|
}
|
23
25
|
|
24
26
|
//! The query statement
|
25
|
-
SQLStatement
|
27
|
+
optional_ptr<SQLStatement> statement;
|
26
28
|
//! The location in which the error should be thrown
|
27
29
|
idx_t query_location;
|
28
30
|
|
@@ -49,19 +49,17 @@ class Transformer {
|
|
49
49
|
|
50
50
|
public:
|
51
51
|
explicit Transformer(ParserOptions &options);
|
52
|
-
explicit Transformer(Transformer
|
52
|
+
explicit Transformer(Transformer &parent);
|
53
53
|
~Transformer();
|
54
54
|
|
55
55
|
//! Transforms a Postgres parse tree into a set of SQL Statements
|
56
56
|
bool TransformParseTree(duckdb_libpgquery::PGList *tree, vector<unique_ptr<SQLStatement>> &statements);
|
57
57
|
string NodetypeToString(duckdb_libpgquery::PGNodeTag type);
|
58
58
|
|
59
|
-
idx_t ParamCount()
|
60
|
-
return parent ? parent->ParamCount() : prepared_statement_parameter_index;
|
61
|
-
}
|
59
|
+
idx_t ParamCount() const;
|
62
60
|
|
63
61
|
private:
|
64
|
-
Transformer
|
62
|
+
optional_ptr<Transformer> parent;
|
65
63
|
//! Parser options
|
66
64
|
ParserOptions &options;
|
67
65
|
//! The current prepared statement parameter index
|
@@ -80,36 +78,12 @@ private:
|
|
80
78
|
void Clear();
|
81
79
|
bool InWindowDefinition();
|
82
80
|
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
}
|
90
|
-
void SetNamedParam(const string &name, int32_t index) {
|
91
|
-
if (parent) {
|
92
|
-
parent->SetNamedParam(name, index);
|
93
|
-
} else {
|
94
|
-
D_ASSERT(!named_param_map.count(name));
|
95
|
-
this->named_param_map[name] = index;
|
96
|
-
}
|
97
|
-
}
|
98
|
-
bool GetNamedParam(const string &name, int32_t &index) {
|
99
|
-
if (parent) {
|
100
|
-
return parent->GetNamedParam(name, index);
|
101
|
-
} else {
|
102
|
-
auto entry = named_param_map.find(name);
|
103
|
-
if (entry == named_param_map.end()) {
|
104
|
-
return false;
|
105
|
-
}
|
106
|
-
index = entry->second;
|
107
|
-
return true;
|
108
|
-
}
|
109
|
-
}
|
110
|
-
bool HasNamedParameters() const {
|
111
|
-
return parent ? parent->HasNamedParameters() : !named_param_map.empty();
|
112
|
-
}
|
81
|
+
Transformer &RootTransformer();
|
82
|
+
const Transformer &RootTransformer() const;
|
83
|
+
void SetParamCount(idx_t new_count);
|
84
|
+
void SetNamedParam(const string &name, int32_t index);
|
85
|
+
bool GetNamedParam(const string &name, int32_t &index);
|
86
|
+
bool HasNamedParameters() const;
|
113
87
|
|
114
88
|
void AddPivotEntry(string enum_name, unique_ptr<SelectNode> source, unique_ptr<ParsedExpression> column);
|
115
89
|
unique_ptr<SQLStatement> GenerateCreateEnumStmt(unique_ptr<CreatePivotEntry> entry);
|
@@ -21,6 +21,7 @@
|
|
21
21
|
#include "duckdb/planner/bound_tokens.hpp"
|
22
22
|
#include "duckdb/planner/expression/bound_columnref_expression.hpp"
|
23
23
|
#include "duckdb/planner/logical_operator.hpp"
|
24
|
+
#include "duckdb/common/reference_map.hpp"
|
24
25
|
|
25
26
|
namespace duckdb {
|
26
27
|
class BoundResultModifier;
|
@@ -76,43 +77,43 @@ class Binder : public std::enable_shared_from_this<Binder> {
|
|
76
77
|
friend class RecursiveSubqueryPlanner;
|
77
78
|
|
78
79
|
public:
|
79
|
-
DUCKDB_API static shared_ptr<Binder> CreateBinder(ClientContext &context, Binder
|
80
|
+
DUCKDB_API static shared_ptr<Binder> CreateBinder(ClientContext &context, optional_ptr<Binder> parent = nullptr,
|
80
81
|
bool inherit_ctes = true);
|
81
82
|
|
82
83
|
//! The client context
|
83
84
|
ClientContext &context;
|
84
85
|
//! A mapping of names to common table expressions
|
85
|
-
case_insensitive_map_t<CommonTableExpressionInfo
|
86
|
+
case_insensitive_map_t<reference<CommonTableExpressionInfo>> CTE_bindings; // NOLINT
|
86
87
|
//! The CTEs that have already been bound
|
87
|
-
|
88
|
+
reference_set_t<CommonTableExpressionInfo> bound_ctes;
|
88
89
|
//! The bind context
|
89
90
|
BindContext bind_context;
|
90
91
|
//! The set of correlated columns bound by this binder (FIXME: this should probably be an unordered_set and not a
|
91
92
|
//! vector)
|
92
93
|
vector<CorrelatedColumnInfo> correlated_columns;
|
93
94
|
//! The set of parameter expressions bound by this binder
|
94
|
-
BoundParameterMap
|
95
|
+
optional_ptr<BoundParameterMap> parameters;
|
95
96
|
//! Statement properties
|
96
97
|
StatementProperties properties;
|
97
98
|
//! The alias for the currently processing subquery, if it exists
|
98
99
|
string alias;
|
99
100
|
//! Macro parameter bindings (if any)
|
100
|
-
DummyBinding
|
101
|
+
optional_ptr<DummyBinding> macro_binding;
|
101
102
|
//! The intermediate lambda bindings to bind nested lambdas (if any)
|
102
|
-
vector<DummyBinding
|
103
|
+
optional_ptr<vector<DummyBinding>> lambda_bindings;
|
103
104
|
|
104
105
|
public:
|
105
106
|
DUCKDB_API BoundStatement Bind(SQLStatement &statement);
|
106
107
|
DUCKDB_API BoundStatement Bind(QueryNode &node);
|
107
108
|
|
108
109
|
unique_ptr<BoundCreateTableInfo> BindCreateTableInfo(unique_ptr<CreateInfo> info);
|
109
|
-
unique_ptr<BoundCreateTableInfo> BindCreateTableInfo(unique_ptr<CreateInfo> info, SchemaCatalogEntry
|
110
|
+
unique_ptr<BoundCreateTableInfo> BindCreateTableInfo(unique_ptr<CreateInfo> info, SchemaCatalogEntry &schema);
|
110
111
|
|
111
112
|
vector<unique_ptr<Expression>> BindCreateIndexExpressions(TableCatalogEntry *table, CreateIndexInfo *info);
|
112
113
|
|
113
114
|
void BindCreateViewInfo(CreateViewInfo &base);
|
114
|
-
SchemaCatalogEntry
|
115
|
-
SchemaCatalogEntry
|
115
|
+
SchemaCatalogEntry &BindSchema(CreateInfo &info);
|
116
|
+
SchemaCatalogEntry &BindCreateFunctionInfo(CreateInfo &info);
|
116
117
|
|
117
118
|
//! Check usage, and cast named parameters to their types
|
118
119
|
static void BindNamedParameters(named_parameter_type_map_t &types, named_parameter_map_t &values,
|
@@ -125,22 +126,22 @@ public:
|
|
125
126
|
idx_t GenerateTableIndex();
|
126
127
|
|
127
128
|
//! Add a common table expression to the binder
|
128
|
-
void AddCTE(const string &name, CommonTableExpressionInfo
|
129
|
+
void AddCTE(const string &name, CommonTableExpressionInfo &cte);
|
129
130
|
//! Find a common table expression by name; returns nullptr if none exists
|
130
|
-
CommonTableExpressionInfo
|
131
|
+
optional_ptr<CommonTableExpressionInfo> FindCTE(const string &name, bool skip = false);
|
131
132
|
|
132
|
-
bool CTEIsAlreadyBound(CommonTableExpressionInfo
|
133
|
+
bool CTEIsAlreadyBound(CommonTableExpressionInfo &cte);
|
133
134
|
|
134
135
|
//! Add the view to the set of currently bound views - used for detecting recursive view definitions
|
135
|
-
void AddBoundView(ViewCatalogEntry
|
136
|
+
void AddBoundView(ViewCatalogEntry &view);
|
136
137
|
|
137
|
-
void PushExpressionBinder(ExpressionBinder
|
138
|
+
void PushExpressionBinder(ExpressionBinder &binder);
|
138
139
|
void PopExpressionBinder();
|
139
|
-
void SetActiveBinder(ExpressionBinder
|
140
|
-
ExpressionBinder
|
140
|
+
void SetActiveBinder(ExpressionBinder &binder);
|
141
|
+
ExpressionBinder &GetActiveBinder();
|
141
142
|
bool HasActiveBinder();
|
142
143
|
|
143
|
-
vector<ExpressionBinder
|
144
|
+
vector<reference<ExpressionBinder>> &GetActiveBinders();
|
144
145
|
|
145
146
|
void MergeCorrelatedColumns(vector<CorrelatedColumnInfo> &other);
|
146
147
|
//! Add a correlated column to this binder (if it does not exist)
|
@@ -184,7 +185,7 @@ public:
|
|
184
185
|
BindingMode GetBindingMode();
|
185
186
|
void AddTableName(string table_name);
|
186
187
|
const unordered_set<string> &GetTableNames();
|
187
|
-
SQLStatement
|
188
|
+
optional_ptr<SQLStatement> GetRootStatement() {
|
188
189
|
return root_statement;
|
189
190
|
}
|
190
191
|
|
@@ -194,7 +195,7 @@ private:
|
|
194
195
|
//! The parent binder (if any)
|
195
196
|
shared_ptr<Binder> parent;
|
196
197
|
//! The vector of active binders
|
197
|
-
vector<ExpressionBinder
|
198
|
+
vector<reference<ExpressionBinder>> active_binders;
|
198
199
|
//! The count of bound_tables
|
199
200
|
idx_t bound_tables;
|
200
201
|
//! Whether or not the binder has any unplanned subqueries that still need to be planned
|
@@ -206,13 +207,13 @@ private:
|
|
206
207
|
//! Whether or not the binder can contain NULLs as the root of expressions
|
207
208
|
bool can_contain_nulls = false;
|
208
209
|
//! The root statement of the query that is currently being parsed
|
209
|
-
SQLStatement
|
210
|
+
optional_ptr<SQLStatement> root_statement;
|
210
211
|
//! Binding mode
|
211
212
|
BindingMode mode = BindingMode::STANDARD_BINDING;
|
212
213
|
//! Table names extracted for BindingMode::EXTRACT_NAMES
|
213
214
|
unordered_set<string> table_names;
|
214
215
|
//! The set of bound views
|
215
|
-
|
216
|
+
reference_set_t<ViewCatalogEntry> bound_views;
|
216
217
|
|
217
218
|
private:
|
218
219
|
//! Bind the expressions of generated columns to check for errors
|
@@ -273,7 +274,7 @@ private:
|
|
273
274
|
|
274
275
|
unique_ptr<BoundTableRef> Bind(BaseTableRef &ref);
|
275
276
|
unique_ptr<BoundTableRef> Bind(JoinRef &ref);
|
276
|
-
unique_ptr<BoundTableRef> Bind(SubqueryRef &ref, CommonTableExpressionInfo
|
277
|
+
unique_ptr<BoundTableRef> Bind(SubqueryRef &ref, optional_ptr<CommonTableExpressionInfo> cte = nullptr);
|
277
278
|
unique_ptr<BoundTableRef> Bind(TableFunctionRef &ref);
|
278
279
|
unique_ptr<BoundTableRef> Bind(EmptyTableRef &ref);
|
279
280
|
unique_ptr<BoundTableRef> Bind(ExpressionListRef &ref);
|
@@ -349,7 +350,7 @@ private:
|
|
349
350
|
|
350
351
|
//! If only a schema name is provided (e.g. "a.b") then figure out if "a" is a schema or a catalog name
|
351
352
|
void BindSchemaOrCatalog(string &catalog_name, string &schema_name);
|
352
|
-
SchemaCatalogEntry
|
353
|
+
SchemaCatalogEntry &BindCreateSchema(CreateInfo &info);
|
353
354
|
|
354
355
|
unique_ptr<BoundQueryNode> BindSelectNode(SelectNode &statement, unique_ptr<BoundTableRef> from_table);
|
355
356
|
|
@@ -59,8 +59,8 @@ public:
|
|
59
59
|
//! be added. Defaults to INVALID.
|
60
60
|
LogicalType target_type;
|
61
61
|
|
62
|
-
DummyBinding
|
63
|
-
vector<DummyBinding
|
62
|
+
optional_ptr<DummyBinding> macro_binding;
|
63
|
+
optional_ptr<vector<DummyBinding>> lambda_bindings;
|
64
64
|
|
65
65
|
public:
|
66
66
|
unique_ptr<Expression> Bind(unique_ptr<ParsedExpression> &expr, LogicalType *result_type = nullptr,
|
@@ -146,7 +146,7 @@ protected:
|
|
146
146
|
|
147
147
|
Binder &binder;
|
148
148
|
ClientContext &context;
|
149
|
-
ExpressionBinder
|
149
|
+
optional_ptr<ExpressionBinder> stored_binder;
|
150
150
|
vector<BoundColumnReferenceInfo> bound_columns;
|
151
151
|
};
|
152
152
|
|
@@ -10,6 +10,7 @@
|
|
10
10
|
|
11
11
|
#include "duckdb/planner/logical_operator.hpp"
|
12
12
|
#include "duckdb/function/copy_function.hpp"
|
13
|
+
#include "duckdb/common/filename_pattern.hpp"
|
13
14
|
#include "duckdb/common/local_file_system.hpp"
|
14
15
|
|
15
16
|
namespace duckdb {
|
@@ -27,7 +28,8 @@ public:
|
|
27
28
|
unique_ptr<FunctionData> bind_data;
|
28
29
|
std::string file_path;
|
29
30
|
bool use_tmp_file;
|
30
|
-
|
31
|
+
FilenamePattern filename_pattern;
|
32
|
+
bool overwrite_or_ignore;
|
31
33
|
bool per_thread_output;
|
32
34
|
|
33
35
|
bool partition_output;
|
@@ -3,15 +3,15 @@
|
|
3
3
|
#include "duckdb/catalog/catalog_entry/duck_table_entry.hpp"
|
4
4
|
#include "duckdb/catalog/catalog_entry/table_catalog_entry.hpp"
|
5
5
|
#include "duckdb/common/exception.hpp"
|
6
|
-
#include "duckdb/
|
6
|
+
#include "duckdb/common/operator/cast_operators.hpp"
|
7
|
+
#include "duckdb/common/operator/decimal_cast_operators.hpp"
|
8
|
+
#include "duckdb/common/operator/string_cast.hpp"
|
9
|
+
#include "duckdb/common/string_util.hpp"
|
10
|
+
#include "duckdb/common/types/column/column_data_collection.hpp"
|
7
11
|
#include "duckdb/main/client_context.hpp"
|
12
|
+
#include "duckdb/main/connection.hpp"
|
8
13
|
#include "duckdb/main/database.hpp"
|
9
14
|
#include "duckdb/storage/data_table.hpp"
|
10
|
-
#include "duckdb/common/string_util.hpp"
|
11
|
-
#include "duckdb/common/operator/cast_operators.hpp"
|
12
|
-
#include "duckdb/common/operator/string_cast.hpp"
|
13
|
-
#include "duckdb/common/types/column_data_collection.hpp"
|
14
|
-
#include "duckdb/common/operator/decimal_cast_operators.hpp"
|
15
15
|
|
16
16
|
namespace duckdb {
|
17
17
|
|
@@ -10,7 +10,7 @@
|
|
10
10
|
#include "duckdb/common/serializer/buffered_deserializer.hpp"
|
11
11
|
#include "duckdb/common/serializer/buffered_file_writer.hpp"
|
12
12
|
#include "duckdb/common/serializer/buffered_serializer.hpp"
|
13
|
-
#include "duckdb/common/types/column_data_collection.hpp"
|
13
|
+
#include "duckdb/common/types/column/column_data_collection.hpp"
|
14
14
|
#include "duckdb/execution/column_binding_resolver.hpp"
|
15
15
|
#include "duckdb/execution/operator/helper/physical_result_collector.hpp"
|
16
16
|
#include "duckdb/execution/physical_plan_generator.hpp"
|
@@ -1,6 +1,8 @@
|
|
1
1
|
#include "duckdb/main/connection.hpp"
|
2
2
|
|
3
|
+
#include "duckdb/common/types/column/column_data_collection.hpp"
|
3
4
|
#include "duckdb/execution/operator/persistent/parallel_csv_reader.hpp"
|
5
|
+
#include "duckdb/function/table/read_csv.hpp"
|
4
6
|
#include "duckdb/main/appender.hpp"
|
5
7
|
#include "duckdb/main/client_context.hpp"
|
6
8
|
#include "duckdb/main/connection_manager.hpp"
|
@@ -14,8 +16,6 @@
|
|
14
16
|
#include "duckdb/main/relation/view_relation.hpp"
|
15
17
|
#include "duckdb/parser/parser.hpp"
|
16
18
|
#include "duckdb/planner/logical_operator.hpp"
|
17
|
-
#include "duckdb/common/types/column_data_collection.hpp"
|
18
|
-
#include "duckdb/function/table/read_csv.hpp"
|
19
19
|
|
20
20
|
namespace duckdb {
|
21
21
|
|
@@ -58,6 +58,19 @@ QueryResult::QueryResult(QueryResultType type, StatementType statement_type, Sta
|
|
58
58
|
client_properties(std::move(client_properties_p)) {
|
59
59
|
}
|
60
60
|
|
61
|
+
bool CurrentChunk::Valid() {
|
62
|
+
if (data_chunk) {
|
63
|
+
if (position < data_chunk->size()) {
|
64
|
+
return true;
|
65
|
+
}
|
66
|
+
}
|
67
|
+
return false;
|
68
|
+
}
|
69
|
+
|
70
|
+
idx_t CurrentChunk::RemainingSize() {
|
71
|
+
return data_chunk->size() - position;
|
72
|
+
}
|
73
|
+
|
61
74
|
QueryResult::QueryResult(QueryResultType type, PreservedError error) : BaseQueryResult(type, std::move(error)) {
|
62
75
|
}
|
63
76
|
|
@@ -512,16 +512,15 @@ Value EnableProgressBarPrintSetting::GetSetting(ClientContext &context) {
|
|
512
512
|
// Experimental Parallel CSV
|
513
513
|
//===--------------------------------------------------------------------===//
|
514
514
|
void ExperimentalParallelCSVSetting::SetGlobal(DatabaseInstance *db, DBConfig &config, const Value &input) {
|
515
|
-
|
515
|
+
Printer::Print("experimental_parallel_csv is deprecated and will be removed with the next release - the parallel "
|
516
|
+
"CSV reader is now standard and does not need to be manually enabled anymore 1");
|
516
517
|
}
|
517
518
|
|
518
519
|
void ExperimentalParallelCSVSetting::ResetGlobal(DatabaseInstance *db, DBConfig &config) {
|
519
|
-
config.options.experimental_parallel_csv_reader = DBConfig().options.experimental_parallel_csv_reader;
|
520
520
|
}
|
521
521
|
|
522
522
|
Value ExperimentalParallelCSVSetting::GetSetting(ClientContext &context) {
|
523
|
-
|
524
|
-
return Value::BIGINT(config.options.experimental_parallel_csv_reader);
|
523
|
+
return Value();
|
525
524
|
}
|
526
525
|
|
527
526
|
//===--------------------------------------------------------------------===//
|
@@ -9,14 +9,14 @@
|
|
9
9
|
|
10
10
|
namespace duckdb {
|
11
11
|
|
12
|
-
unique_ptr<Expression> ExpressionRewriter::ApplyRules(LogicalOperator &op, const vector<Rule
|
12
|
+
unique_ptr<Expression> ExpressionRewriter::ApplyRules(LogicalOperator &op, const vector<reference<Rule>> &rules,
|
13
13
|
unique_ptr<Expression> expr, bool &changes_made, bool is_root) {
|
14
14
|
for (auto &rule : rules) {
|
15
15
|
vector<reference<Expression>> bindings;
|
16
|
-
if (rule
|
16
|
+
if (rule.get().root->Match(*expr, bindings)) {
|
17
17
|
// the rule matches! try to apply it
|
18
18
|
bool rule_made_change = false;
|
19
|
-
auto result = rule
|
19
|
+
auto result = rule.get().Apply(op, bindings, rule_made_change, is_root);
|
20
20
|
if (result) {
|
21
21
|
changes_made = true;
|
22
22
|
// the base node changed: the rule applied changes
|
@@ -63,7 +63,7 @@ void ExpressionRewriter::VisitOperator(LogicalOperator &op) {
|
|
63
63
|
// this rule does not apply to this type of LogicalOperator
|
64
64
|
continue;
|
65
65
|
}
|
66
|
-
to_apply_rules.push_back(rule
|
66
|
+
to_apply_rules.push_back(*rule);
|
67
67
|
}
|
68
68
|
if (to_apply_rules.empty()) {
|
69
69
|
// no rules to apply on this node
|