duckdb 0.7.2-dev2867.0 → 0.7.2-dev3117.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/icu/icu-datepart.cpp +5 -1
- package/src/duckdb/extension/json/include/json_deserializer.hpp +1 -0
- package/src/duckdb/extension/json/include/json_serializer.hpp +8 -1
- package/src/duckdb/extension/json/json_functions/json_serialize_sql.cpp +1 -3
- package/src/duckdb/extension/json/json_functions/json_structure.cpp +3 -3
- package/src/duckdb/extension/json/json_functions/json_transform.cpp +3 -2
- package/src/duckdb/extension/parquet/parquet-extension.cpp +9 -7
- package/src/duckdb/src/catalog/catalog_entry/table_catalog_entry.cpp +18 -7
- package/src/duckdb/src/catalog/default/default_functions.cpp +2 -0
- package/src/duckdb/src/common/arrow/arrow_appender.cpp +3 -3
- package/src/duckdb/src/common/arrow/arrow_converter.cpp +2 -2
- package/src/duckdb/src/common/enum_util.cpp +5908 -0
- package/src/duckdb/src/common/enums/expression_type.cpp +216 -4
- package/src/duckdb/src/common/enums/join_type.cpp +6 -5
- package/src/duckdb/src/common/enums/physical_operator_type.cpp +2 -0
- package/src/duckdb/src/common/exception.cpp +1 -1
- package/src/duckdb/src/common/exception_format_value.cpp +2 -2
- package/src/duckdb/src/common/multi_file_reader.cpp +14 -0
- package/src/duckdb/src/common/serializer/binary_deserializer.cpp +143 -0
- package/src/duckdb/src/common/serializer/binary_serializer.cpp +160 -0
- package/src/duckdb/src/common/sort/partition_state.cpp +1 -1
- package/src/duckdb/src/common/string_util.cpp +6 -1
- package/src/duckdb/src/common/types/row/tuple_data_scatter_gather.cpp +3 -3
- package/src/duckdb/src/common/types.cpp +11 -10
- package/src/duckdb/src/common/vector_operations/is_distinct_from.cpp +4 -4
- package/src/duckdb/src/core_functions/function_list.cpp +2 -0
- package/src/duckdb/src/core_functions/scalar/date/date_part.cpp +2 -1
- package/src/duckdb/src/core_functions/scalar/list/list_sort.cpp +2 -3
- package/src/duckdb/src/core_functions/scalar/string/format_bytes.cpp +29 -0
- package/src/duckdb/src/execution/aggregate_hashtable.cpp +3 -3
- package/src/duckdb/src/execution/index/art/art.cpp +5 -1
- package/src/duckdb/src/execution/operator/aggregate/distinct_aggregate_data.cpp +1 -1
- package/src/duckdb/src/execution/operator/aggregate/grouped_aggregate_data.cpp +2 -2
- package/src/duckdb/src/execution/operator/aggregate/physical_hash_aggregate.cpp +65 -45
- package/src/duckdb/src/execution/operator/aggregate/physical_perfecthash_aggregate.cpp +17 -11
- package/src/duckdb/src/execution/operator/aggregate/physical_ungrouped_aggregate.cpp +32 -39
- package/src/duckdb/src/execution/operator/aggregate/physical_window.cpp +10 -9
- package/src/duckdb/src/execution/operator/helper/physical_batch_collector.cpp +4 -4
- package/src/duckdb/src/execution/operator/helper/physical_explain_analyze.cpp +6 -21
- package/src/duckdb/src/execution/operator/helper/physical_limit.cpp +13 -13
- package/src/duckdb/src/execution/operator/helper/physical_limit_percent.cpp +15 -14
- package/src/duckdb/src/execution/operator/helper/physical_load.cpp +3 -2
- package/src/duckdb/src/execution/operator/helper/physical_materialized_collector.cpp +4 -4
- package/src/duckdb/src/execution/operator/helper/physical_pragma.cpp +4 -2
- package/src/duckdb/src/execution/operator/helper/physical_prepare.cpp +4 -2
- package/src/duckdb/src/execution/operator/helper/physical_reservoir_sample.cpp +10 -8
- package/src/duckdb/src/execution/operator/helper/physical_reset.cpp +4 -3
- package/src/duckdb/src/execution/operator/helper/physical_set.cpp +7 -6
- package/src/duckdb/src/execution/operator/helper/physical_streaming_sample.cpp +2 -1
- package/src/duckdb/src/execution/operator/helper/physical_transaction.cpp +4 -2
- package/src/duckdb/src/execution/operator/helper/physical_vacuum.cpp +8 -8
- package/src/duckdb/src/execution/operator/join/physical_asof_join.cpp +17 -16
- package/src/duckdb/src/execution/operator/join/physical_blockwise_nl_join.cpp +12 -9
- package/src/duckdb/src/execution/operator/join/physical_comparison_join.cpp +2 -1
- package/src/duckdb/src/execution/operator/join/physical_cross_product.cpp +3 -4
- package/src/duckdb/src/execution/operator/join/physical_delim_join.cpp +5 -5
- package/src/duckdb/src/execution/operator/join/physical_hash_join.cpp +16 -15
- package/src/duckdb/src/execution/operator/join/physical_iejoin.cpp +13 -12
- package/src/duckdb/src/execution/operator/join/physical_nested_loop_join.cpp +12 -10
- package/src/duckdb/src/execution/operator/join/physical_piecewise_merge_join.cpp +13 -11
- package/src/duckdb/src/execution/operator/join/physical_positional_join.cpp +8 -6
- package/src/duckdb/src/execution/operator/join/physical_range_join.cpp +1 -1
- package/src/duckdb/src/execution/operator/order/physical_order.cpp +13 -13
- package/src/duckdb/src/execution/operator/order/physical_top_n.cpp +8 -8
- package/src/duckdb/src/execution/operator/persistent/physical_batch_copy_to_file.cpp +165 -0
- package/src/duckdb/src/execution/operator/persistent/physical_batch_insert.cpp +160 -145
- package/src/duckdb/src/execution/operator/persistent/physical_copy_to_file.cpp +11 -26
- package/src/duckdb/src/execution/operator/persistent/physical_delete.cpp +14 -19
- package/src/duckdb/src/execution/operator/persistent/physical_export.cpp +7 -6
- package/src/duckdb/src/execution/operator/persistent/physical_insert.cpp +18 -30
- package/src/duckdb/src/execution/operator/persistent/physical_update.cpp +14 -18
- package/src/duckdb/src/execution/operator/scan/physical_column_data_scan.cpp +6 -4
- package/src/duckdb/src/execution/operator/scan/physical_dummy_scan.cpp +4 -19
- package/src/duckdb/src/execution/operator/scan/physical_empty_result.cpp +3 -2
- package/src/duckdb/src/execution/operator/scan/physical_positional_scan.cpp +14 -5
- package/src/duckdb/src/execution/operator/scan/physical_table_scan.cpp +6 -4
- package/src/duckdb/src/execution/operator/schema/physical_alter.cpp +3 -19
- package/src/duckdb/src/execution/operator/schema/physical_attach.cpp +13 -25
- package/src/duckdb/src/execution/operator/schema/physical_create_function.cpp +4 -19
- package/src/duckdb/src/execution/operator/schema/physical_create_index.cpp +8 -9
- package/src/duckdb/src/execution/operator/schema/physical_create_schema.cpp +4 -19
- package/src/duckdb/src/execution/operator/schema/physical_create_sequence.cpp +4 -19
- package/src/duckdb/src/execution/operator/schema/physical_create_table.cpp +4 -19
- package/src/duckdb/src/execution/operator/schema/physical_create_type.cpp +9 -26
- package/src/duckdb/src/execution/operator/schema/physical_create_view.cpp +4 -19
- package/src/duckdb/src/execution/operator/schema/physical_detach.cpp +4 -19
- package/src/duckdb/src/execution/operator/schema/physical_drop.cpp +3 -19
- package/src/duckdb/src/execution/operator/set/physical_recursive_cte.cpp +9 -8
- package/src/duckdb/src/execution/operator/set/physical_union.cpp +1 -1
- package/src/duckdb/src/execution/partitionable_hashtable.cpp +2 -2
- package/src/duckdb/src/execution/physical_operator.cpp +11 -5
- package/src/duckdb/src/execution/physical_plan/plan_copy_to_file.cpp +25 -4
- package/src/duckdb/src/execution/physical_plan/plan_sample.cpp +2 -1
- package/src/duckdb/src/execution/radix_partitioned_hashtable.cpp +16 -16
- package/src/duckdb/src/function/scalar/operators/arithmetic.cpp +5 -4
- package/src/duckdb/src/function/table/arrow_conversion.cpp +3 -3
- package/src/duckdb/src/function/table/copy_csv.cpp +85 -29
- package/src/duckdb/src/function/table/read_csv.cpp +17 -11
- package/src/duckdb/src/function/table/system/duckdb_settings.cpp +2 -1
- package/src/duckdb/src/function/table/system/duckdb_types.cpp +2 -1
- package/src/duckdb/src/function/table/version/pragma_version.cpp +2 -2
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/table_catalog_entry.hpp +7 -1
- package/src/duckdb/src/include/duckdb/common/enum_util.hpp +958 -0
- package/src/duckdb/src/include/duckdb/common/enums/join_type.hpp +3 -3
- package/src/duckdb/src/include/duckdb/common/enums/operator_result_type.hpp +16 -4
- package/src/duckdb/src/include/duckdb/common/enums/physical_operator_type.hpp +1 -0
- package/src/duckdb/src/include/duckdb/common/exception.hpp +4 -4
- package/src/duckdb/src/include/duckdb/common/exception_format_value.hpp +3 -2
- package/src/duckdb/src/include/duckdb/common/multi_file_reader_options.hpp +44 -0
- package/src/duckdb/src/include/duckdb/common/optional_idx.hpp +45 -0
- package/src/duckdb/src/include/duckdb/common/serializer/binary_deserializer.hpp +93 -0
- package/src/duckdb/src/include/duckdb/common/serializer/binary_serializer.hpp +92 -0
- package/src/duckdb/src/include/duckdb/common/serializer/format_deserializer.hpp +7 -3
- package/src/duckdb/src/include/duckdb/common/serializer/format_serializer.hpp +2 -2
- package/src/duckdb/src/include/duckdb/common/set.hpp +2 -1
- package/src/duckdb/src/include/duckdb/common/types/row/tuple_data_collection.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/types/row/tuple_data_segment.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/types.hpp +1 -0
- package/src/duckdb/src/include/duckdb/common/vector.hpp +61 -14
- package/src/duckdb/src/include/duckdb/core_functions/scalar/string_functions.hpp +15 -0
- package/src/duckdb/src/include/duckdb/execution/aggregate_hashtable.hpp +3 -2
- package/src/duckdb/src/include/duckdb/execution/executor.hpp +10 -1
- package/src/duckdb/src/include/duckdb/execution/operator/aggregate/distinct_aggregate_data.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/aggregate/grouped_aggregate_data.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/aggregate/physical_hash_aggregate.hpp +8 -11
- package/src/duckdb/src/include/duckdb/execution/operator/aggregate/physical_perfecthash_aggregate.hpp +2 -4
- package/src/duckdb/src/include/duckdb/execution/operator/aggregate/physical_ungrouped_aggregate.hpp +3 -7
- package/src/duckdb/src/include/duckdb/execution/operator/aggregate/physical_window.hpp +2 -4
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_batch_collector.hpp +1 -2
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_explain_analyze.hpp +2 -5
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_limit.hpp +2 -4
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_limit_percent.hpp +2 -4
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_load.hpp +1 -2
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_materialized_collector.hpp +1 -2
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_pragma.hpp +1 -2
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_prepare.hpp +1 -2
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_reservoir_sample.hpp +2 -4
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_reset.hpp +1 -2
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_set.hpp +1 -2
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_transaction.hpp +1 -2
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_vacuum.hpp +2 -4
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_asof_join.hpp +2 -4
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_blockwise_nl_join.hpp +2 -4
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_cross_product.hpp +1 -2
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_delim_join.hpp +1 -2
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_hash_join.hpp +2 -4
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_iejoin.hpp +2 -4
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_nested_loop_join.hpp +2 -4
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_piecewise_merge_join.hpp +2 -4
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_positional_join.hpp +2 -4
- package/src/duckdb/src/include/duckdb/execution/operator/order/physical_order.hpp +2 -4
- package/src/duckdb/src/include/duckdb/execution/operator/order/physical_top_n.hpp +2 -4
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_batch_copy_to_file.hpp +68 -0
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_batch_insert.hpp +3 -5
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_copy_to_file.hpp +4 -5
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_delete.hpp +2 -4
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_export.hpp +2 -4
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_insert.hpp +2 -4
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_update.hpp +2 -4
- package/src/duckdb/src/include/duckdb/execution/operator/scan/physical_column_data_scan.hpp +1 -2
- package/src/duckdb/src/include/duckdb/execution/operator/scan/physical_dummy_scan.hpp +1 -3
- package/src/duckdb/src/include/duckdb/execution/operator/scan/physical_empty_result.hpp +1 -2
- package/src/duckdb/src/include/duckdb/execution/operator/scan/physical_positional_scan.hpp +1 -2
- package/src/duckdb/src/include/duckdb/execution/operator/scan/physical_table_scan.hpp +1 -2
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_alter.hpp +1 -3
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_attach.hpp +1 -3
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_create_function.hpp +1 -3
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_create_index.hpp +2 -4
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_create_schema.hpp +1 -3
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_create_sequence.hpp +1 -3
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_create_table.hpp +1 -3
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_create_type.hpp +2 -5
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_create_view.hpp +1 -3
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_detach.hpp +1 -3
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_drop.hpp +1 -3
- package/src/duckdb/src/include/duckdb/execution/operator/set/physical_recursive_cte.hpp +2 -4
- package/src/duckdb/src/include/duckdb/execution/partitionable_hashtable.hpp +3 -3
- package/src/duckdb/src/include/duckdb/execution/physical_operator.hpp +7 -4
- package/src/duckdb/src/include/duckdb/execution/physical_operator_states.hpp +26 -6
- package/src/duckdb/src/include/duckdb/execution/radix_partitioned_hashtable.hpp +6 -6
- package/src/duckdb/src/include/duckdb/function/aggregate_function.hpp +2 -1
- package/src/duckdb/src/include/duckdb/function/copy_function.hpp +32 -4
- package/src/duckdb/src/include/duckdb/function/table/read_csv.hpp +4 -2
- package/src/duckdb/src/include/duckdb/function/table_function.hpp +0 -1
- package/src/duckdb/src/include/duckdb/main/client_config.hpp +2 -0
- package/src/duckdb/src/include/duckdb/main/config.hpp +4 -0
- package/src/duckdb/src/include/duckdb/main/database.hpp +1 -3
- package/src/duckdb/src/include/duckdb/main/database_path_and_type.hpp +24 -0
- package/src/duckdb/src/include/duckdb/main/relation/setop_relation.hpp +1 -0
- package/src/duckdb/src/include/duckdb/parallel/event.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parallel/interrupt.hpp +63 -0
- package/src/duckdb/src/include/duckdb/parallel/pipeline.hpp +16 -3
- package/src/duckdb/src/include/duckdb/parallel/pipeline_executor.hpp +51 -7
- package/src/duckdb/src/include/duckdb/parallel/task.hpp +21 -2
- package/src/duckdb/src/include/duckdb/parallel/task_counter.hpp +2 -2
- package/src/duckdb/src/include/duckdb/parallel/task_scheduler.hpp +2 -2
- package/src/duckdb/src/include/duckdb/parser/parsed_data/sample_options.hpp +1 -0
- package/src/duckdb/src/include/duckdb/planner/column_binding.hpp +6 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_columnref_expression.hpp +1 -0
- package/src/duckdb/src/include/duckdb/planner/expression_binder/base_select_binder.hpp +2 -0
- package/src/duckdb/src/include/duckdb/planner/expression_binder.hpp +2 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_aggregate.hpp +2 -1
- package/src/duckdb/src/include/duckdb/planner/operator/logical_column_data_get.hpp +1 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_cteref.hpp +1 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_delete.hpp +1 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_delim_get.hpp +1 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_dummy_scan.hpp +1 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_expression_get.hpp +1 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_insert.hpp +1 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_pivot.hpp +1 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_projection.hpp +1 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_recursive_cte.hpp +1 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_set_operation.hpp +1 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_unnest.hpp +1 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_update.hpp +1 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_window.hpp +1 -0
- package/src/duckdb/src/include/duckdb/planner/query_node/bound_select_node.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/data_table.hpp +1 -0
- package/src/duckdb/src/include/duckdb/storage/optimistic_data_writer.hpp +46 -0
- package/src/duckdb/src/include/duckdb/storage/partial_block_manager.hpp +24 -3
- package/src/duckdb/src/include/duckdb/storage/table/column_checkpoint_state.hpp +46 -1
- package/src/duckdb/src/include/duckdb/storage/table/column_data.hpp +9 -10
- package/src/duckdb/src/include/duckdb/storage/table/column_segment.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/table/list_column_data.hpp +2 -2
- package/src/duckdb/src/include/duckdb/storage/table/row_group.hpp +3 -3
- package/src/duckdb/src/include/duckdb/storage/table/row_group_collection.hpp +1 -0
- package/src/duckdb/src/include/duckdb/storage/table/segment_base.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/table/segment_tree.hpp +22 -0
- package/src/duckdb/src/include/duckdb/storage/table/standard_column_data.hpp +3 -3
- package/src/duckdb/src/include/duckdb/storage/table/struct_column_data.hpp +2 -2
- package/src/duckdb/src/include/duckdb/storage/table/update_segment.hpp +0 -2
- package/src/duckdb/src/include/duckdb/storage/table/validity_column_data.hpp +1 -2
- package/src/duckdb/src/include/duckdb/transaction/local_storage.hpp +9 -34
- package/src/duckdb/src/include/duckdb/verification/deserialized_statement_verifier_v2.hpp +26 -0
- package/src/duckdb/src/include/duckdb/verification/no_operator_caching_verifier.hpp +25 -0
- package/src/duckdb/src/include/duckdb/verification/statement_verifier.hpp +6 -0
- package/src/duckdb/src/main/client_context.cpp +1 -0
- package/src/duckdb/src/main/client_verify.cpp +5 -0
- package/src/duckdb/src/main/config.cpp +4 -0
- package/src/duckdb/src/main/database.cpp +22 -34
- package/src/duckdb/src/main/database_path_and_type.cpp +23 -0
- package/src/duckdb/src/main/extension/extension_load.cpp +19 -15
- package/src/duckdb/src/main/relation/join_relation.cpp +2 -1
- package/src/duckdb/src/main/relation/setop_relation.cpp +2 -3
- package/src/duckdb/src/parallel/event.cpp +1 -1
- package/src/duckdb/src/parallel/executor.cpp +39 -3
- package/src/duckdb/src/parallel/executor_task.cpp +11 -0
- package/src/duckdb/src/parallel/interrupt.cpp +57 -0
- package/src/duckdb/src/parallel/pipeline.cpp +49 -6
- package/src/duckdb/src/parallel/pipeline_executor.cpp +248 -69
- package/src/duckdb/src/parallel/pipeline_initialize_event.cpp +1 -1
- package/src/duckdb/src/parallel/task_scheduler.cpp +57 -22
- package/src/duckdb/src/parser/base_expression.cpp +6 -0
- package/src/duckdb/src/parser/expression/window_expression.cpp +1 -1
- package/src/duckdb/src/parser/parsed_data/sample_options.cpp +2 -2
- package/src/duckdb/src/parser/query_node/select_node.cpp +1 -1
- package/src/duckdb/src/parser/result_modifier.cpp +2 -2
- package/src/duckdb/src/parser/statement/select_statement.cpp +0 -44
- package/src/duckdb/src/parser/tableref/joinref.cpp +3 -3
- package/src/duckdb/src/parser/tableref.cpp +1 -1
- package/src/duckdb/src/parser/transform/expression/transform_function.cpp +3 -3
- package/src/duckdb/src/planner/binder/expression/bind_columnref_expression.cpp +6 -0
- package/src/duckdb/src/planner/binder/expression/bind_function_expression.cpp +4 -1
- package/src/duckdb/src/planner/expression/bound_columnref_expression.cpp +17 -3
- package/src/duckdb/src/planner/expression/bound_reference_expression.cpp +8 -2
- package/src/duckdb/src/planner/expression_binder/base_select_binder.cpp +7 -0
- package/src/duckdb/src/planner/operator/logical_aggregate.cpp +14 -2
- package/src/duckdb/src/planner/operator/logical_column_data_get.cpp +11 -0
- package/src/duckdb/src/planner/operator/logical_comparison_join.cpp +2 -2
- package/src/duckdb/src/planner/operator/logical_cteref.cpp +11 -0
- package/src/duckdb/src/planner/operator/logical_delete.cpp +10 -0
- package/src/duckdb/src/planner/operator/logical_delim_get.cpp +12 -1
- package/src/duckdb/src/planner/operator/logical_dummy_scan.cpp +12 -1
- package/src/duckdb/src/planner/operator/logical_expression_get.cpp +12 -1
- package/src/duckdb/src/planner/operator/logical_get.cpp +10 -4
- package/src/duckdb/src/planner/operator/logical_insert.cpp +12 -1
- package/src/duckdb/src/planner/operator/logical_pivot.cpp +11 -0
- package/src/duckdb/src/planner/operator/logical_projection.cpp +11 -0
- package/src/duckdb/src/planner/operator/logical_recursive_cte.cpp +11 -0
- package/src/duckdb/src/planner/operator/logical_set_operation.cpp +11 -0
- package/src/duckdb/src/planner/operator/logical_unnest.cpp +12 -1
- package/src/duckdb/src/planner/operator/logical_update.cpp +10 -0
- package/src/duckdb/src/planner/operator/logical_window.cpp +11 -0
- package/src/duckdb/src/storage/checkpoint_manager.cpp +1 -1
- package/src/duckdb/src/storage/data_table.cpp +5 -0
- package/src/duckdb/src/storage/local_storage.cpp +40 -110
- package/src/duckdb/src/storage/optimistic_data_writer.cpp +96 -0
- package/src/duckdb/src/storage/partial_block_manager.cpp +73 -9
- package/src/duckdb/src/storage/single_file_block_manager.cpp +3 -1
- package/src/duckdb/src/storage/standard_buffer_manager.cpp +17 -12
- package/src/duckdb/src/storage/statistics/base_statistics.cpp +3 -0
- package/src/duckdb/src/storage/table/column_checkpoint_state.cpp +90 -82
- package/src/duckdb/src/storage/table/column_data.cpp +19 -45
- package/src/duckdb/src/storage/table/column_data_checkpointer.cpp +7 -7
- package/src/duckdb/src/storage/table/column_segment.cpp +1 -1
- package/src/duckdb/src/storage/table/list_column_data.cpp +6 -11
- package/src/duckdb/src/storage/table/row_group.cpp +13 -14
- package/src/duckdb/src/storage/table/row_group_collection.cpp +10 -4
- package/src/duckdb/src/storage/table/standard_column_data.cpp +6 -10
- package/src/duckdb/src/storage/table/struct_column_data.cpp +7 -13
- package/src/duckdb/src/storage/table/update_segment.cpp +0 -25
- package/src/duckdb/src/storage/table/validity_column_data.cpp +2 -6
- package/src/duckdb/src/transaction/commit_state.cpp +4 -4
- package/src/duckdb/src/verification/deserialized_statement_verifier.cpp +2 -1
- package/src/duckdb/src/verification/deserialized_statement_verifier_v2.cpp +20 -0
- package/src/duckdb/src/verification/no_operator_caching_verifier.cpp +13 -0
- package/src/duckdb/src/verification/statement_verifier.cpp +7 -0
- package/src/duckdb/ub_src_common.cpp +2 -2
- package/src/duckdb/ub_src_common_serializer.cpp +4 -2
- package/src/duckdb/ub_src_core_functions_scalar_string.cpp +2 -0
- package/src/duckdb/ub_src_execution_operator_persistent.cpp +2 -0
- package/src/duckdb/ub_src_main.cpp +2 -0
- package/src/duckdb/ub_src_parallel.cpp +2 -0
- package/src/duckdb/ub_src_storage.cpp +2 -0
- package/src/duckdb/src/common/serializer/enum_serializer.cpp +0 -1180
- package/src/duckdb/src/common/vector.cpp +0 -12
- package/src/duckdb/src/include/duckdb/common/serializer/enum_serializer.hpp +0 -113
@@ -41,6 +41,7 @@ public:
|
|
41
41
|
void Serialize(FieldWriter &writer) const override;
|
42
42
|
static unique_ptr<LogicalOperator> Deserialize(LogicalDeserializationState &state, FieldReader &reader);
|
43
43
|
vector<idx_t> GetTableIndex() const override;
|
44
|
+
string GetName() const override;
|
44
45
|
|
45
46
|
protected:
|
46
47
|
void ResolveTypes() override {
|
@@ -41,6 +41,7 @@ public:
|
|
41
41
|
void Serialize(FieldWriter &writer) const override;
|
42
42
|
static unique_ptr<LogicalOperator> Deserialize(LogicalDeserializationState &state, FieldReader &reader);
|
43
43
|
vector<idx_t> GetTableIndex() const override;
|
44
|
+
string GetName() const override;
|
44
45
|
|
45
46
|
protected:
|
46
47
|
void ResolveTypes() override {
|
@@ -29,6 +29,7 @@ public:
|
|
29
29
|
void Serialize(FieldWriter &writer) const override;
|
30
30
|
static unique_ptr<LogicalOperator> Deserialize(LogicalDeserializationState &state, FieldReader &reader);
|
31
31
|
vector<idx_t> GetTableIndex() const override;
|
32
|
+
string GetName() const override;
|
32
33
|
|
33
34
|
protected:
|
34
35
|
void ResolveTypes() override;
|
@@ -34,6 +34,7 @@ public:
|
|
34
34
|
void Serialize(FieldWriter &writer) const override;
|
35
35
|
static unique_ptr<LogicalOperator> Deserialize(LogicalDeserializationState &state, FieldReader &reader);
|
36
36
|
idx_t EstimateCardinality(ClientContext &context) override;
|
37
|
+
string GetName() const override;
|
37
38
|
|
38
39
|
protected:
|
39
40
|
vector<ColumnBinding> GetColumnBindings() override;
|
@@ -30,6 +30,7 @@ public:
|
|
30
30
|
void Serialize(FieldWriter &writer) const override;
|
31
31
|
static unique_ptr<LogicalOperator> Deserialize(LogicalDeserializationState &state, FieldReader &reader);
|
32
32
|
vector<idx_t> GetTableIndex() const override;
|
33
|
+
string GetName() const override;
|
33
34
|
|
34
35
|
protected:
|
35
36
|
void ResolveTypes() override;
|
@@ -78,7 +78,7 @@ public:
|
|
78
78
|
vector<unique_ptr<Expression>> aggregates;
|
79
79
|
|
80
80
|
//! GROUPING function calls
|
81
|
-
vector<
|
81
|
+
vector<unsafe_vector<idx_t>> grouping_functions;
|
82
82
|
|
83
83
|
//! Map from aggregate function to aggregate index (used to eliminate duplicate aggregates)
|
84
84
|
expression_map_t<idx_t> aggregate_map;
|
@@ -106,6 +106,7 @@ public:
|
|
106
106
|
void LocalMerge(ClientContext &context, RowGroupCollection &collection);
|
107
107
|
//! Creates an optimistic writer for this table - used for optimistically writing parallel appends
|
108
108
|
OptimisticDataWriter &CreateOptimisticWriter(ClientContext &context);
|
109
|
+
void FinalizeOptimisticWriter(ClientContext &context, OptimisticDataWriter &writer);
|
109
110
|
|
110
111
|
//! Delete the entries with the specified row identifier from the table
|
111
112
|
idx_t Delete(TableCatalogEntry &table, ClientContext &context, Vector &row_ids, idx_t count);
|
@@ -0,0 +1,46 @@
|
|
1
|
+
//===----------------------------------------------------------------------===//
|
2
|
+
// DuckDB
|
3
|
+
//
|
4
|
+
// duckdb/storage/optimistic_data_writer.hpp
|
5
|
+
//
|
6
|
+
//
|
7
|
+
//===----------------------------------------------------------------------===//
|
8
|
+
|
9
|
+
#pragma once
|
10
|
+
|
11
|
+
#include "duckdb/storage/table/row_group_collection.hpp"
|
12
|
+
|
13
|
+
namespace duckdb {
|
14
|
+
class PartialBlockManager;
|
15
|
+
|
16
|
+
class OptimisticDataWriter {
|
17
|
+
public:
|
18
|
+
OptimisticDataWriter(DataTable &table);
|
19
|
+
OptimisticDataWriter(DataTable &table, OptimisticDataWriter &parent);
|
20
|
+
~OptimisticDataWriter();
|
21
|
+
|
22
|
+
//! Write a new row group to disk (if possible)
|
23
|
+
void WriteNewRowGroup(RowGroupCollection &row_groups);
|
24
|
+
//! Write the last row group of a collection to disk
|
25
|
+
void WriteLastRowGroup(RowGroupCollection &row_groups);
|
26
|
+
//! Final flush of the optimistic writer - fully flushes the partial block manager
|
27
|
+
void FinalFlush();
|
28
|
+
//! Flushes a specific row group to disk
|
29
|
+
void FlushToDisk(RowGroup *row_group);
|
30
|
+
//! Merge the partially written blocks from one optimistic writer into another
|
31
|
+
void Merge(OptimisticDataWriter &other);
|
32
|
+
//! Rollback
|
33
|
+
void Rollback();
|
34
|
+
|
35
|
+
private:
|
36
|
+
//! Prepare a write to disk
|
37
|
+
bool PrepareWrite();
|
38
|
+
|
39
|
+
private:
|
40
|
+
//! The table
|
41
|
+
DataTable &table;
|
42
|
+
//! The partial block manager (if we created one yet)
|
43
|
+
unique_ptr<PartialBlockManager> partial_manager;
|
44
|
+
};
|
45
|
+
|
46
|
+
} // namespace duckdb
|
@@ -48,6 +48,14 @@ public:
|
|
48
48
|
virtual void Flush(idx_t free_space_left) = 0;
|
49
49
|
virtual void Clear() {
|
50
50
|
}
|
51
|
+
virtual void Merge(PartialBlock &other, idx_t offset, idx_t other_size);
|
52
|
+
|
53
|
+
public:
|
54
|
+
template <class TARGET>
|
55
|
+
TARGET &Cast() {
|
56
|
+
D_ASSERT(dynamic_cast<TARGET *>(this));
|
57
|
+
return (TARGET &)*this;
|
58
|
+
}
|
51
59
|
};
|
52
60
|
|
53
61
|
struct PartialBlockAllocation {
|
@@ -61,6 +69,8 @@ struct PartialBlockAllocation {
|
|
61
69
|
unique_ptr<PartialBlock> partial_block;
|
62
70
|
};
|
63
71
|
|
72
|
+
enum class CheckpointType { FULL_CHECKPOINT, APPEND_TO_TABLE };
|
73
|
+
|
64
74
|
//! Enables sharing blocks across some scope. Scope is whatever we want to share
|
65
75
|
//! blocks across. It may be an entire checkpoint or just a single row group.
|
66
76
|
//! In any case, they must share a block manager.
|
@@ -75,7 +85,8 @@ public:
|
|
75
85
|
static constexpr const idx_t MAX_BLOCK_MAP_SIZE = 1u << 31;
|
76
86
|
|
77
87
|
public:
|
78
|
-
PartialBlockManager(BlockManager &block_manager,
|
88
|
+
PartialBlockManager(BlockManager &block_manager, CheckpointType checkpoint_type,
|
89
|
+
uint32_t max_partial_block_size = DEFAULT_MAX_PARTIAL_BLOCK_SIZE,
|
79
90
|
uint32_t max_use_count = DEFAULT_MAX_USE_COUNT);
|
80
91
|
virtual ~PartialBlockManager();
|
81
92
|
|
@@ -87,18 +98,25 @@ public:
|
|
87
98
|
|
88
99
|
virtual void AllocateBlock(PartialBlockState &state, uint32_t segment_size);
|
89
100
|
|
101
|
+
void Merge(PartialBlockManager &other);
|
90
102
|
//! Register a partially filled block that is filled with "segment_size" entries
|
91
103
|
void RegisterPartialBlock(PartialBlockAllocation &&allocation);
|
92
104
|
|
93
|
-
//!
|
94
|
-
void
|
105
|
+
//! Clear remaining blocks without writing them to disk
|
106
|
+
void ClearBlocks();
|
107
|
+
|
108
|
+
//! Rollback all data written by this partial block manager
|
109
|
+
void Rollback();
|
95
110
|
|
96
111
|
protected:
|
97
112
|
BlockManager &block_manager;
|
113
|
+
CheckpointType checkpoint_type;
|
98
114
|
//! A map of (available space -> PartialBlock) for partially filled blocks
|
99
115
|
//! This is a multimap because there might be outstanding partial blocks with
|
100
116
|
//! the same amount of left-over space
|
101
117
|
multimap<idx_t, unique_ptr<PartialBlock>> partially_filled_blocks;
|
118
|
+
//! The set of written blocks
|
119
|
+
unordered_set<block_id_t> written_blocks;
|
102
120
|
|
103
121
|
//! The maximum size (in bytes) at which a partial block will be considered a partial block
|
104
122
|
uint32_t max_partial_block_size;
|
@@ -109,6 +127,9 @@ protected:
|
|
109
127
|
//! If successful, returns true and returns the block_id and offset_in_block to write to
|
110
128
|
//! Otherwise, returns false
|
111
129
|
bool GetPartialBlock(idx_t segment_size, unique_ptr<PartialBlock> &state);
|
130
|
+
|
131
|
+
bool HasBlockAllocation(uint32_t segment_size);
|
132
|
+
void AddWrittenBlock(block_id_t block);
|
112
133
|
};
|
113
134
|
|
114
135
|
} // namespace duckdb
|
@@ -15,6 +15,7 @@
|
|
15
15
|
#include "duckdb/storage/table/column_segment.hpp"
|
16
16
|
#include "duckdb/storage/table/column_data.hpp"
|
17
17
|
#include "duckdb/common/unordered_set.hpp"
|
18
|
+
#include "duckdb/storage/partial_block_manager.hpp"
|
18
19
|
|
19
20
|
namespace duckdb {
|
20
21
|
class ColumnData;
|
@@ -41,7 +42,51 @@ public:
|
|
41
42
|
|
42
43
|
virtual void FlushSegment(unique_ptr<ColumnSegment> segment, idx_t segment_size);
|
43
44
|
virtual void WriteDataPointers(RowGroupWriter &writer);
|
44
|
-
|
45
|
+
};
|
46
|
+
|
47
|
+
struct PartialBlockForCheckpoint : public PartialBlock {
|
48
|
+
struct PartialColumnSegment {
|
49
|
+
PartialColumnSegment(ColumnData &data, ColumnSegment &segment, uint32_t offset_in_block)
|
50
|
+
: data(data), segment(segment), offset_in_block(offset_in_block) {
|
51
|
+
}
|
52
|
+
|
53
|
+
ColumnData &data;
|
54
|
+
ColumnSegment &segment;
|
55
|
+
uint32_t offset_in_block;
|
56
|
+
};
|
57
|
+
|
58
|
+
public:
|
59
|
+
PartialBlockForCheckpoint(ColumnData &data, ColumnSegment &segment, BlockManager &block_manager,
|
60
|
+
PartialBlockState state);
|
61
|
+
~PartialBlockForCheckpoint() override;
|
62
|
+
|
63
|
+
// We will copy all segment data into the memory of the shared block.
|
64
|
+
// Once the block is full (or checkpoint is complete) we'll invoke Flush().
|
65
|
+
// This will cause the block to get written to storage (via BlockManger::ConvertToPersistent),
|
66
|
+
// and all segments to have their references updated (via ColumnSegment::ConvertToPersistent)
|
67
|
+
BlockManager &block_manager;
|
68
|
+
shared_ptr<BlockHandle> block;
|
69
|
+
vector<PartialColumnSegment> segments;
|
70
|
+
|
71
|
+
private:
|
72
|
+
struct UninitializedRegion {
|
73
|
+
idx_t start;
|
74
|
+
idx_t end;
|
75
|
+
};
|
76
|
+
vector<UninitializedRegion> uninitialized_regions;
|
77
|
+
|
78
|
+
public:
|
79
|
+
bool IsFlushed();
|
80
|
+
|
81
|
+
void AddUninitializedRegion(idx_t start, idx_t end) override;
|
82
|
+
|
83
|
+
void Flush(idx_t free_space_left) override;
|
84
|
+
|
85
|
+
void Clear() override;
|
86
|
+
|
87
|
+
void Merge(PartialBlock &other, idx_t offset, idx_t other_size) override;
|
88
|
+
|
89
|
+
void AddSegmentToTail(ColumnData &data, ColumnSegment &segment, uint32_t offset_in_block);
|
45
90
|
};
|
46
91
|
|
47
92
|
} // namespace duckdb
|
@@ -39,12 +39,11 @@ class ColumnData {
|
|
39
39
|
|
40
40
|
public:
|
41
41
|
ColumnData(BlockManager &block_manager, DataTableInfo &info, idx_t column_index, idx_t start_row, LogicalType type,
|
42
|
-
ColumnData
|
43
|
-
ColumnData(ColumnData &other, idx_t start, ColumnData *parent);
|
42
|
+
optional_ptr<ColumnData> parent);
|
44
43
|
virtual ~ColumnData();
|
45
44
|
|
46
45
|
//! The start row
|
47
|
-
|
46
|
+
idx_t start;
|
48
47
|
//! The count of the column data
|
49
48
|
idx_t count;
|
50
49
|
//! The block manager
|
@@ -56,7 +55,7 @@ public:
|
|
56
55
|
//! The type of the column
|
57
56
|
LogicalType type;
|
58
57
|
//! The parent column (if any)
|
59
|
-
ColumnData
|
58
|
+
optional_ptr<ColumnData> parent;
|
60
59
|
|
61
60
|
public:
|
62
61
|
virtual bool CheckZonemap(ColumnScanState &state, TableFilter &filter) = 0;
|
@@ -70,6 +69,7 @@ public:
|
|
70
69
|
|
71
70
|
void IncrementVersion();
|
72
71
|
|
72
|
+
virtual void SetStart(idx_t new_start);
|
73
73
|
//! The root type of the column
|
74
74
|
const LogicalType &RootType() const;
|
75
75
|
|
@@ -122,13 +122,13 @@ public:
|
|
122
122
|
virtual unique_ptr<ColumnCheckpointState>
|
123
123
|
Checkpoint(RowGroup &row_group, PartialBlockManager &partial_block_manager, ColumnCheckpointInfo &checkpoint_info);
|
124
124
|
|
125
|
-
virtual void CheckpointScan(ColumnSegment
|
125
|
+
virtual void CheckpointScan(ColumnSegment &segment, ColumnScanState &state, idx_t row_group_start, idx_t count,
|
126
126
|
Vector &scan_vector);
|
127
127
|
|
128
128
|
virtual void DeserializeColumn(Deserializer &source);
|
129
129
|
static shared_ptr<ColumnData> Deserialize(BlockManager &block_manager, DataTableInfo &info, idx_t column_index,
|
130
130
|
idx_t start_row, Deserializer &source, const LogicalType &type,
|
131
|
-
ColumnData
|
131
|
+
optional_ptr<ColumnData> parent);
|
132
132
|
|
133
133
|
virtual void GetStorageInfo(idx_t row_group_index, vector<idx_t> col_path, TableStorageInfo &result);
|
134
134
|
virtual void Verify(RowGroup &parent);
|
@@ -136,12 +136,11 @@ public:
|
|
136
136
|
bool CheckZonemap(TableFilter &filter);
|
137
137
|
|
138
138
|
static shared_ptr<ColumnData> CreateColumn(BlockManager &block_manager, DataTableInfo &info, idx_t column_index,
|
139
|
-
idx_t start_row, const LogicalType &type,
|
140
|
-
|
139
|
+
idx_t start_row, const LogicalType &type,
|
140
|
+
optional_ptr<ColumnData> parent = nullptr);
|
141
141
|
static unique_ptr<ColumnData> CreateColumnUnique(BlockManager &block_manager, DataTableInfo &info,
|
142
142
|
idx_t column_index, idx_t start_row, const LogicalType &type,
|
143
|
-
ColumnData
|
144
|
-
static unique_ptr<ColumnData> CreateColumnUnique(ColumnData &other, idx_t start_row, ColumnData *parent = nullptr);
|
143
|
+
optional_ptr<ColumnData> parent = nullptr);
|
145
144
|
|
146
145
|
void MergeStatistics(const BaseStatistics &other);
|
147
146
|
void MergeIntoStatistics(BaseStatistics &other);
|
@@ -93,7 +93,7 @@ public:
|
|
93
93
|
|
94
94
|
//! Convert a transient in-memory segment into a persistent segment blocked by an on-disk block.
|
95
95
|
//! Only used during checkpointing.
|
96
|
-
void ConvertToPersistent(BlockManager
|
96
|
+
void ConvertToPersistent(optional_ptr<BlockManager> block_manager, block_id_t block_id);
|
97
97
|
//! Updates pointers to refer to the given block and offset. This is only used
|
98
98
|
//! when sharing a block among segments. This is invoked only AFTER the block is written.
|
99
99
|
void MarkAsPersistent(shared_ptr<BlockHandle> block, uint32_t offset_in_block);
|
@@ -17,8 +17,7 @@ namespace duckdb {
|
|
17
17
|
class ListColumnData : public ColumnData {
|
18
18
|
public:
|
19
19
|
ListColumnData(BlockManager &block_manager, DataTableInfo &info, idx_t column_index, idx_t start_row,
|
20
|
-
LogicalType type, ColumnData
|
21
|
-
ListColumnData(ColumnData &original, idx_t start_row, ColumnData *parent = nullptr);
|
20
|
+
LogicalType type, optional_ptr<ColumnData> parent = nullptr);
|
22
21
|
|
23
22
|
//! The child-column of the list
|
24
23
|
unique_ptr<ColumnData> child_column;
|
@@ -26,6 +25,7 @@ public:
|
|
26
25
|
ValidityColumnData validity;
|
27
26
|
|
28
27
|
public:
|
28
|
+
void SetStart(idx_t new_start) override;
|
29
29
|
bool CheckZonemap(ColumnScanState &state, TableFilter &filter) override;
|
30
30
|
|
31
31
|
void InitializeScan(ColumnScanState &state) override;
|
@@ -59,20 +59,20 @@ public:
|
|
59
59
|
public:
|
60
60
|
RowGroup(RowGroupCollection &collection, idx_t start, idx_t count);
|
61
61
|
RowGroup(RowGroupCollection &collection, RowGroupPointer &&pointer);
|
62
|
-
RowGroup(RowGroup &row_group, RowGroupCollection &collection, idx_t start);
|
63
62
|
~RowGroup();
|
64
63
|
|
65
64
|
private:
|
66
65
|
//! The RowGroupCollection this row-group is a part of
|
67
|
-
RowGroupCollection
|
66
|
+
reference<RowGroupCollection> collection;
|
68
67
|
//! The version info of the row_group (inserted and deleted tuple info)
|
69
68
|
shared_ptr<VersionNode> version_info;
|
70
69
|
//! The column data of the row_group
|
71
70
|
vector<shared_ptr<ColumnData>> columns;
|
72
71
|
|
73
72
|
public:
|
73
|
+
void MoveToCollection(RowGroupCollection &collection, idx_t new_start);
|
74
74
|
RowGroupCollection &GetCollection() {
|
75
|
-
return collection;
|
75
|
+
return collection.get();
|
76
76
|
}
|
77
77
|
DatabaseInstance &GetDatabase();
|
78
78
|
BlockManager &GetBlockManager();
|
@@ -44,6 +44,7 @@ public:
|
|
44
44
|
void AppendRowGroup(SegmentLock &l, idx_t start_row);
|
45
45
|
//! Get the nth row-group, negative numbers start from the back (so -1 is the last row group, etc)
|
46
46
|
RowGroup *GetRowGroup(int64_t index);
|
47
|
+
idx_t RowGroupCount();
|
47
48
|
void Verify();
|
48
49
|
|
49
50
|
void InitializeScan(CollectionScanState &state, const vector<column_t> &column_ids, TableFilterSet *table_filters);
|
@@ -63,6 +63,14 @@ public:
|
|
63
63
|
LoadAllSegments(l);
|
64
64
|
return std::move(nodes);
|
65
65
|
}
|
66
|
+
vector<SegmentNode<T>> MoveSegments() {
|
67
|
+
auto l = Lock();
|
68
|
+
return MoveSegments(l);
|
69
|
+
}
|
70
|
+
idx_t GetSegmentCount() {
|
71
|
+
auto l = Lock();
|
72
|
+
return nodes.size();
|
73
|
+
}
|
66
74
|
//! Gets a pointer to the nth segment. Negative numbers start from the back.
|
67
75
|
T *GetSegmentByIndex(int64_t index) {
|
68
76
|
auto l = Lock();
|
@@ -243,6 +251,20 @@ public:
|
|
243
251
|
return SegmentIterationHelper(*this);
|
244
252
|
}
|
245
253
|
|
254
|
+
void Reinitialize() {
|
255
|
+
if (nodes.empty()) {
|
256
|
+
return;
|
257
|
+
}
|
258
|
+
idx_t offset = nodes[0].node->start;
|
259
|
+
for (auto &entry : nodes) {
|
260
|
+
if (entry.node->start != offset) {
|
261
|
+
throw InternalException("In SegmentTree::Reinitialize - gap found between nodes!");
|
262
|
+
}
|
263
|
+
entry.row_start = offset;
|
264
|
+
offset += entry.node->count;
|
265
|
+
}
|
266
|
+
}
|
267
|
+
|
246
268
|
protected:
|
247
269
|
atomic<bool> finished_loading;
|
248
270
|
|
@@ -17,13 +17,13 @@ namespace duckdb {
|
|
17
17
|
class StandardColumnData : public ColumnData {
|
18
18
|
public:
|
19
19
|
StandardColumnData(BlockManager &block_manager, DataTableInfo &info, idx_t column_index, idx_t start_row,
|
20
|
-
LogicalType type, ColumnData
|
21
|
-
StandardColumnData(ColumnData &original, idx_t start_row, ColumnData *parent = nullptr);
|
20
|
+
LogicalType type, optional_ptr<ColumnData> parent = nullptr);
|
22
21
|
|
23
22
|
//! The validity column data
|
24
23
|
ValidityColumnData validity;
|
25
24
|
|
26
25
|
public:
|
26
|
+
void SetStart(idx_t new_start) override;
|
27
27
|
bool CheckZonemap(ColumnScanState &state, TableFilter &filter) override;
|
28
28
|
|
29
29
|
void InitializeScan(ColumnScanState &state) override;
|
@@ -51,7 +51,7 @@ public:
|
|
51
51
|
PartialBlockManager &partial_block_manager) override;
|
52
52
|
unique_ptr<ColumnCheckpointState> Checkpoint(RowGroup &row_group, PartialBlockManager &partial_block_manager,
|
53
53
|
ColumnCheckpointInfo &checkpoint_info) override;
|
54
|
-
void CheckpointScan(ColumnSegment
|
54
|
+
void CheckpointScan(ColumnSegment &segment, ColumnScanState &state, idx_t row_group_start, idx_t count,
|
55
55
|
Vector &scan_vector) override;
|
56
56
|
|
57
57
|
void DeserializeColumn(Deserializer &source) override;
|
@@ -17,8 +17,7 @@ namespace duckdb {
|
|
17
17
|
class StructColumnData : public ColumnData {
|
18
18
|
public:
|
19
19
|
StructColumnData(BlockManager &block_manager, DataTableInfo &info, idx_t column_index, idx_t start_row,
|
20
|
-
LogicalType type, ColumnData
|
21
|
-
StructColumnData(ColumnData &original, idx_t start_row, ColumnData *parent = nullptr);
|
20
|
+
LogicalType type, optional_ptr<ColumnData> parent = nullptr);
|
22
21
|
|
23
22
|
//! The sub-columns of the struct
|
24
23
|
vector<unique_ptr<ColumnData>> sub_columns;
|
@@ -26,6 +25,7 @@ public:
|
|
26
25
|
ValidityColumnData validity;
|
27
26
|
|
28
27
|
public:
|
28
|
+
void SetStart(idx_t new_start) override;
|
29
29
|
bool CheckZonemap(ColumnScanState &state, TableFilter &filter) override;
|
30
30
|
idx_t GetMaxEntry() override;
|
31
31
|
|
@@ -23,8 +23,6 @@ struct UpdateNode;
|
|
23
23
|
class UpdateSegment {
|
24
24
|
public:
|
25
25
|
UpdateSegment(ColumnData &column_data);
|
26
|
-
// Construct a duplicate of 'other' with 'new_owner' as it's column data
|
27
|
-
UpdateSegment(UpdateSegment &other, ColumnData &new_owner);
|
28
26
|
~UpdateSegment();
|
29
27
|
|
30
28
|
ColumnData &column_data;
|
@@ -16,8 +16,7 @@ namespace duckdb {
|
|
16
16
|
class ValidityColumnData : public ColumnData {
|
17
17
|
public:
|
18
18
|
ValidityColumnData(BlockManager &block_manager, DataTableInfo &info, idx_t column_index, idx_t start_row,
|
19
|
-
ColumnData
|
20
|
-
ValidityColumnData(ColumnData &original, idx_t start_row, ColumnData *parent = nullptr);
|
19
|
+
ColumnData &parent);
|
21
20
|
|
22
21
|
public:
|
23
22
|
bool CheckZonemap(ColumnScanState &state, TableFilter &filter) override;
|
@@ -11,6 +11,7 @@
|
|
11
11
|
#include "duckdb/storage/table/row_group_collection.hpp"
|
12
12
|
#include "duckdb/storage/table/table_index_list.hpp"
|
13
13
|
#include "duckdb/storage/table/table_statistics.hpp"
|
14
|
+
#include "duckdb/storage/optimistic_data_writer.hpp"
|
14
15
|
|
15
16
|
namespace duckdb {
|
16
17
|
class AttachedDatabase;
|
@@ -20,35 +21,6 @@ class WriteAheadLog;
|
|
20
21
|
struct LocalAppendState;
|
21
22
|
struct TableAppendState;
|
22
23
|
|
23
|
-
class OptimisticDataWriter {
|
24
|
-
public:
|
25
|
-
OptimisticDataWriter(DataTable &table);
|
26
|
-
OptimisticDataWriter(DataTable &table, OptimisticDataWriter &parent);
|
27
|
-
~OptimisticDataWriter();
|
28
|
-
|
29
|
-
void CheckFlushToDisk(RowGroupCollection &row_groups);
|
30
|
-
//! Flushes a specific row group to disk
|
31
|
-
void FlushToDisk(RowGroup *row_group);
|
32
|
-
//! Flushes the final row group to disk (if any)
|
33
|
-
void FlushToDisk(RowGroupCollection &row_groups, bool force = false);
|
34
|
-
//! Final flush: flush the partial block manager to disk
|
35
|
-
void FinalFlush();
|
36
|
-
|
37
|
-
void Rollback();
|
38
|
-
|
39
|
-
private:
|
40
|
-
//! Prepare a write to disk
|
41
|
-
bool PrepareWrite();
|
42
|
-
|
43
|
-
private:
|
44
|
-
//! The table
|
45
|
-
DataTable &table;
|
46
|
-
//! The partial block manager (if we created one yet)
|
47
|
-
unique_ptr<PartialBlockManager> partial_manager;
|
48
|
-
//! The set of blocks that have been pre-emptively written to disk
|
49
|
-
unordered_set<block_id_t> written_blocks;
|
50
|
-
};
|
51
|
-
|
52
24
|
class LocalTableStorage : public std::enable_shared_from_this<LocalTableStorage> {
|
53
25
|
public:
|
54
26
|
// Create a new LocalTableStorage
|
@@ -76,13 +48,14 @@ public:
|
|
76
48
|
OptimisticDataWriter optimistic_writer;
|
77
49
|
//! The set of all optimistic data writers associated with this table
|
78
50
|
vector<unique_ptr<OptimisticDataWriter>> optimistic_writers;
|
51
|
+
//! Whether or not storage was merged
|
52
|
+
bool merged_storage = false;
|
79
53
|
|
80
54
|
public:
|
81
55
|
void InitializeScan(CollectionScanState &state, optional_ptr<TableFilterSet> table_filters = nullptr);
|
82
|
-
//!
|
83
|
-
void
|
84
|
-
|
85
|
-
void FlushToDisk();
|
56
|
+
//! Write a new row group to disk (if possible)
|
57
|
+
void WriteNewRowGroup();
|
58
|
+
void FlushBlocks();
|
86
59
|
void Rollback();
|
87
60
|
idx_t EstimatedSize();
|
88
61
|
|
@@ -93,6 +66,7 @@ public:
|
|
93
66
|
|
94
67
|
//! Creates an optimistic writer for this table
|
95
68
|
OptimisticDataWriter &CreateOptimisticWriter();
|
69
|
+
void FinalizeOptimisticWriter(OptimisticDataWriter &writer);
|
96
70
|
};
|
97
71
|
|
98
72
|
class LocalTableManager {
|
@@ -114,7 +88,7 @@ private:
|
|
114
88
|
class LocalStorage {
|
115
89
|
public:
|
116
90
|
// Threshold to merge row groups instead of appending
|
117
|
-
static constexpr const idx_t MERGE_THRESHOLD = RowGroup::ROW_GROUP_SIZE
|
91
|
+
static constexpr const idx_t MERGE_THRESHOLD = RowGroup::ROW_GROUP_SIZE;
|
118
92
|
|
119
93
|
public:
|
120
94
|
struct CommitState {
|
@@ -150,6 +124,7 @@ public:
|
|
150
124
|
void LocalMerge(DataTable &table, RowGroupCollection &collection);
|
151
125
|
//! Create an optimistic writer for the specified table
|
152
126
|
OptimisticDataWriter &CreateOptimisticWriter(DataTable &table);
|
127
|
+
void FinalizeOptimisticWriter(DataTable &table, OptimisticDataWriter &writer);
|
153
128
|
|
154
129
|
//! Delete a set of rows from the local storage
|
155
130
|
idx_t Delete(DataTable &table, Vector &row_ids, idx_t count);
|
@@ -0,0 +1,26 @@
|
|
1
|
+
//===----------------------------------------------------------------------===//
|
2
|
+
// DuckDB
|
3
|
+
//
|
4
|
+
// duckdb/verification/deserialized_statement_verifier_v2.hpp
|
5
|
+
//
|
6
|
+
//
|
7
|
+
//===----------------------------------------------------------------------===//
|
8
|
+
|
9
|
+
#pragma once
|
10
|
+
|
11
|
+
#include "duckdb/verification/statement_verifier.hpp"
|
12
|
+
|
13
|
+
namespace duckdb {
|
14
|
+
|
15
|
+
//------------------------------------------------------------------------------
|
16
|
+
// This is a temporary statement verifier that uses the new de/serialization
|
17
|
+
// infrastructure to verify the correctness of the de/serialization process.
|
18
|
+
// This verifier will be removed once the new de/serialization infrastructure
|
19
|
+
// (FormatDe/Serializer) replaces the old one.
|
20
|
+
class DeserializedStatementVerifierV2 : public StatementVerifier {
|
21
|
+
public:
|
22
|
+
explicit DeserializedStatementVerifierV2(unique_ptr<SQLStatement> statement_p);
|
23
|
+
static unique_ptr<StatementVerifier> Create(const SQLStatement &statement);
|
24
|
+
};
|
25
|
+
|
26
|
+
} // namespace duckdb
|
@@ -0,0 +1,25 @@
|
|
1
|
+
//===----------------------------------------------------------------------===//
|
2
|
+
// DuckDB
|
3
|
+
//
|
4
|
+
// duckdb/verification/unoptimized_statement_verifier.hpp
|
5
|
+
//
|
6
|
+
//
|
7
|
+
//===----------------------------------------------------------------------===//
|
8
|
+
|
9
|
+
#pragma once
|
10
|
+
|
11
|
+
#include "duckdb/verification/statement_verifier.hpp"
|
12
|
+
|
13
|
+
namespace duckdb {
|
14
|
+
|
15
|
+
class NoOperatorCachingVerifier : public StatementVerifier {
|
16
|
+
public:
|
17
|
+
explicit NoOperatorCachingVerifier(unique_ptr<SQLStatement> statement_p);
|
18
|
+
static unique_ptr<StatementVerifier> Create(const SQLStatement &statement_p);
|
19
|
+
|
20
|
+
bool DisableOperatorCaching() const override {
|
21
|
+
return true;
|
22
|
+
}
|
23
|
+
};
|
24
|
+
|
25
|
+
} // namespace duckdb
|
@@ -18,8 +18,10 @@ enum class VerificationType : uint8_t {
|
|
18
18
|
ORIGINAL,
|
19
19
|
COPIED,
|
20
20
|
DESERIALIZED,
|
21
|
+
DESERIALIZED_V2,
|
21
22
|
PARSED,
|
22
23
|
UNOPTIMIZED,
|
24
|
+
NO_OPERATOR_CACHING,
|
23
25
|
PREPARED,
|
24
26
|
EXTERNAL,
|
25
27
|
|
@@ -59,6 +61,10 @@ public:
|
|
59
61
|
return false;
|
60
62
|
}
|
61
63
|
|
64
|
+
virtual bool DisableOperatorCaching() const {
|
65
|
+
return false;
|
66
|
+
}
|
67
|
+
|
62
68
|
virtual bool ForceExternal() const {
|
63
69
|
return false;
|
64
70
|
}
|
@@ -495,6 +495,7 @@ unique_ptr<LogicalOperator> ClientContext::ExtractPlan(const string &query) {
|
|
495
495
|
}
|
496
496
|
|
497
497
|
unique_ptr<LogicalOperator> plan;
|
498
|
+
client_data->http_state = make_uniq<HTTPState>();
|
498
499
|
RunFunctionInTransactionInternal(*lock, [&]() {
|
499
500
|
Planner planner(*this);
|
500
501
|
planner.CreatePlan(std::move(statements[0]));
|