duckdb 0.7.2-dev3441.0 → 0.7.2-dev3515.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/package.json +2 -2
- package/src/duckdb/extension/json/json_functions/json_create.cpp +1 -1
- package/src/duckdb/src/catalog/default/default_functions.cpp +1 -0
- package/src/duckdb/src/common/arrow/arrow_converter.cpp +4 -4
- package/src/duckdb/src/common/compressed_file_system.cpp +2 -2
- package/src/duckdb/src/common/file_system.cpp +2 -2
- package/src/duckdb/src/common/row_operations/row_gather.cpp +2 -2
- package/src/duckdb/src/common/serializer/binary_deserializer.cpp +1 -1
- package/src/duckdb/src/common/serializer/buffered_file_reader.cpp +1 -1
- package/src/duckdb/src/common/serializer/buffered_file_writer.cpp +1 -1
- package/src/duckdb/src/common/serializer/buffered_serializer.cpp +4 -3
- package/src/duckdb/src/common/serializer.cpp +1 -1
- package/src/duckdb/src/common/sort/radix_sort.cpp +5 -5
- package/src/duckdb/src/common/string_util.cpp +2 -2
- package/src/duckdb/src/common/types/bit.cpp +2 -2
- package/src/duckdb/src/common/types/blob.cpp +2 -2
- package/src/duckdb/src/common/types/data_chunk.cpp +2 -2
- package/src/duckdb/src/common/types/date.cpp +1 -1
- package/src/duckdb/src/common/types/decimal.cpp +2 -2
- package/src/duckdb/src/common/types/row/tuple_data_scatter_gather.cpp +14 -2
- package/src/duckdb/src/common/types/selection_vector.cpp +1 -1
- package/src/duckdb/src/common/types/time.cpp +1 -1
- package/src/duckdb/src/common/types/vector.cpp +7 -7
- package/src/duckdb/src/common/virtual_file_system.cpp +4 -0
- package/src/duckdb/src/common/windows_util.cpp +2 -2
- package/src/duckdb/src/core_functions/aggregate/distributive/string_agg.cpp +6 -3
- package/src/duckdb/src/core_functions/scalar/list/list_aggregates.cpp +2 -5
- package/src/duckdb/src/core_functions/scalar/string/printf.cpp +1 -1
- package/src/duckdb/src/execution/aggregate_hashtable.cpp +1 -1
- package/src/duckdb/src/execution/join_hashtable.cpp +3 -3
- package/src/duckdb/src/execution/operator/aggregate/physical_ungrouped_aggregate.cpp +2 -2
- package/src/duckdb/src/execution/operator/join/outer_join_marker.cpp +1 -1
- package/src/duckdb/src/execution/operator/join/perfect_hash_join_executor.cpp +1 -1
- package/src/duckdb/src/execution/operator/join/physical_range_join.cpp +1 -1
- package/src/duckdb/src/execution/operator/persistent/base_csv_reader.cpp +2 -7
- package/src/duckdb/src/execution/operator/persistent/buffered_csv_reader.cpp +4 -41
- package/src/duckdb/src/execution/operator/persistent/csv_file_handle.cpp +158 -0
- package/src/duckdb/src/execution/operator/projection/physical_pivot.cpp +1 -1
- package/src/duckdb/src/execution/perfect_aggregate_hashtable.cpp +2 -2
- package/src/duckdb/src/execution/radix_partitioned_hashtable.cpp +3 -4
- package/src/duckdb/src/execution/window_segment_tree.cpp +1 -1
- package/src/duckdb/src/function/pragma/pragma_queries.cpp +1 -1
- package/src/duckdb/src/function/scalar/strftime_format.cpp +1 -1
- package/src/duckdb/src/function/scalar/string/concat.cpp +1 -1
- package/src/duckdb/src/function/scalar/string/like.cpp +2 -2
- package/src/duckdb/src/function/scalar/system/aggregate_export.cpp +5 -5
- package/src/duckdb/src/function/table/copy_csv.cpp +1 -1
- package/src/duckdb/src/function/table/read_csv.cpp +43 -35
- package/src/duckdb/src/function/table/version/pragma_version.cpp +2 -2
- package/src/duckdb/src/include/duckdb/common/allocator.hpp +3 -0
- package/src/duckdb/src/include/duckdb/common/compressed_file_system.hpp +3 -3
- package/src/duckdb/src/include/duckdb/common/constants.hpp +0 -5
- package/src/duckdb/src/include/duckdb/common/helper.hpp +22 -9
- package/src/duckdb/src/include/duckdb/common/memory_safety.hpp +15 -0
- package/src/duckdb/src/include/duckdb/common/optional_ptr.hpp +1 -0
- package/src/duckdb/src/include/duckdb/common/serializer/buffered_file_reader.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/serializer/buffered_file_writer.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/serializer/buffered_serializer.hpp +3 -2
- package/src/duckdb/src/include/duckdb/common/serializer/serialization_traits.hpp +2 -3
- package/src/duckdb/src/include/duckdb/common/sort/duckdb_pdqsort.hpp +11 -6
- package/src/duckdb/src/include/duckdb/common/types/data_chunk.hpp +2 -1
- package/src/duckdb/src/include/duckdb/common/types/selection_vector.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/types/validity_mask.hpp +3 -3
- package/src/duckdb/src/include/duckdb/common/types/vector_buffer.hpp +4 -4
- package/src/duckdb/src/include/duckdb/common/unique_ptr.hpp +53 -22
- package/src/duckdb/src/include/duckdb/common/vector.hpp +5 -2
- package/src/duckdb/src/include/duckdb/execution/aggregate_hashtable.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/join_hashtable.hpp +4 -4
- package/src/duckdb/src/include/duckdb/execution/operator/join/outer_join_marker.hpp +1 -1
- 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_range_join.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/base_csv_reader.hpp +0 -2
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/buffered_csv_reader.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/csv_file_handle.hpp +27 -127
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/parallel_csv_reader.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/perfect_aggregate_hashtable.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/window_segment_tree.hpp +1 -1
- package/src/duckdb/src/include/duckdb/function/table/read_csv.hpp +2 -4
- package/src/duckdb/src/include/duckdb/optimizer/join_order/join_relation.hpp +3 -3
- package/src/duckdb/src/include/duckdb/parser/statement/insert_statement.hpp +5 -0
- package/src/duckdb/src/include/duckdb/storage/arena_allocator.hpp +2 -2
- package/src/duckdb/src/include/duckdb/storage/buffer/buffer_handle.hpp +9 -2
- package/src/duckdb/src/include/duckdb/storage/statistics/base_statistics.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/table/append_state.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/table/scan_state.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/table/update_segment.hpp +2 -2
- package/src/duckdb/src/optimizer/join_order/join_relation_set.cpp +5 -5
- package/src/duckdb/src/optimizer/unnest_rewriter.cpp +14 -6
- package/src/duckdb/src/parser/statement/insert_statement.cpp +4 -1
- package/src/duckdb/src/parser/transform/statement/transform_insert.cpp +10 -0
- package/src/duckdb/src/planner/binder/statement/bind_insert.cpp +32 -7
- package/src/duckdb/src/storage/arena_allocator.cpp +1 -1
- package/src/duckdb/src/storage/buffer/buffer_handle.cpp +2 -11
- package/src/duckdb/src/storage/checkpoint/write_overflow_strings_to_disk.cpp +1 -1
- package/src/duckdb/src/storage/compression/string_uncompressed.cpp +2 -2
- package/src/duckdb/src/storage/statistics/list_stats.cpp +1 -1
- package/src/duckdb/src/storage/statistics/struct_stats.cpp +1 -1
- package/src/duckdb/src/storage/table/row_group.cpp +2 -2
- package/src/duckdb/src/storage/table/update_segment.cpp +7 -6
- package/src/duckdb/third_party/fsst/libfsst.cpp +1 -2
- package/src/duckdb/third_party/libpg_query/include/nodes/nodes.hpp +9 -0
- package/src/duckdb/third_party/libpg_query/include/nodes/parsenodes.hpp +13 -12
- package/src/duckdb/third_party/libpg_query/include/parser/gram.hpp +2 -1
- package/src/duckdb/third_party/libpg_query/src_backend_parser_gram.cpp +12537 -12415
- package/src/duckdb/ub_src_execution_operator_persistent.cpp +2 -0
- package/src/statement.cpp +15 -13
@@ -7,7 +7,7 @@ namespace duckdb {
|
|
7
7
|
|
8
8
|
void StructStats::Construct(BaseStatistics &stats) {
|
9
9
|
auto &child_types = StructType::GetChildTypes(stats.GetType());
|
10
|
-
stats.child_stats =
|
10
|
+
stats.child_stats = unsafe_array_ptr<BaseStatistics>(new BaseStatistics[child_types.size()]);
|
11
11
|
for (idx_t i = 0; i < child_types.size(); i++) {
|
12
12
|
BaseStatistics::Construct(stats.child_stats[i], child_types[i].second);
|
13
13
|
}
|
@@ -155,7 +155,7 @@ void ColumnScanState::Initialize(const LogicalType &type) {
|
|
155
155
|
|
156
156
|
void CollectionScanState::Initialize(const vector<LogicalType> &types) {
|
157
157
|
auto &column_ids = GetColumnIds();
|
158
|
-
column_scans =
|
158
|
+
column_scans = make_unsafe_array<ColumnScanState>(column_ids.size());
|
159
159
|
for (idx_t i = 0; i < column_ids.size(); i++) {
|
160
160
|
if (column_ids[i] == COLUMN_IDENTIFIER_ROW_ID) {
|
161
161
|
continue;
|
@@ -695,7 +695,7 @@ void RowGroup::InitializeAppend(RowGroupAppendState &append_state) {
|
|
695
695
|
append_state.row_group = this;
|
696
696
|
append_state.offset_in_row_group = this->count;
|
697
697
|
// for each column, initialize the append state
|
698
|
-
append_state.states =
|
698
|
+
append_state.states = make_unsafe_array<ColumnAppendState>(GetColumnCount());
|
699
699
|
for (idx_t i = 0; i < GetColumnCount(); i++) {
|
700
700
|
auto &col_data = GetColumn(i);
|
701
701
|
col_data.InitializeAppend(append_state.states[i]);
|
@@ -1042,8 +1042,9 @@ static idx_t SortSelectionVector(SelectionVector &sel, idx_t count, row_t *ids)
|
|
1042
1042
|
return pos;
|
1043
1043
|
}
|
1044
1044
|
|
1045
|
-
UpdateInfo *CreateEmptyUpdateInfo(TransactionData transaction, idx_t type_size, idx_t count,
|
1046
|
-
|
1045
|
+
UpdateInfo *CreateEmptyUpdateInfo(TransactionData transaction, idx_t type_size, idx_t count,
|
1046
|
+
unsafe_array_ptr<char> &data) {
|
1047
|
+
data = make_unsafe_array<char>(sizeof(UpdateInfo) + (sizeof(sel_t) + type_size) * STANDARD_VECTOR_SIZE);
|
1047
1048
|
auto update_info = (UpdateInfo *)data.get();
|
1048
1049
|
update_info->max = STANDARD_VECTOR_SIZE;
|
1049
1050
|
update_info->tuples = (sel_t *)(((data_ptr_t)update_info) + sizeof(UpdateInfo));
|
@@ -1109,7 +1110,7 @@ void UpdateSegment::Update(TransactionData transaction, idx_t column_index, Vect
|
|
1109
1110
|
}
|
1110
1111
|
node = node->next;
|
1111
1112
|
}
|
1112
|
-
|
1113
|
+
unsafe_array_ptr<char> update_info_data;
|
1113
1114
|
if (!node) {
|
1114
1115
|
// no updates made yet by this transaction: initially the update info to empty
|
1115
1116
|
if (transaction.transaction) {
|
@@ -1144,8 +1145,8 @@ void UpdateSegment::Update(TransactionData transaction, idx_t column_index, Vect
|
|
1144
1145
|
auto result = make_uniq<UpdateNodeData>();
|
1145
1146
|
|
1146
1147
|
result->info = make_uniq<UpdateInfo>();
|
1147
|
-
result->tuples =
|
1148
|
-
result->tuple_data =
|
1148
|
+
result->tuples = make_unsafe_array<sel_t>(STANDARD_VECTOR_SIZE);
|
1149
|
+
result->tuple_data = make_unsafe_array<data_t>(STANDARD_VECTOR_SIZE * type_size);
|
1149
1150
|
result->info->tuples = result->tuples.get();
|
1150
1151
|
result->info->tuple_data = result->tuple_data.get();
|
1151
1152
|
result->info->version_number = TRANSACTION_ID_START - 1;
|
@@ -1153,7 +1154,7 @@ void UpdateSegment::Update(TransactionData transaction, idx_t column_index, Vect
|
|
1153
1154
|
InitializeUpdateInfo(*result->info, ids, sel, count, vector_index, vector_offset);
|
1154
1155
|
|
1155
1156
|
// now create the transaction level update info in the undo log
|
1156
|
-
|
1157
|
+
unsafe_array_ptr<char> update_info_data;
|
1157
1158
|
UpdateInfo *transaction_node;
|
1158
1159
|
if (transaction.transaction) {
|
1159
1160
|
transaction_node = transaction.transaction->CreateUpdateInfo(type_size, count);
|
@@ -381,8 +381,7 @@ static inline size_t compressBulk(SymbolTable &symbolTable, size_t nlines, size_
|
|
381
381
|
size_t curLine, suffixLim = symbolTable.suffixLim;
|
382
382
|
u8 byteLim = symbolTable.nSymbols + symbolTable.zeroTerminated - symbolTable.lenHisto[0];
|
383
383
|
|
384
|
-
u8 buf[512+7]; /* +7 sentinel is to avoid 8-byte unaligned-loads going beyond 511 out-of-bounds */
|
385
|
-
memset(buf+511, 0, 8); /* and initialize the sentinal bytes */
|
384
|
+
u8 buf[512+7] = {}; /* +7 sentinel is to avoid 8-byte unaligned-loads going beyond 511 out-of-bounds */
|
386
385
|
|
387
386
|
// three variants are possible. dead code falls away since the bool arguments are constants
|
388
387
|
auto compressVariant = [&](bool noSuffixOpt, bool avoidBranch) {
|
@@ -814,4 +814,13 @@ typedef enum PGOnConflictActionAlias {
|
|
814
814
|
PG_ONCONFLICT_ALIAS_IGNORE /* INSERT OR IGNORE */
|
815
815
|
} PGOnConflictActionAlias;
|
816
816
|
|
817
|
+
/*
|
818
|
+
* PGInsertByNameOrPosition
|
819
|
+
* "INSERT BY [POSITION|NAME]
|
820
|
+
*/
|
821
|
+
typedef enum PGInsertColumnOrder {
|
822
|
+
PG_INSERT_BY_POSITION, /* INSERT BY POSITION (default behavior) */
|
823
|
+
PG_INSERT_BY_NAME, /* INSERT BY NAME */
|
824
|
+
} PGInsertColumnOrder;
|
825
|
+
|
817
826
|
}
|
@@ -1045,11 +1045,11 @@ typedef struct PGInferClause {
|
|
1045
1045
|
*/
|
1046
1046
|
typedef struct PGOnConflictClause {
|
1047
1047
|
PGNodeTag type;
|
1048
|
-
PGOnConflictAction action;
|
1049
|
-
PGInferClause *infer;
|
1050
|
-
PGList *targetList;
|
1051
|
-
PGNode *whereClause;
|
1052
|
-
int location;
|
1048
|
+
PGOnConflictAction action; /* DO NOTHING or UPDATE? */
|
1049
|
+
PGInferClause *infer; /* Optional index inference clause */
|
1050
|
+
PGList *targetList; /* the target list (of PGResTarget) */
|
1051
|
+
PGNode *whereClause; /* qualifications */
|
1052
|
+
int location; /* token location, or -1 if unknown */
|
1053
1053
|
} PGOnConflictClause;
|
1054
1054
|
|
1055
1055
|
/*
|
@@ -1125,14 +1125,15 @@ typedef struct PGRawStmt {
|
|
1125
1125
|
*/
|
1126
1126
|
typedef struct PGInsertStmt {
|
1127
1127
|
PGNodeTag type;
|
1128
|
-
PGRangeVar *relation;
|
1129
|
-
PGList *cols;
|
1130
|
-
PGNode *selectStmt;
|
1128
|
+
PGRangeVar *relation; /* relation to insert into */
|
1129
|
+
PGList *cols; /* optional: names of the target columns */
|
1130
|
+
PGNode *selectStmt; /* the source SELECT/VALUES, or NULL */
|
1131
1131
|
PGOnConflictActionAlias onConflictAlias; /* the (optional) shorthand provided for the onConflictClause */
|
1132
|
-
PGOnConflictClause *onConflictClause;
|
1133
|
-
PGList *returningList;
|
1134
|
-
PGWithClause *withClause;
|
1135
|
-
PGOverridingKind override;
|
1132
|
+
PGOnConflictClause *onConflictClause; /* ON CONFLICT clause */
|
1133
|
+
PGList *returningList; /* list of expressions to return */
|
1134
|
+
PGWithClause *withClause; /* WITH clause */
|
1135
|
+
PGOverridingKind override; /* OVERRIDING clause */
|
1136
|
+
PGInsertColumnOrder insert_column_order; /* INSERT BY NAME or INSERT BY POSITION */
|
1136
1137
|
} PGInsertStmt;
|
1137
1138
|
|
1138
1139
|
/* ----------------------
|
@@ -1065,9 +1065,10 @@ typedef union YYSTYPE
|
|
1065
1065
|
PGLockWaitPolicy lockwaitpolicy;
|
1066
1066
|
PGSubLinkType subquerytype;
|
1067
1067
|
PGViewCheckOption viewcheckoption;
|
1068
|
+
PGInsertColumnOrder bynameorposition;
|
1068
1069
|
}
|
1069
1070
|
/* Line 1529 of yacc.c. */
|
1070
|
-
#line
|
1071
|
+
#line 1072 "third_party/libpg_query/grammar/grammar_out.hpp"
|
1071
1072
|
YYSTYPE;
|
1072
1073
|
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
1073
1074
|
# define YYSTYPE_IS_DECLARED 1
|