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
@@ -0,0 +1,170 @@
|
|
1
|
+
#include "duckdb/common/types/row/tuple_data_segment.hpp"
|
2
|
+
|
3
|
+
#include "duckdb/common/types/row/tuple_data_allocator.hpp"
|
4
|
+
|
5
|
+
namespace duckdb {
|
6
|
+
|
7
|
+
TupleDataChunkPart::TupleDataChunkPart() {
|
8
|
+
}
|
9
|
+
|
10
|
+
void SwapTupleDataChunkPart(TupleDataChunkPart &a, TupleDataChunkPart &b) {
|
11
|
+
std::swap(a.row_block_index, b.row_block_index);
|
12
|
+
std::swap(a.row_block_offset, b.row_block_offset);
|
13
|
+
std::swap(a.heap_block_index, b.heap_block_index);
|
14
|
+
std::swap(a.heap_block_offset, b.heap_block_offset);
|
15
|
+
std::swap(a.base_heap_ptr, b.base_heap_ptr);
|
16
|
+
std::swap(a.total_heap_size, b.total_heap_size);
|
17
|
+
std::swap(a.count, b.count);
|
18
|
+
// Cannot swap the lock, but not needed as move constructor only happens during append, lock only needed for scans
|
19
|
+
}
|
20
|
+
|
21
|
+
TupleDataChunkPart::TupleDataChunkPart(TupleDataChunkPart &&other) noexcept {
|
22
|
+
SwapTupleDataChunkPart(*this, other);
|
23
|
+
}
|
24
|
+
|
25
|
+
TupleDataChunkPart &TupleDataChunkPart::operator=(TupleDataChunkPart &&other) noexcept {
|
26
|
+
SwapTupleDataChunkPart(*this, other);
|
27
|
+
return *this;
|
28
|
+
}
|
29
|
+
|
30
|
+
TupleDataChunk::TupleDataChunk() : count(0) {
|
31
|
+
}
|
32
|
+
|
33
|
+
static inline void SwapTupleDataChunk(TupleDataChunk &a, TupleDataChunk &b) noexcept {
|
34
|
+
std::swap(a.parts, b.parts);
|
35
|
+
std::swap(a.row_block_ids, b.row_block_ids);
|
36
|
+
std::swap(a.heap_block_ids, b.heap_block_ids);
|
37
|
+
std::swap(a.count, b.count);
|
38
|
+
}
|
39
|
+
|
40
|
+
TupleDataChunk::TupleDataChunk(TupleDataChunk &&other) noexcept {
|
41
|
+
SwapTupleDataChunk(*this, other);
|
42
|
+
}
|
43
|
+
|
44
|
+
TupleDataChunk &TupleDataChunk::operator=(TupleDataChunk &&other) noexcept {
|
45
|
+
SwapTupleDataChunk(*this, other);
|
46
|
+
return *this;
|
47
|
+
}
|
48
|
+
|
49
|
+
void TupleDataChunk::AddPart(TupleDataChunkPart &&part, const TupleDataLayout &layout) {
|
50
|
+
count += part.count;
|
51
|
+
row_block_ids.insert(part.row_block_index);
|
52
|
+
if (!layout.AllConstant() && part.total_heap_size > 0) {
|
53
|
+
heap_block_ids.insert(part.heap_block_index);
|
54
|
+
}
|
55
|
+
parts.emplace_back(std::move(part));
|
56
|
+
}
|
57
|
+
|
58
|
+
void TupleDataChunk::Verify() const {
|
59
|
+
#ifdef DEBUG
|
60
|
+
idx_t total_count = 0;
|
61
|
+
for (const auto &part : parts) {
|
62
|
+
total_count += part.count;
|
63
|
+
}
|
64
|
+
D_ASSERT(this->count == total_count);
|
65
|
+
D_ASSERT(this->count <= STANDARD_VECTOR_SIZE);
|
66
|
+
#endif
|
67
|
+
}
|
68
|
+
|
69
|
+
void TupleDataChunk::MergeLastChunkPart(const TupleDataLayout &layout) {
|
70
|
+
if (parts.size() < 2) {
|
71
|
+
return;
|
72
|
+
}
|
73
|
+
|
74
|
+
auto &second_to_last = parts[parts.size() - 2];
|
75
|
+
auto &last = parts[parts.size() - 1];
|
76
|
+
|
77
|
+
auto rows_align =
|
78
|
+
last.row_block_index == second_to_last.row_block_index &&
|
79
|
+
last.row_block_offset == second_to_last.row_block_offset + second_to_last.count * layout.GetRowWidth();
|
80
|
+
|
81
|
+
if (!rows_align) { // If rows don't align we can never merge
|
82
|
+
return;
|
83
|
+
}
|
84
|
+
|
85
|
+
if (layout.AllConstant()) { // No heap and rows align - merge
|
86
|
+
second_to_last.count += last.count;
|
87
|
+
parts.pop_back();
|
88
|
+
return;
|
89
|
+
}
|
90
|
+
|
91
|
+
if (last.heap_block_index == second_to_last.heap_block_index &&
|
92
|
+
last.heap_block_offset == second_to_last.heap_block_index + second_to_last.total_heap_size &&
|
93
|
+
last.base_heap_ptr == second_to_last.base_heap_ptr) { // There is a heap and it aligns - merge
|
94
|
+
second_to_last.total_heap_size += last.total_heap_size;
|
95
|
+
second_to_last.count += last.count;
|
96
|
+
parts.pop_back();
|
97
|
+
}
|
98
|
+
}
|
99
|
+
|
100
|
+
TupleDataSegment::TupleDataSegment(shared_ptr<TupleDataAllocator> allocator_p)
|
101
|
+
: allocator(std::move(allocator_p)), count(0) {
|
102
|
+
}
|
103
|
+
|
104
|
+
TupleDataSegment::~TupleDataSegment() {
|
105
|
+
lock_guard<mutex> guard(pinned_handles_lock);
|
106
|
+
pinned_row_handles.clear();
|
107
|
+
pinned_heap_handles.clear();
|
108
|
+
allocator = nullptr;
|
109
|
+
}
|
110
|
+
|
111
|
+
void SwapTupleDataSegment(TupleDataSegment &a, TupleDataSegment &b) {
|
112
|
+
std::swap(a.allocator, b.allocator);
|
113
|
+
std::swap(a.chunks, b.chunks);
|
114
|
+
std::swap(a.count, b.count);
|
115
|
+
std::swap(a.pinned_row_handles, b.pinned_row_handles);
|
116
|
+
std::swap(a.pinned_heap_handles, b.pinned_heap_handles);
|
117
|
+
}
|
118
|
+
|
119
|
+
TupleDataSegment::TupleDataSegment(TupleDataSegment &&other) noexcept {
|
120
|
+
SwapTupleDataSegment(*this, other);
|
121
|
+
}
|
122
|
+
|
123
|
+
TupleDataSegment &TupleDataSegment::operator=(TupleDataSegment &&other) noexcept {
|
124
|
+
SwapTupleDataSegment(*this, other);
|
125
|
+
return *this;
|
126
|
+
}
|
127
|
+
|
128
|
+
idx_t TupleDataSegment::ChunkCount() const {
|
129
|
+
return chunks.size();
|
130
|
+
}
|
131
|
+
|
132
|
+
idx_t TupleDataSegment::SizeInBytes() const {
|
133
|
+
const auto &layout = allocator->GetLayout();
|
134
|
+
idx_t total_size = 0;
|
135
|
+
for (const auto &chunk : chunks) {
|
136
|
+
total_size += chunk.count * layout.GetRowWidth();
|
137
|
+
if (!layout.AllConstant()) {
|
138
|
+
for (const auto &part : chunk.parts) {
|
139
|
+
total_size += part.total_heap_size;
|
140
|
+
}
|
141
|
+
}
|
142
|
+
}
|
143
|
+
return total_size;
|
144
|
+
}
|
145
|
+
|
146
|
+
void TupleDataSegment::Unpin() {
|
147
|
+
lock_guard<mutex> guard(pinned_handles_lock);
|
148
|
+
pinned_row_handles.clear();
|
149
|
+
pinned_heap_handles.clear();
|
150
|
+
}
|
151
|
+
|
152
|
+
void TupleDataSegment::Verify() const {
|
153
|
+
#ifdef DEBUG
|
154
|
+
idx_t total_count = 0;
|
155
|
+
for (const auto &chunk : chunks) {
|
156
|
+
chunk.Verify();
|
157
|
+
total_count += chunk.count;
|
158
|
+
}
|
159
|
+
D_ASSERT(total_count == this->count);
|
160
|
+
#endif
|
161
|
+
}
|
162
|
+
|
163
|
+
void TupleDataSegment::VerifyEverythingPinned() const {
|
164
|
+
#ifdef DEBUG
|
165
|
+
D_ASSERT(pinned_row_handles.size() == allocator->RowBlockCount());
|
166
|
+
D_ASSERT(pinned_heap_handles.size() == allocator->HeapBlockCount());
|
167
|
+
#endif
|
168
|
+
}
|
169
|
+
|
170
|
+
} // namespace duckdb
|
@@ -1351,7 +1351,7 @@ void Vector::Verify(Vector &vector_p, const SelectionVector &sel_p, idx_t count)
|
|
1351
1351
|
if (vtype != VectorType::FLAT_VECTOR) {
|
1352
1352
|
continue;
|
1353
1353
|
}
|
1354
|
-
ValidityMask
|
1354
|
+
optional_ptr<ValidityMask> child_validity;
|
1355
1355
|
SelectionVector owned_child_sel;
|
1356
1356
|
const SelectionVector *child_sel = &owned_child_sel;
|
1357
1357
|
if (children[child_idx]->GetVectorType() == VectorType::FLAT_VECTOR) {
|