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
package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_batch_copy_to_file.hpp
ADDED
@@ -0,0 +1,68 @@
|
|
1
|
+
//===----------------------------------------------------------------------===//
|
2
|
+
// DuckDB
|
3
|
+
//
|
4
|
+
// duckdb/execution/operator/persistent/physical_batch_copy_to_file.hpp
|
5
|
+
//
|
6
|
+
//
|
7
|
+
//===----------------------------------------------------------------------===//
|
8
|
+
|
9
|
+
#pragma once
|
10
|
+
|
11
|
+
#include "duckdb/execution/physical_operator.hpp"
|
12
|
+
#include "duckdb/parser/parsed_data/copy_info.hpp"
|
13
|
+
#include "duckdb/function/copy_function.hpp"
|
14
|
+
#include "duckdb/common/file_system.hpp"
|
15
|
+
#include "duckdb/common/filename_pattern.hpp"
|
16
|
+
|
17
|
+
namespace duckdb {
|
18
|
+
|
19
|
+
//! Copy the contents of a query into a table
|
20
|
+
class PhysicalBatchCopyToFile : public PhysicalOperator {
|
21
|
+
public:
|
22
|
+
static constexpr const PhysicalOperatorType TYPE = PhysicalOperatorType::BATCH_COPY_TO_FILE;
|
23
|
+
|
24
|
+
public:
|
25
|
+
PhysicalBatchCopyToFile(vector<LogicalType> types, CopyFunction function, unique_ptr<FunctionData> bind_data,
|
26
|
+
idx_t estimated_cardinality);
|
27
|
+
|
28
|
+
CopyFunction function;
|
29
|
+
unique_ptr<FunctionData> bind_data;
|
30
|
+
string file_path;
|
31
|
+
bool use_tmp_file;
|
32
|
+
|
33
|
+
public:
|
34
|
+
// Source interface
|
35
|
+
SourceResultType GetData(ExecutionContext &context, DataChunk &chunk, OperatorSourceInput &input) const override;
|
36
|
+
|
37
|
+
bool IsSource() const override {
|
38
|
+
return true;
|
39
|
+
}
|
40
|
+
|
41
|
+
public:
|
42
|
+
// Sink interface
|
43
|
+
SinkResultType Sink(ExecutionContext &context, DataChunk &chunk, OperatorSinkInput &input) const override;
|
44
|
+
void Combine(ExecutionContext &context, GlobalSinkState &gstate, LocalSinkState &lstate) const override;
|
45
|
+
SinkFinalizeType Finalize(Pipeline &pipeline, Event &event, ClientContext &context,
|
46
|
+
GlobalSinkState &gstate) const override;
|
47
|
+
unique_ptr<LocalSinkState> GetLocalSinkState(ExecutionContext &context) const override;
|
48
|
+
unique_ptr<GlobalSinkState> GetGlobalSinkState(ClientContext &context) const override;
|
49
|
+
void NextBatch(ExecutionContext &context, GlobalSinkState &state, LocalSinkState &lstate_p) const override;
|
50
|
+
|
51
|
+
bool RequiresBatchIndex() const override {
|
52
|
+
return true;
|
53
|
+
}
|
54
|
+
|
55
|
+
bool IsSink() const override {
|
56
|
+
return true;
|
57
|
+
}
|
58
|
+
|
59
|
+
bool ParallelSink() const override {
|
60
|
+
return true;
|
61
|
+
}
|
62
|
+
|
63
|
+
private:
|
64
|
+
void PrepareBatchData(ClientContext &context, GlobalSinkState &gstate_p, idx_t batch_index,
|
65
|
+
unique_ptr<ColumnDataCollection> collection) const;
|
66
|
+
void FlushBatchData(ClientContext &context, GlobalSinkState &gstate_p, idx_t min_index) const;
|
67
|
+
};
|
68
|
+
} // namespace duckdb
|
package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_batch_insert.hpp
CHANGED
@@ -42,9 +42,7 @@ public:
|
|
42
42
|
|
43
43
|
public:
|
44
44
|
// Source interface
|
45
|
-
|
46
|
-
void GetData(ExecutionContext &context, DataChunk &chunk, GlobalSourceState &gstate,
|
47
|
-
LocalSourceState &lstate) const override;
|
45
|
+
SourceResultType GetData(ExecutionContext &context, DataChunk &chunk, OperatorSourceInput &input) const override;
|
48
46
|
|
49
47
|
bool IsSource() const override {
|
50
48
|
return true;
|
@@ -54,8 +52,8 @@ public:
|
|
54
52
|
// Sink interface
|
55
53
|
unique_ptr<GlobalSinkState> GetGlobalSinkState(ClientContext &context) const override;
|
56
54
|
unique_ptr<LocalSinkState> GetLocalSinkState(ExecutionContext &context) const override;
|
57
|
-
|
58
|
-
|
55
|
+
void NextBatch(ExecutionContext &context, GlobalSinkState &state, LocalSinkState &lstate_p) const override;
|
56
|
+
SinkResultType Sink(ExecutionContext &context, DataChunk &chunk, OperatorSinkInput &input) const override;
|
59
57
|
void Combine(ExecutionContext &context, GlobalSinkState &gstate, LocalSinkState &lstate) const override;
|
60
58
|
SinkFinalizeType Finalize(Pipeline &pipeline, Event &event, ClientContext &context,
|
61
59
|
GlobalSinkState &gstate) const override;
|
package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_copy_to_file.hpp
CHANGED
@@ -41,9 +41,7 @@ public:
|
|
41
41
|
|
42
42
|
public:
|
43
43
|
// Source interface
|
44
|
-
|
45
|
-
void GetData(ExecutionContext &context, DataChunk &chunk, GlobalSourceState &gstate,
|
46
|
-
LocalSourceState &lstate) const override;
|
44
|
+
SourceResultType GetData(ExecutionContext &context, DataChunk &chunk, OperatorSourceInput &input) const override;
|
47
45
|
|
48
46
|
bool IsSource() const override {
|
49
47
|
return true;
|
@@ -51,8 +49,7 @@ public:
|
|
51
49
|
|
52
50
|
public:
|
53
51
|
// Sink interface
|
54
|
-
SinkResultType Sink(ExecutionContext &context,
|
55
|
-
DataChunk &input) const override;
|
52
|
+
SinkResultType Sink(ExecutionContext &context, DataChunk &chunk, OperatorSinkInput &input) const override;
|
56
53
|
void Combine(ExecutionContext &context, GlobalSinkState &gstate, LocalSinkState &lstate) const override;
|
57
54
|
SinkFinalizeType Finalize(Pipeline &pipeline, Event &event, ClientContext &context,
|
58
55
|
GlobalSinkState &gstate) const override;
|
@@ -70,5 +67,7 @@ public:
|
|
70
67
|
bool ParallelSink() const override {
|
71
68
|
return per_thread_output || partition_output || parallel;
|
72
69
|
}
|
70
|
+
|
71
|
+
static void MoveTmpFile(ClientContext &context, const string &tmp_file_path);
|
73
72
|
};
|
74
73
|
} // namespace duckdb
|
@@ -33,8 +33,7 @@ public:
|
|
33
33
|
public:
|
34
34
|
// Source interface
|
35
35
|
unique_ptr<GlobalSourceState> GetGlobalSourceState(ClientContext &context) const override;
|
36
|
-
|
37
|
-
LocalSourceState &lstate) const override;
|
36
|
+
SourceResultType GetData(ExecutionContext &context, DataChunk &chunk, OperatorSourceInput &input) const override;
|
38
37
|
|
39
38
|
bool IsSource() const override {
|
40
39
|
return true;
|
@@ -44,8 +43,7 @@ public:
|
|
44
43
|
// Sink interface
|
45
44
|
unique_ptr<GlobalSinkState> GetGlobalSinkState(ClientContext &context) const override;
|
46
45
|
unique_ptr<LocalSinkState> GetLocalSinkState(ExecutionContext &context) const override;
|
47
|
-
SinkResultType Sink(ExecutionContext &context,
|
48
|
-
DataChunk &input) const override;
|
46
|
+
SinkResultType Sink(ExecutionContext &context, DataChunk &chunk, OperatorSinkInput &input) const override;
|
49
47
|
|
50
48
|
bool IsSink() const override {
|
51
49
|
return true;
|
@@ -38,8 +38,7 @@ public:
|
|
38
38
|
public:
|
39
39
|
// Source interface
|
40
40
|
unique_ptr<GlobalSourceState> GetGlobalSourceState(ClientContext &context) const override;
|
41
|
-
|
42
|
-
LocalSourceState &lstate) const override;
|
41
|
+
SourceResultType GetData(ExecutionContext &context, DataChunk &chunk, OperatorSourceInput &input) const override;
|
43
42
|
|
44
43
|
bool IsSource() const override {
|
45
44
|
return true;
|
@@ -47,8 +46,7 @@ public:
|
|
47
46
|
|
48
47
|
public:
|
49
48
|
// Sink interface
|
50
|
-
SinkResultType Sink(ExecutionContext &context,
|
51
|
-
DataChunk &input) const override;
|
49
|
+
SinkResultType Sink(ExecutionContext &context, DataChunk &chunk, OperatorSinkInput &input) const override;
|
52
50
|
|
53
51
|
bool ParallelSink() const override {
|
54
52
|
return true;
|
@@ -77,8 +77,7 @@ public:
|
|
77
77
|
public:
|
78
78
|
// Source interface
|
79
79
|
unique_ptr<GlobalSourceState> GetGlobalSourceState(ClientContext &context) const override;
|
80
|
-
|
81
|
-
LocalSourceState &lstate) const override;
|
80
|
+
SourceResultType GetData(ExecutionContext &context, DataChunk &chunk, OperatorSourceInput &input) const override;
|
82
81
|
|
83
82
|
bool IsSource() const override {
|
84
83
|
return true;
|
@@ -88,8 +87,7 @@ public:
|
|
88
87
|
// Sink interface
|
89
88
|
unique_ptr<GlobalSinkState> GetGlobalSinkState(ClientContext &context) const override;
|
90
89
|
unique_ptr<LocalSinkState> GetLocalSinkState(ExecutionContext &context) const override;
|
91
|
-
SinkResultType Sink(ExecutionContext &context,
|
92
|
-
DataChunk &input) const override;
|
90
|
+
SinkResultType Sink(ExecutionContext &context, DataChunk &chunk, OperatorSinkInput &input) const override;
|
93
91
|
void Combine(ExecutionContext &context, GlobalSinkState &gstate, LocalSinkState &lstate) const override;
|
94
92
|
SinkFinalizeType Finalize(Pipeline &pipeline, Event &event, ClientContext &context,
|
95
93
|
GlobalSinkState &gstate) const override;
|
@@ -36,8 +36,7 @@ public:
|
|
36
36
|
public:
|
37
37
|
// Source interface
|
38
38
|
unique_ptr<GlobalSourceState> GetGlobalSourceState(ClientContext &context) const override;
|
39
|
-
|
40
|
-
LocalSourceState &lstate) const override;
|
39
|
+
SourceResultType GetData(ExecutionContext &context, DataChunk &chunk, OperatorSourceInput &input) const override;
|
41
40
|
|
42
41
|
bool IsSource() const override {
|
43
42
|
return true;
|
@@ -47,8 +46,7 @@ public:
|
|
47
46
|
// Sink interface
|
48
47
|
unique_ptr<GlobalSinkState> GetGlobalSinkState(ClientContext &context) const override;
|
49
48
|
unique_ptr<LocalSinkState> GetLocalSinkState(ExecutionContext &context) const override;
|
50
|
-
SinkResultType Sink(ExecutionContext &context,
|
51
|
-
DataChunk &input) const override;
|
49
|
+
SinkResultType Sink(ExecutionContext &context, DataChunk &chunk, OperatorSinkInput &input) const override;
|
52
50
|
void Combine(ExecutionContext &context, GlobalSinkState &gstate, LocalSinkState &lstate) const override;
|
53
51
|
|
54
52
|
bool IsSink() const override {
|
@@ -29,8 +29,7 @@ public:
|
|
29
29
|
|
30
30
|
public:
|
31
31
|
unique_ptr<GlobalSourceState> GetGlobalSourceState(ClientContext &context) const override;
|
32
|
-
|
33
|
-
LocalSourceState &lstate) const override;
|
32
|
+
SourceResultType GetData(ExecutionContext &context, DataChunk &chunk, OperatorSourceInput &input) const override;
|
34
33
|
|
35
34
|
bool IsSource() const override {
|
36
35
|
return true;
|
@@ -22,9 +22,7 @@ public:
|
|
22
22
|
}
|
23
23
|
|
24
24
|
public:
|
25
|
-
|
26
|
-
void GetData(ExecutionContext &context, DataChunk &chunk, GlobalSourceState &gstate,
|
27
|
-
LocalSourceState &lstate) const override;
|
25
|
+
SourceResultType GetData(ExecutionContext &context, DataChunk &chunk, OperatorSourceInput &input) const override;
|
28
26
|
|
29
27
|
bool IsSource() const override {
|
30
28
|
return true;
|
@@ -22,8 +22,7 @@ public:
|
|
22
22
|
}
|
23
23
|
|
24
24
|
public:
|
25
|
-
|
26
|
-
LocalSourceState &lstate) const override;
|
25
|
+
SourceResultType GetData(ExecutionContext &context, DataChunk &chunk, OperatorSourceInput &input) const override;
|
27
26
|
|
28
27
|
bool IsSource() const override {
|
29
28
|
return true;
|
@@ -35,8 +35,7 @@ public:
|
|
35
35
|
unique_ptr<LocalSourceState> GetLocalSourceState(ExecutionContext &context,
|
36
36
|
GlobalSourceState &gstate) const override;
|
37
37
|
unique_ptr<GlobalSourceState> GetGlobalSourceState(ClientContext &context) const override;
|
38
|
-
|
39
|
-
LocalSourceState &lstate) const override;
|
38
|
+
SourceResultType GetData(ExecutionContext &context, DataChunk &chunk, OperatorSourceInput &input) const override;
|
40
39
|
|
41
40
|
double GetProgress(ClientContext &context, GlobalSourceState &gstate) const override;
|
42
41
|
|
@@ -55,8 +55,7 @@ public:
|
|
55
55
|
unique_ptr<LocalSourceState> GetLocalSourceState(ExecutionContext &context,
|
56
56
|
GlobalSourceState &gstate) const override;
|
57
57
|
unique_ptr<GlobalSourceState> GetGlobalSourceState(ClientContext &context) const override;
|
58
|
-
|
59
|
-
LocalSourceState &lstate) const override;
|
58
|
+
SourceResultType GetData(ExecutionContext &context, DataChunk &chunk, OperatorSourceInput &input) const override;
|
60
59
|
idx_t GetBatchIndex(ExecutionContext &context, DataChunk &chunk, GlobalSourceState &gstate,
|
61
60
|
LocalSourceState &lstate) const override;
|
62
61
|
|
@@ -28,9 +28,7 @@ public:
|
|
28
28
|
|
29
29
|
public:
|
30
30
|
// Source interface
|
31
|
-
|
32
|
-
void GetData(ExecutionContext &context, DataChunk &chunk, GlobalSourceState &gstate,
|
33
|
-
LocalSourceState &lstate) const override;
|
31
|
+
SourceResultType GetData(ExecutionContext &context, DataChunk &chunk, OperatorSourceInput &input) const override;
|
34
32
|
|
35
33
|
bool IsSource() const override {
|
36
34
|
return true;
|
@@ -28,9 +28,7 @@ public:
|
|
28
28
|
|
29
29
|
public:
|
30
30
|
// Source interface
|
31
|
-
|
32
|
-
void GetData(ExecutionContext &context, DataChunk &chunk, GlobalSourceState &gstate,
|
33
|
-
LocalSourceState &lstate) const override;
|
31
|
+
SourceResultType GetData(ExecutionContext &context, DataChunk &chunk, OperatorSourceInput &input) const override;
|
34
32
|
|
35
33
|
bool IsSource() const override {
|
36
34
|
return true;
|
package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_create_function.hpp
CHANGED
@@ -28,9 +28,7 @@ public:
|
|
28
28
|
|
29
29
|
public:
|
30
30
|
// Source interface
|
31
|
-
|
32
|
-
void GetData(ExecutionContext &context, DataChunk &chunk, GlobalSourceState &gstate,
|
33
|
-
LocalSourceState &lstate) const override;
|
31
|
+
SourceResultType GetData(ExecutionContext &context, DataChunk &chunk, OperatorSourceInput &input) const override;
|
34
32
|
|
35
33
|
bool IsSource() const override {
|
36
34
|
return true;
|
@@ -40,8 +40,7 @@ public:
|
|
40
40
|
|
41
41
|
public:
|
42
42
|
//! Source interface, NOP for this operator
|
43
|
-
|
44
|
-
LocalSourceState &lstate) const override;
|
43
|
+
SourceResultType GetData(ExecutionContext &context, DataChunk &chunk, OperatorSourceInput &input) const override;
|
45
44
|
|
46
45
|
bool IsSource() const override {
|
47
46
|
return true;
|
@@ -53,8 +52,7 @@ public:
|
|
53
52
|
//! Sink interface, global sink state
|
54
53
|
unique_ptr<GlobalSinkState> GetGlobalSinkState(ClientContext &context) const override;
|
55
54
|
|
56
|
-
SinkResultType Sink(ExecutionContext &context,
|
57
|
-
DataChunk &input) const override;
|
55
|
+
SinkResultType Sink(ExecutionContext &context, DataChunk &chunk, OperatorSinkInput &input) const override;
|
58
56
|
void Combine(ExecutionContext &context, GlobalSinkState &gstate_p, LocalSinkState &lstate_p) const override;
|
59
57
|
SinkFinalizeType Finalize(Pipeline &pipeline, Event &event, ClientContext &context,
|
60
58
|
GlobalSinkState &gstate) const override;
|
@@ -28,9 +28,7 @@ public:
|
|
28
28
|
|
29
29
|
public:
|
30
30
|
// Source interface
|
31
|
-
|
32
|
-
void GetData(ExecutionContext &context, DataChunk &chunk, GlobalSourceState &gstate,
|
33
|
-
LocalSourceState &lstate) const override;
|
31
|
+
SourceResultType GetData(ExecutionContext &context, DataChunk &chunk, OperatorSourceInput &input) const override;
|
34
32
|
|
35
33
|
bool IsSource() const override {
|
36
34
|
return true;
|
package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_create_sequence.hpp
CHANGED
@@ -28,9 +28,7 @@ public:
|
|
28
28
|
|
29
29
|
public:
|
30
30
|
// Source interface
|
31
|
-
|
32
|
-
void GetData(ExecutionContext &context, DataChunk &chunk, GlobalSourceState &gstate,
|
33
|
-
LocalSourceState &lstate) const override;
|
31
|
+
SourceResultType GetData(ExecutionContext &context, DataChunk &chunk, OperatorSourceInput &input) const override;
|
34
32
|
|
35
33
|
bool IsSource() const override {
|
36
34
|
return true;
|
@@ -29,9 +29,7 @@ public:
|
|
29
29
|
|
30
30
|
public:
|
31
31
|
// Source interface
|
32
|
-
|
33
|
-
void GetData(ExecutionContext &context, DataChunk &chunk, GlobalSourceState &gstate,
|
34
|
-
LocalSourceState &lstate) const override;
|
32
|
+
SourceResultType GetData(ExecutionContext &context, DataChunk &chunk, OperatorSourceInput &input) const override;
|
35
33
|
|
36
34
|
bool IsSource() const override {
|
37
35
|
return true;
|
@@ -25,9 +25,7 @@ public:
|
|
25
25
|
|
26
26
|
public:
|
27
27
|
// Source interface
|
28
|
-
|
29
|
-
void GetData(ExecutionContext &context, DataChunk &chunk, GlobalSourceState &gstate,
|
30
|
-
LocalSourceState &lstate) const override;
|
28
|
+
SourceResultType GetData(ExecutionContext &context, DataChunk &chunk, OperatorSourceInput &input) const override;
|
31
29
|
|
32
30
|
bool IsSource() const override {
|
33
31
|
return true;
|
@@ -37,8 +35,7 @@ public:
|
|
37
35
|
// Sink interface
|
38
36
|
unique_ptr<GlobalSinkState> GetGlobalSinkState(ClientContext &context) const override;
|
39
37
|
|
40
|
-
SinkResultType Sink(ExecutionContext &context,
|
41
|
-
DataChunk &input) const override;
|
38
|
+
SinkResultType Sink(ExecutionContext &context, DataChunk &chunk, OperatorSinkInput &input) const override;
|
42
39
|
|
43
40
|
bool IsSink() const override {
|
44
41
|
return info->query != nullptr;
|
@@ -28,9 +28,7 @@ public:
|
|
28
28
|
|
29
29
|
public:
|
30
30
|
// Source interface
|
31
|
-
|
32
|
-
void GetData(ExecutionContext &context, DataChunk &chunk, GlobalSourceState &gstate,
|
33
|
-
LocalSourceState &lstate) const override;
|
31
|
+
SourceResultType GetData(ExecutionContext &context, DataChunk &chunk, OperatorSourceInput &input) const override;
|
34
32
|
|
35
33
|
bool IsSource() const override {
|
36
34
|
return true;
|
@@ -27,9 +27,7 @@ public:
|
|
27
27
|
|
28
28
|
public:
|
29
29
|
// Source interface
|
30
|
-
|
31
|
-
void GetData(ExecutionContext &context, DataChunk &chunk, GlobalSourceState &gstate,
|
32
|
-
LocalSourceState &lstate) const override;
|
30
|
+
SourceResultType GetData(ExecutionContext &context, DataChunk &chunk, OperatorSourceInput &input) const override;
|
33
31
|
|
34
32
|
bool IsSource() const override {
|
35
33
|
return true;
|
@@ -28,9 +28,7 @@ public:
|
|
28
28
|
|
29
29
|
public:
|
30
30
|
// Source interface
|
31
|
-
|
32
|
-
void GetData(ExecutionContext &context, DataChunk &chunk, GlobalSourceState &gstate,
|
33
|
-
LocalSourceState &lstate) const override;
|
31
|
+
SourceResultType GetData(ExecutionContext &context, DataChunk &chunk, OperatorSourceInput &input) const override;
|
34
32
|
|
35
33
|
bool IsSource() const override {
|
36
34
|
return true;
|
@@ -30,8 +30,7 @@ public:
|
|
30
30
|
|
31
31
|
public:
|
32
32
|
// Source interface
|
33
|
-
|
34
|
-
LocalSourceState &lstate) const override;
|
33
|
+
SourceResultType GetData(ExecutionContext &context, DataChunk &chunk, OperatorSourceInput &input) const override;
|
35
34
|
|
36
35
|
bool IsSource() const override {
|
37
36
|
return true;
|
@@ -39,8 +38,7 @@ public:
|
|
39
38
|
|
40
39
|
public:
|
41
40
|
// Sink interface
|
42
|
-
SinkResultType Sink(ExecutionContext &context,
|
43
|
-
DataChunk &input) const override;
|
41
|
+
SinkResultType Sink(ExecutionContext &context, DataChunk &chunk, OperatorSinkInput &input) const override;
|
44
42
|
|
45
43
|
unique_ptr<GlobalSinkState> GetGlobalSinkState(ClientContext &context) const override;
|
46
44
|
|
@@ -32,7 +32,7 @@ public:
|
|
32
32
|
vector<LogicalType> group_types_p, vector<LogicalType> payload_types_p,
|
33
33
|
vector<BoundAggregateExpression *> bindings_p);
|
34
34
|
|
35
|
-
idx_t AddChunk(DataChunk &groups, DataChunk &payload, bool do_partition, const
|
35
|
+
idx_t AddChunk(DataChunk &groups, DataChunk &payload, bool do_partition, const unsafe_vector<idx_t> &filter);
|
36
36
|
void Partition();
|
37
37
|
bool IsPartitioned();
|
38
38
|
|
@@ -51,7 +51,7 @@ private:
|
|
51
51
|
bool is_partitioned;
|
52
52
|
RadixPartitionInfo &partition_info;
|
53
53
|
vector<SelectionVector> sel_vectors;
|
54
|
-
|
54
|
+
unsafe_vector<idx_t> sel_vector_sizes;
|
55
55
|
DataChunk group_subset, payload_subset;
|
56
56
|
Vector hashes, hashes_subset;
|
57
57
|
AggregateHTAppendState append_state;
|
@@ -62,7 +62,7 @@ private:
|
|
62
62
|
|
63
63
|
private:
|
64
64
|
idx_t ListAddChunk(HashTableList &list, DataChunk &groups, Vector &group_hashes, DataChunk &payload,
|
65
|
-
const
|
65
|
+
const unsafe_vector<idx_t> &filter);
|
66
66
|
//! Returns the HT entry size used for intermediate hash tables
|
67
67
|
HtEntryType GetHTEntrySize();
|
68
68
|
};
|
@@ -15,6 +15,7 @@
|
|
15
15
|
#include "duckdb/common/types/data_chunk.hpp"
|
16
16
|
#include "duckdb/execution/execution_context.hpp"
|
17
17
|
#include "duckdb/optimizer/join_order/join_node.hpp"
|
18
|
+
#include "duckdb/common/optional_idx.hpp"
|
18
19
|
#include "duckdb/execution/physical_operator_states.hpp"
|
19
20
|
#include "duckdb/common/enums/order_preservation_type.hpp"
|
20
21
|
|
@@ -102,8 +103,8 @@ public:
|
|
102
103
|
virtual unique_ptr<LocalSourceState> GetLocalSourceState(ExecutionContext &context,
|
103
104
|
GlobalSourceState &gstate) const;
|
104
105
|
virtual unique_ptr<GlobalSourceState> GetGlobalSourceState(ClientContext &context) const;
|
105
|
-
virtual
|
106
|
-
|
106
|
+
virtual SourceResultType GetData(ExecutionContext &context, DataChunk &chunk, OperatorSourceInput &input) const;
|
107
|
+
|
107
108
|
virtual idx_t GetBatchIndex(ExecutionContext &context, DataChunk &chunk, GlobalSourceState &gstate,
|
108
109
|
LocalSourceState &lstate) const;
|
109
110
|
|
@@ -132,8 +133,7 @@ public:
|
|
132
133
|
|
133
134
|
//! The sink method is called constantly with new input, as long as new input is available. Note that this method
|
134
135
|
//! CAN be called in parallel, proper locking is needed when accessing data inside the GlobalSinkState.
|
135
|
-
virtual SinkResultType Sink(ExecutionContext &context,
|
136
|
-
DataChunk &input) const;
|
136
|
+
virtual SinkResultType Sink(ExecutionContext &context, DataChunk &chunk, OperatorSinkInput &input) const;
|
137
137
|
// The combine is called when a single thread has completed execution of its part of the pipeline, it is the final
|
138
138
|
// time that a specific LocalSinkState is accessible. This method can be called in parallel while other Sink() or
|
139
139
|
// Combine() calls are active on the same GlobalSinkState.
|
@@ -143,6 +143,9 @@ public:
|
|
143
143
|
//! If Finalize returns SinkResultType::FINISHED, the sink is marked as finished
|
144
144
|
virtual SinkFinalizeType Finalize(Pipeline &pipeline, Event &event, ClientContext &context,
|
145
145
|
GlobalSinkState &gstate) const;
|
146
|
+
//! For sinks with RequiresBatchIndex set to true, when a new batch starts being processed this method is called
|
147
|
+
//! This allows flushing of the current batch (e.g. to disk)
|
148
|
+
virtual void NextBatch(ExecutionContext &context, GlobalSinkState &state, LocalSinkState &lstate_p) const;
|
146
149
|
|
147
150
|
virtual unique_ptr<LocalSinkState> GetLocalSinkState(ExecutionContext &context) const;
|
148
151
|
virtual unique_ptr<GlobalSinkState> GetGlobalSinkState(ClientContext &context) const;
|
@@ -23,6 +23,18 @@ class PhysicalOperator;
|
|
23
23
|
class Pipeline;
|
24
24
|
class PipelineBuildState;
|
25
25
|
class MetaPipeline;
|
26
|
+
class InterruptState;
|
27
|
+
|
28
|
+
struct SourcePartitionInfo {
|
29
|
+
//! The current batch index
|
30
|
+
//! This is only set in case RequiresBatchIndex() is true, and the source has support for it (SupportsBatchIndex())
|
31
|
+
//! Otherwise this is left on INVALID_INDEX
|
32
|
+
//! The batch index is a globally unique, increasing index that should be used to maintain insertion order
|
33
|
+
//! //! in conjunction with parallelism
|
34
|
+
optional_idx batch_index;
|
35
|
+
//! The minimum batch index that any thread is currently actively reading
|
36
|
+
optional_idx min_batch_index;
|
37
|
+
};
|
26
38
|
|
27
39
|
// LCOV_EXCL_START
|
28
40
|
class OperatorState {
|
@@ -88,12 +100,8 @@ public:
|
|
88
100
|
virtual ~LocalSinkState() {
|
89
101
|
}
|
90
102
|
|
91
|
-
//!
|
92
|
-
|
93
|
-
//! Otherwise this is left on INVALID_INDEX
|
94
|
-
//! The batch index is a globally unique, increasing index that should be used to maintain insertion order
|
95
|
-
//! //! in conjunction with parallelism
|
96
|
-
idx_t batch_index = DConstants::INVALID_INDEX;
|
103
|
+
//! Source partition info
|
104
|
+
SourcePartitionInfo partition_info;
|
97
105
|
|
98
106
|
template <class TARGET>
|
99
107
|
TARGET &Cast() {
|
@@ -145,6 +153,18 @@ public:
|
|
145
153
|
}
|
146
154
|
};
|
147
155
|
|
156
|
+
struct OperatorSinkInput {
|
157
|
+
GlobalSinkState &global_state;
|
158
|
+
LocalSinkState &local_state;
|
159
|
+
InterruptState &interrupt_state;
|
160
|
+
};
|
161
|
+
|
162
|
+
struct OperatorSourceInput {
|
163
|
+
GlobalSourceState &global_state;
|
164
|
+
LocalSourceState &local_state;
|
165
|
+
InterruptState &interrupt_state;
|
166
|
+
};
|
167
|
+
|
148
168
|
// LCOV_EXCL_STOP
|
149
169
|
|
150
170
|
} // namespace duckdb
|
@@ -26,7 +26,7 @@ public:
|
|
26
26
|
|
27
27
|
GroupingSet &grouping_set;
|
28
28
|
//! The indices specified in the groups_count that do not appear in the grouping_set
|
29
|
-
|
29
|
+
unsafe_vector<idx_t> null_groups;
|
30
30
|
const GroupedAggregateData &op;
|
31
31
|
|
32
32
|
vector<LogicalType> group_types;
|
@@ -41,20 +41,20 @@ public:
|
|
41
41
|
unique_ptr<GlobalSinkState> GetGlobalSinkState(ClientContext &context) const;
|
42
42
|
unique_ptr<LocalSinkState> GetLocalSinkState(ExecutionContext &context) const;
|
43
43
|
|
44
|
-
void Sink(ExecutionContext &context,
|
45
|
-
|
44
|
+
void Sink(ExecutionContext &context, DataChunk &chunk, OperatorSinkInput &input, DataChunk &aggregate_input_chunk,
|
45
|
+
const unsafe_vector<idx_t> &filter) const;
|
46
46
|
void Combine(ExecutionContext &context, GlobalSinkState &state, LocalSinkState &lstate) const;
|
47
47
|
bool Finalize(ClientContext &context, GlobalSinkState &gstate_p) const;
|
48
48
|
|
49
49
|
void ScheduleTasks(Executor &executor, const shared_ptr<Event> &event, GlobalSinkState &state,
|
50
|
-
vector<
|
50
|
+
vector<shared_ptr<Task>> &tasks) const;
|
51
51
|
|
52
52
|
//! Source interface
|
53
53
|
idx_t Size(GlobalSinkState &sink_state) const;
|
54
54
|
unique_ptr<GlobalSourceState> GetGlobalSourceState(ClientContext &context) const;
|
55
55
|
unique_ptr<LocalSourceState> GetLocalSourceState(ExecutionContext &context) const;
|
56
|
-
|
57
|
-
|
56
|
+
SourceResultType GetData(ExecutionContext &context, DataChunk &chunk, GlobalSinkState &sink_state,
|
57
|
+
OperatorSourceInput &input) const;
|
58
58
|
|
59
59
|
static void SetMultiScan(GlobalSinkState &state);
|
60
60
|
bool ForceSingleHT(GlobalSinkState &state) const;
|
@@ -25,7 +25,8 @@ class BoundAggregateExpression;
|
|
25
25
|
|
26
26
|
struct AggregateInputData {
|
27
27
|
AggregateInputData(FunctionData *bind_data_p, Allocator &allocator_p)
|
28
|
-
: bind_data(bind_data_p), allocator(allocator_p) {
|
28
|
+
: bind_data(bind_data_p), allocator(allocator_p) {
|
29
|
+
}
|
29
30
|
FunctionData *bind_data;
|
30
31
|
Allocator &allocator;
|
31
32
|
};
|