duckdb 0.7.2-dev2820.0 → 0.7.2-dev2995.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 +1 -0
- package/package.json +1 -1
- package/src/duckdb/extension/icu/icu-datepart.cpp +55 -1
- package/src/duckdb/extension/parquet/parquet-extension.cpp +5 -4
- 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/local_file_system.cpp +1 -3
- package/src/duckdb/src/common/multi_file_reader.cpp +11 -8
- 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/core_functions/function_list.cpp +2 -0
- package/src/duckdb/src/core_functions/scalar/string/format_bytes.cpp +29 -0
- package/src/duckdb/src/execution/index/art/art.cpp +5 -1
- package/src/duckdb/src/execution/operator/aggregate/physical_hash_aggregate.cpp +62 -43
- 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_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 +10 -8
- 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_insert.cpp +160 -145
- package/src/duckdb/src/execution/operator/persistent/physical_copy_to_file.cpp +10 -25
- 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 +4 -18
- 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 +20 -28
- 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/physical_operator.cpp +11 -5
- package/src/duckdb/src/execution/radix_partitioned_hashtable.cpp +16 -16
- package/src/duckdb/src/function/table/arrow_conversion.cpp +3 -3
- package/src/duckdb/src/function/table/read_csv.cpp +7 -4
- 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/enums/operator_result_type.hpp +16 -4
- package/src/duckdb/src/include/duckdb/common/multi_file_reader.hpp +5 -4
- package/src/duckdb/src/include/duckdb/common/optional_idx.hpp +45 -0
- package/src/duckdb/src/include/duckdb/common/set.hpp +2 -1
- package/src/duckdb/src/include/duckdb/core_functions/scalar/string_functions.hpp +15 -0
- package/src/duckdb/src/include/duckdb/execution/executor.hpp +10 -1
- package/src/duckdb/src/include/duckdb/execution/operator/aggregate/physical_hash_aggregate.hpp +5 -8
- 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_insert.hpp +3 -5
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_copy_to_file.hpp +2 -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 +6 -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/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 +5 -5
- package/src/duckdb/src/include/duckdb/function/aggregate_function.hpp +2 -1
- 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 +2 -0
- package/src/duckdb/src/include/duckdb/main/database.hpp +1 -0
- package/src/duckdb/src/include/duckdb/main/database_manager.hpp +3 -0
- package/src/duckdb/src/include/duckdb/main/extension_helper.hpp +0 -2
- 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/tableref/pivotref.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/transformer.hpp +5 -1
- 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/operator/logical_aggregate.hpp +1 -0
- 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/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/no_operator_caching_verifier.hpp +25 -0
- package/src/duckdb/src/include/duckdb/verification/statement_verifier.hpp +5 -0
- package/src/duckdb/src/main/attached_database.cpp +5 -3
- package/src/duckdb/src/main/client_verify.cpp +4 -0
- package/src/duckdb/src/main/config.cpp +4 -0
- package/src/duckdb/src/main/database.cpp +45 -48
- package/src/duckdb/src/main/extension/extension_load.cpp +32 -49
- 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/transform/statement/transform_create_function.cpp +1 -4
- package/src/duckdb/src/parser/transform/statement/transform_create_view.cpp +2 -4
- package/src/duckdb/src/parser/transform/statement/transform_pivot_stmt.cpp +43 -24
- package/src/duckdb/src/parser/transform/tableref/transform_pivot.cpp +3 -0
- package/src/duckdb/src/planner/binder/statement/bind_create.cpp +17 -28
- 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/operator/logical_aggregate.cpp +13 -1
- package/src/duckdb/src/planner/operator/logical_column_data_get.cpp +11 -0
- 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/no_operator_caching_verifier.cpp +13 -0
- package/src/duckdb/src/verification/statement_verifier.cpp +4 -0
- package/src/duckdb/third_party/fmt/format.cc +0 -5
- package/src/duckdb/third_party/fmt/include/fmt/core.h +10 -12
- package/src/duckdb/third_party/fmt/include/fmt/format-inl.h +2 -33
- package/src/duckdb/third_party/fmt/include/fmt/format.h +61 -24
- package/src/duckdb/third_party/fmt/include/fmt/printf.h +15 -1
- package/src/duckdb/third_party/libpg_query/include/nodes/parsenodes.hpp +1 -0
- package/src/duckdb/third_party/libpg_query/src_backend_parser_gram.cpp +10735 -10674
- package/src/duckdb/ub_src_core_functions_scalar_string.cpp +2 -0
- package/src/duckdb/ub_src_parallel.cpp +2 -0
- package/src/duckdb/ub_src_storage.cpp +2 -0
@@ -356,10 +356,9 @@ idx_t PhysicalInsert::OnConflictHandling(TableCatalogEntry &table, ExecutionCont
|
|
356
356
|
return updated_tuples;
|
357
357
|
}
|
358
358
|
|
359
|
-
SinkResultType PhysicalInsert::Sink(ExecutionContext &context,
|
360
|
-
|
361
|
-
auto &
|
362
|
-
auto &lstate = lstate_p.Cast<InsertLocalState>();
|
359
|
+
SinkResultType PhysicalInsert::Sink(ExecutionContext &context, DataChunk &chunk, OperatorSinkInput &input) const {
|
360
|
+
auto &gstate = input.global_state.Cast<InsertGlobalState>();
|
361
|
+
auto &lstate = input.local_state.Cast<InsertLocalState>();
|
363
362
|
|
364
363
|
auto &table = gstate.table;
|
365
364
|
auto &storage = table.GetStorage();
|
@@ -372,13 +371,13 @@ SinkResultType PhysicalInsert::Sink(ExecutionContext &context, GlobalSinkState &
|
|
372
371
|
}
|
373
372
|
|
374
373
|
idx_t updated_tuples = OnConflictHandling(table, context, lstate);
|
374
|
+
gstate.insert_count += lstate.insert_chunk.size();
|
375
|
+
gstate.insert_count += updated_tuples;
|
375
376
|
storage.LocalAppend(gstate.append_state, table, context.client, lstate.insert_chunk, true);
|
376
377
|
|
377
378
|
if (return_chunk) {
|
378
379
|
gstate.return_collection.Append(lstate.insert_chunk);
|
379
380
|
}
|
380
|
-
gstate.insert_count += lstate.insert_chunk.size();
|
381
|
-
gstate.insert_count += updated_tuples;
|
382
381
|
} else {
|
383
382
|
D_ASSERT(!return_chunk);
|
384
383
|
// parallel append
|
@@ -392,11 +391,11 @@ SinkResultType PhysicalInsert::Sink(ExecutionContext &context, GlobalSinkState &
|
|
392
391
|
lstate.local_collection->InitializeAppend(lstate.local_append_state);
|
393
392
|
lstate.writer = &gstate.table.GetStorage().CreateOptimisticWriter(context.client);
|
394
393
|
}
|
395
|
-
|
394
|
+
OnConflictHandling(table, context, lstate);
|
396
395
|
|
397
396
|
auto new_row_group = lstate.local_collection->Append(lstate.insert_chunk, lstate.local_append_state);
|
398
397
|
if (new_row_group) {
|
399
|
-
lstate.writer->
|
398
|
+
lstate.writer->WriteNewRowGroup(*lstate.local_collection);
|
400
399
|
}
|
401
400
|
}
|
402
401
|
|
@@ -422,11 +421,10 @@ void PhysicalInsert::Combine(ExecutionContext &context, GlobalSinkState &gstate_
|
|
422
421
|
|
423
422
|
auto append_count = lstate.local_collection->GetTotalRows();
|
424
423
|
|
425
|
-
|
424
|
+
lock_guard<mutex> lock(gstate.lock);
|
425
|
+
gstate.insert_count += append_count;
|
426
|
+
if (append_count < RowGroup::ROW_GROUP_SIZE) {
|
426
427
|
// we have few rows - append to the local storage directly
|
427
|
-
lock_guard<mutex> lock(gstate.lock);
|
428
|
-
gstate.insert_count += append_count;
|
429
|
-
gstate.insert_count += lstate.update_count;
|
430
428
|
auto &table = gstate.table;
|
431
429
|
auto &storage = table.GetStorage();
|
432
430
|
storage.InitializeLocalAppend(gstate.append_state, context.client);
|
@@ -437,14 +435,8 @@ void PhysicalInsert::Combine(ExecutionContext &context, GlobalSinkState &gstate_
|
|
437
435
|
});
|
438
436
|
storage.FinalizeLocalAppend(gstate.append_state);
|
439
437
|
} else {
|
440
|
-
// we have
|
441
|
-
|
442
|
-
lstate.writer->FlushToDisk(*lstate.local_collection);
|
443
|
-
lstate.writer->FinalFlush();
|
444
|
-
|
445
|
-
lock_guard<mutex> lock(gstate.lock);
|
446
|
-
gstate.insert_count += append_count;
|
447
|
-
gstate.insert_count += lstate.update_count;
|
438
|
+
// we have written rows to disk optimistically - merge directly into the transaction-local storage
|
439
|
+
gstate.table.GetStorage().FinalizeOptimisticWriter(context.client, *lstate.writer);
|
448
440
|
gstate.table.GetStorage().LocalMerge(context.client, *lstate.local_collection);
|
449
441
|
}
|
450
442
|
}
|
@@ -465,7 +457,7 @@ SinkFinalizeType PhysicalInsert::Finalize(Pipeline &pipeline, Event &event, Clie
|
|
465
457
|
//===--------------------------------------------------------------------===//
|
466
458
|
class InsertSourceState : public GlobalSourceState {
|
467
459
|
public:
|
468
|
-
explicit InsertSourceState(const PhysicalInsert &op)
|
460
|
+
explicit InsertSourceState(const PhysicalInsert &op) {
|
469
461
|
if (op.return_chunk) {
|
470
462
|
D_ASSERT(op.sink_state);
|
471
463
|
auto &g = op.sink_state->Cast<InsertGlobalState>();
|
@@ -474,28 +466,24 @@ public:
|
|
474
466
|
}
|
475
467
|
|
476
468
|
ColumnDataScanState scan_state;
|
477
|
-
bool finished;
|
478
469
|
};
|
479
470
|
|
480
471
|
unique_ptr<GlobalSourceState> PhysicalInsert::GetGlobalSourceState(ClientContext &context) const {
|
481
472
|
return make_uniq<InsertSourceState>(*this);
|
482
473
|
}
|
483
474
|
|
484
|
-
|
485
|
-
|
486
|
-
auto &state =
|
475
|
+
SourceResultType PhysicalInsert::GetData(ExecutionContext &context, DataChunk &chunk,
|
476
|
+
OperatorSourceInput &input) const {
|
477
|
+
auto &state = input.global_state.Cast<InsertSourceState>();
|
487
478
|
auto &insert_gstate = sink_state->Cast<InsertGlobalState>();
|
488
|
-
if (state.finished) {
|
489
|
-
return;
|
490
|
-
}
|
491
479
|
if (!return_chunk) {
|
492
480
|
chunk.SetCardinality(1);
|
493
481
|
chunk.SetValue(0, 0, Value::BIGINT(insert_gstate.insert_count));
|
494
|
-
|
495
|
-
return;
|
482
|
+
return SourceResultType::FINISHED;
|
496
483
|
}
|
497
484
|
|
498
485
|
insert_gstate.return_collection.Scan(state.scan_state, chunk);
|
486
|
+
return chunk.size() == 0 ? SourceResultType::FINISHED : SourceResultType::HAVE_MORE_OUTPUT;
|
499
487
|
}
|
500
488
|
|
501
489
|
} // namespace duckdb
|
@@ -57,16 +57,15 @@ public:
|
|
57
57
|
ExpressionExecutor default_executor;
|
58
58
|
};
|
59
59
|
|
60
|
-
SinkResultType PhysicalUpdate::Sink(ExecutionContext &context,
|
61
|
-
|
62
|
-
auto &
|
63
|
-
auto &ustate = lstate.Cast<UpdateLocalState>();
|
60
|
+
SinkResultType PhysicalUpdate::Sink(ExecutionContext &context, DataChunk &chunk, OperatorSinkInput &input) const {
|
61
|
+
auto &gstate = input.global_state.Cast<UpdateGlobalState>();
|
62
|
+
auto &lstate = input.local_state.Cast<UpdateLocalState>();
|
64
63
|
|
65
|
-
DataChunk &update_chunk =
|
66
|
-
DataChunk &mock_chunk =
|
64
|
+
DataChunk &update_chunk = lstate.update_chunk;
|
65
|
+
DataChunk &mock_chunk = lstate.mock_chunk;
|
67
66
|
|
68
67
|
chunk.Flatten();
|
69
|
-
|
68
|
+
lstate.default_executor.SetChunk(chunk);
|
70
69
|
|
71
70
|
// update data in the base table
|
72
71
|
// the row ids are given to us as the last column of the child chunk
|
@@ -77,7 +76,7 @@ SinkResultType PhysicalUpdate::Sink(ExecutionContext &context, GlobalSinkState &
|
|
77
76
|
for (idx_t i = 0; i < expressions.size(); i++) {
|
78
77
|
if (expressions[i]->type == ExpressionType::VALUE_DEFAULT) {
|
79
78
|
// default expression, set to the default value of the column
|
80
|
-
|
79
|
+
lstate.default_executor.ExecuteExpression(columns[i].index, update_chunk.data[i]);
|
81
80
|
} else {
|
82
81
|
D_ASSERT(expressions[i]->type == ExpressionType::BOUND_REF);
|
83
82
|
// index into child chunk
|
@@ -153,7 +152,7 @@ void PhysicalUpdate::Combine(ExecutionContext &context, GlobalSinkState &gstate,
|
|
153
152
|
//===--------------------------------------------------------------------===//
|
154
153
|
class UpdateSourceState : public GlobalSourceState {
|
155
154
|
public:
|
156
|
-
explicit UpdateSourceState(const PhysicalUpdate &op)
|
155
|
+
explicit UpdateSourceState(const PhysicalUpdate &op) {
|
157
156
|
if (op.return_chunk) {
|
158
157
|
D_ASSERT(op.sink_state);
|
159
158
|
auto &g = op.sink_state->Cast<UpdateGlobalState>();
|
@@ -162,28 +161,25 @@ public:
|
|
162
161
|
}
|
163
162
|
|
164
163
|
ColumnDataScanState scan_state;
|
165
|
-
bool finished;
|
166
164
|
};
|
167
165
|
|
168
166
|
unique_ptr<GlobalSourceState> PhysicalUpdate::GetGlobalSourceState(ClientContext &context) const {
|
169
167
|
return make_uniq<UpdateSourceState>(*this);
|
170
168
|
}
|
171
169
|
|
172
|
-
|
173
|
-
|
174
|
-
auto &state =
|
170
|
+
SourceResultType PhysicalUpdate::GetData(ExecutionContext &context, DataChunk &chunk,
|
171
|
+
OperatorSourceInput &input) const {
|
172
|
+
auto &state = input.global_state.Cast<UpdateSourceState>();
|
175
173
|
auto &g = sink_state->Cast<UpdateGlobalState>();
|
176
|
-
if (state.finished) {
|
177
|
-
return;
|
178
|
-
}
|
179
174
|
if (!return_chunk) {
|
180
175
|
chunk.SetCardinality(1);
|
181
176
|
chunk.SetValue(0, 0, Value::BIGINT(g.updated_count));
|
182
|
-
|
183
|
-
return;
|
177
|
+
return SourceResultType::FINISHED;
|
184
178
|
}
|
185
179
|
|
186
180
|
g.return_collection.Scan(state.scan_state, chunk);
|
181
|
+
|
182
|
+
return chunk.size() == 0 ? SourceResultType::FINISHED : SourceResultType::HAVE_MORE_OUTPUT;
|
187
183
|
}
|
188
184
|
|
189
185
|
} // namespace duckdb
|
@@ -27,17 +27,19 @@ unique_ptr<GlobalSourceState> PhysicalColumnDataScan::GetGlobalSourceState(Clien
|
|
27
27
|
return make_uniq<PhysicalColumnDataScanState>();
|
28
28
|
}
|
29
29
|
|
30
|
-
|
31
|
-
|
32
|
-
auto &state =
|
30
|
+
SourceResultType PhysicalColumnDataScan::GetData(ExecutionContext &context, DataChunk &chunk,
|
31
|
+
OperatorSourceInput &input) const {
|
32
|
+
auto &state = input.global_state.Cast<PhysicalColumnDataScanState>();
|
33
33
|
if (collection->Count() == 0) {
|
34
|
-
return;
|
34
|
+
return SourceResultType::FINISHED;
|
35
35
|
}
|
36
36
|
if (!state.initialized) {
|
37
37
|
collection->InitializeScan(state.scan_state);
|
38
38
|
state.initialized = true;
|
39
39
|
}
|
40
40
|
collection->Scan(state.scan_state, chunk);
|
41
|
+
|
42
|
+
return chunk.size() == 0 ? SourceResultType::FINISHED : SourceResultType::HAVE_MORE_OUTPUT;
|
41
43
|
}
|
42
44
|
|
43
45
|
//===--------------------------------------------------------------------===//
|
@@ -2,27 +2,12 @@
|
|
2
2
|
|
3
3
|
namespace duckdb {
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
DummyScanState() : finished(false) {
|
8
|
-
}
|
9
|
-
|
10
|
-
bool finished;
|
11
|
-
};
|
12
|
-
|
13
|
-
unique_ptr<GlobalSourceState> PhysicalDummyScan::GetGlobalSourceState(ClientContext &context) const {
|
14
|
-
return make_uniq<DummyScanState>();
|
15
|
-
}
|
16
|
-
|
17
|
-
void PhysicalDummyScan::GetData(ExecutionContext &context, DataChunk &chunk, GlobalSourceState &gstate,
|
18
|
-
LocalSourceState &lstate) const {
|
19
|
-
auto &state = (DummyScanState &)gstate;
|
20
|
-
if (state.finished) {
|
21
|
-
return;
|
22
|
-
}
|
5
|
+
SourceResultType PhysicalDummyScan::GetData(ExecutionContext &context, DataChunk &chunk,
|
6
|
+
OperatorSourceInput &input) const {
|
23
7
|
// return a single row on the first call to the dummy scan
|
24
8
|
chunk.SetCardinality(1);
|
25
|
-
|
9
|
+
|
10
|
+
return SourceResultType::FINISHED;
|
26
11
|
}
|
27
12
|
|
28
13
|
} // namespace duckdb
|
@@ -2,8 +2,9 @@
|
|
2
2
|
|
3
3
|
namespace duckdb {
|
4
4
|
|
5
|
-
|
6
|
-
|
5
|
+
SourceResultType PhysicalEmptyResult::GetData(ExecutionContext &context, DataChunk &chunk,
|
6
|
+
OperatorSourceInput &input) const {
|
7
|
+
return SourceResultType::FINISHED;
|
7
8
|
}
|
8
9
|
|
9
10
|
} // namespace duckdb
|
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
#include "duckdb/catalog/catalog_entry/table_catalog_entry.hpp"
|
4
4
|
#include "duckdb/common/string_util.hpp"
|
5
|
+
#include "duckdb/parallel/interrupt.hpp"
|
5
6
|
#include "duckdb/planner/expression/bound_conjunction_expression.hpp"
|
6
7
|
#include "duckdb/transaction/transaction.hpp"
|
7
8
|
|
@@ -63,7 +64,14 @@ public:
|
|
63
64
|
if (source_offset >= source.size()) {
|
64
65
|
if (!exhausted) {
|
65
66
|
source.Reset();
|
66
|
-
|
67
|
+
|
68
|
+
InterruptState interrupt_state;
|
69
|
+
OperatorSourceInput source_input {global_state, *local_state, interrupt_state};
|
70
|
+
auto source_result = table.GetData(context, source, source_input);
|
71
|
+
if (source_result == SourceResultType::BLOCKED) {
|
72
|
+
throw NotImplementedException(
|
73
|
+
"Unexpected interrupt from table Source in PositionalTableScanner refill");
|
74
|
+
}
|
67
75
|
}
|
68
76
|
source_offset = 0;
|
69
77
|
}
|
@@ -146,9 +154,9 @@ unique_ptr<GlobalSourceState> PhysicalPositionalScan::GetGlobalSourceState(Clien
|
|
146
154
|
return make_uniq<PositionalScanGlobalSourceState>(context, *this);
|
147
155
|
}
|
148
156
|
|
149
|
-
|
150
|
-
|
151
|
-
auto &lstate =
|
157
|
+
SourceResultType PhysicalPositionalScan::GetData(ExecutionContext &context, DataChunk &output,
|
158
|
+
OperatorSourceInput &input) const {
|
159
|
+
auto &lstate = input.local_state.Cast<PositionalScanLocalSourceState>();
|
152
160
|
|
153
161
|
// Find the longest source block
|
154
162
|
idx_t count = 0;
|
@@ -158,7 +166,7 @@ void PhysicalPositionalScan::GetData(ExecutionContext &context, DataChunk &outpu
|
|
158
166
|
|
159
167
|
// All done?
|
160
168
|
if (!count) {
|
161
|
-
return;
|
169
|
+
return SourceResultType::FINISHED;
|
162
170
|
}
|
163
171
|
|
164
172
|
// Copy or reference the source columns
|
@@ -168,6 +176,7 @@ void PhysicalPositionalScan::GetData(ExecutionContext &context, DataChunk &outpu
|
|
168
176
|
}
|
169
177
|
|
170
178
|
output.SetCardinality(count);
|
179
|
+
return SourceResultType::HAVE_MORE_OUTPUT;
|
171
180
|
}
|
172
181
|
|
173
182
|
double PhysicalPositionalScan::GetProgress(ClientContext &context, GlobalSourceState &gstate_p) const {
|
@@ -73,14 +73,16 @@ unique_ptr<GlobalSourceState> PhysicalTableScan::GetGlobalSourceState(ClientCont
|
|
73
73
|
return make_uniq<TableScanGlobalSourceState>(context, *this);
|
74
74
|
}
|
75
75
|
|
76
|
-
|
77
|
-
|
76
|
+
SourceResultType PhysicalTableScan::GetData(ExecutionContext &context, DataChunk &chunk,
|
77
|
+
OperatorSourceInput &input) const {
|
78
78
|
D_ASSERT(!column_ids.empty());
|
79
|
-
auto &gstate =
|
80
|
-
auto &state =
|
79
|
+
auto &gstate = input.global_state.Cast<TableScanGlobalSourceState>();
|
80
|
+
auto &state = input.local_state.Cast<TableScanLocalSourceState>();
|
81
81
|
|
82
82
|
TableFunctionInput data(bind_data.get(), state.local_state.get(), gstate.global_state.get());
|
83
83
|
function.function(context.client, data, chunk);
|
84
|
+
|
85
|
+
return chunk.size() == 0 ? SourceResultType::FINISHED : SourceResultType::HAVE_MORE_OUTPUT;
|
84
86
|
}
|
85
87
|
|
86
88
|
double PhysicalTableScan::GetProgress(ClientContext &context, GlobalSourceState &gstate_p) const {
|
@@ -7,27 +7,11 @@ namespace duckdb {
|
|
7
7
|
//===--------------------------------------------------------------------===//
|
8
8
|
// Source
|
9
9
|
//===--------------------------------------------------------------------===//
|
10
|
-
|
11
|
-
public:
|
12
|
-
AlterSourceState() : finished(false) {
|
13
|
-
}
|
14
|
-
|
15
|
-
bool finished;
|
16
|
-
};
|
17
|
-
|
18
|
-
unique_ptr<GlobalSourceState> PhysicalAlter::GetGlobalSourceState(ClientContext &context) const {
|
19
|
-
return make_uniq<AlterSourceState>();
|
20
|
-
}
|
21
|
-
|
22
|
-
void PhysicalAlter::GetData(ExecutionContext &context, DataChunk &chunk, GlobalSourceState &gstate,
|
23
|
-
LocalSourceState &lstate) const {
|
24
|
-
auto &state = gstate.Cast<AlterSourceState>();
|
25
|
-
if (state.finished) {
|
26
|
-
return;
|
27
|
-
}
|
10
|
+
SourceResultType PhysicalAlter::GetData(ExecutionContext &context, DataChunk &chunk, OperatorSourceInput &input) const {
|
28
11
|
auto &catalog = Catalog::GetCatalog(context.client, info->catalog);
|
29
12
|
catalog.Alter(context.client, *info);
|
30
|
-
|
13
|
+
|
14
|
+
return SourceResultType::FINISHED;
|
31
15
|
}
|
32
16
|
|
33
17
|
} // namespace duckdb
|
@@ -12,24 +12,9 @@ namespace duckdb {
|
|
12
12
|
//===--------------------------------------------------------------------===//
|
13
13
|
// Source
|
14
14
|
//===--------------------------------------------------------------------===//
|
15
|
-
class AttachSourceState : public GlobalSourceState {
|
16
|
-
public:
|
17
|
-
AttachSourceState() : finished(false) {
|
18
|
-
}
|
19
|
-
|
20
|
-
bool finished;
|
21
|
-
};
|
22
|
-
|
23
|
-
unique_ptr<GlobalSourceState> PhysicalAttach::GetGlobalSourceState(ClientContext &context) const {
|
24
|
-
return make_uniq<AttachSourceState>();
|
25
|
-
}
|
26
15
|
|
27
|
-
|
28
|
-
|
29
|
-
auto &state = gstate.Cast<AttachSourceState>();
|
30
|
-
if (state.finished) {
|
31
|
-
return;
|
32
|
-
}
|
16
|
+
SourceResultType PhysicalAttach::GetData(ExecutionContext &context, DataChunk &chunk,
|
17
|
+
OperatorSourceInput &input) const {
|
33
18
|
// parse the options
|
34
19
|
auto &config = DBConfig::GetConfig(context.client);
|
35
20
|
AccessMode access_mode = config.options.access_mode;
|
@@ -91,7 +76,8 @@ void PhysicalAttach::GetData(ExecutionContext &context, DataChunk &chunk, Global
|
|
91
76
|
new_db->Initialize();
|
92
77
|
|
93
78
|
db_manager.AddDatabase(context.client, std::move(new_db));
|
94
|
-
|
79
|
+
|
80
|
+
return SourceResultType::FINISHED;
|
95
81
|
}
|
96
82
|
|
97
83
|
} // namespace duckdb
|
@@ -8,27 +8,12 @@ namespace duckdb {
|
|
8
8
|
//===--------------------------------------------------------------------===//
|
9
9
|
// Source
|
10
10
|
//===--------------------------------------------------------------------===//
|
11
|
-
|
12
|
-
|
13
|
-
CreateFunctionSourceState() : finished(false) {
|
14
|
-
}
|
15
|
-
|
16
|
-
bool finished;
|
17
|
-
};
|
18
|
-
|
19
|
-
unique_ptr<GlobalSourceState> PhysicalCreateFunction::GetGlobalSourceState(ClientContext &context) const {
|
20
|
-
return make_uniq<CreateFunctionSourceState>();
|
21
|
-
}
|
22
|
-
|
23
|
-
void PhysicalCreateFunction::GetData(ExecutionContext &context, DataChunk &chunk, GlobalSourceState &gstate,
|
24
|
-
LocalSourceState &lstate) const {
|
25
|
-
auto &state = gstate.Cast<CreateFunctionSourceState>();
|
26
|
-
if (state.finished) {
|
27
|
-
return;
|
28
|
-
}
|
11
|
+
SourceResultType PhysicalCreateFunction::GetData(ExecutionContext &context, DataChunk &chunk,
|
12
|
+
OperatorSourceInput &input) const {
|
29
13
|
auto &catalog = Catalog::GetCatalog(context.client, info->catalog);
|
30
14
|
catalog.CreateFunction(context.client, *info);
|
31
|
-
|
15
|
+
|
16
|
+
return SourceResultType::FINISHED;
|
32
17
|
}
|
33
18
|
|
34
19
|
} // namespace duckdb
|
@@ -85,15 +85,14 @@ unique_ptr<LocalSinkState> PhysicalCreateIndex::GetLocalSinkState(ExecutionConte
|
|
85
85
|
return std::move(state);
|
86
86
|
}
|
87
87
|
|
88
|
-
SinkResultType PhysicalCreateIndex::Sink(ExecutionContext &context,
|
89
|
-
DataChunk &input) const {
|
88
|
+
SinkResultType PhysicalCreateIndex::Sink(ExecutionContext &context, DataChunk &chunk, OperatorSinkInput &input) const {
|
90
89
|
|
91
|
-
D_ASSERT(
|
92
|
-
auto &lstate =
|
93
|
-
auto &row_identifiers =
|
90
|
+
D_ASSERT(chunk.ColumnCount() >= 2);
|
91
|
+
auto &lstate = input.local_state.Cast<CreateIndexLocalSinkState>();
|
92
|
+
auto &row_identifiers = chunk.data[chunk.ColumnCount() - 1];
|
94
93
|
|
95
94
|
// generate the keys for the given input
|
96
|
-
lstate.key_chunk.ReferenceColumns(
|
95
|
+
lstate.key_chunk.ReferenceColumns(chunk, lstate.key_column_ids);
|
97
96
|
lstate.arena_allocator.Reset();
|
98
97
|
ART::GenerateKeys(lstate.arena_allocator, lstate.key_chunk, lstate.keys);
|
99
98
|
|
@@ -160,9 +159,9 @@ SinkFinalizeType PhysicalCreateIndex::Finalize(Pipeline &pipeline, Event &event,
|
|
160
159
|
// Source
|
161
160
|
//===--------------------------------------------------------------------===//
|
162
161
|
|
163
|
-
|
164
|
-
|
165
|
-
|
162
|
+
SourceResultType PhysicalCreateIndex::GetData(ExecutionContext &context, DataChunk &chunk,
|
163
|
+
OperatorSourceInput &input) const {
|
164
|
+
return SourceResultType::FINISHED;
|
166
165
|
}
|
167
166
|
|
168
167
|
} // namespace duckdb
|
@@ -6,30 +6,15 @@ namespace duckdb {
|
|
6
6
|
//===--------------------------------------------------------------------===//
|
7
7
|
// Source
|
8
8
|
//===--------------------------------------------------------------------===//
|
9
|
-
|
10
|
-
|
11
|
-
CreateSchemaSourceState() : finished(false) {
|
12
|
-
}
|
13
|
-
|
14
|
-
bool finished;
|
15
|
-
};
|
16
|
-
|
17
|
-
unique_ptr<GlobalSourceState> PhysicalCreateSchema::GetGlobalSourceState(ClientContext &context) const {
|
18
|
-
return make_uniq<CreateSchemaSourceState>();
|
19
|
-
}
|
20
|
-
|
21
|
-
void PhysicalCreateSchema::GetData(ExecutionContext &context, DataChunk &chunk, GlobalSourceState &gstate,
|
22
|
-
LocalSourceState &lstate) const {
|
23
|
-
auto &state = gstate.Cast<CreateSchemaSourceState>();
|
24
|
-
if (state.finished) {
|
25
|
-
return;
|
26
|
-
}
|
9
|
+
SourceResultType PhysicalCreateSchema::GetData(ExecutionContext &context, DataChunk &chunk,
|
10
|
+
OperatorSourceInput &input) const {
|
27
11
|
auto &catalog = Catalog::GetCatalog(context.client, info->catalog);
|
28
12
|
if (catalog.IsSystemCatalog()) {
|
29
13
|
throw BinderException("Cannot create schema in system catalog");
|
30
14
|
}
|
31
15
|
catalog.CreateSchema(context.client, *info);
|
32
|
-
|
16
|
+
|
17
|
+
return SourceResultType::FINISHED;
|
33
18
|
}
|
34
19
|
|
35
20
|
} // namespace duckdb
|
@@ -6,27 +6,12 @@ namespace duckdb {
|
|
6
6
|
//===--------------------------------------------------------------------===//
|
7
7
|
// Source
|
8
8
|
//===--------------------------------------------------------------------===//
|
9
|
-
|
10
|
-
|
11
|
-
CreateSequenceSourceState() : finished(false) {
|
12
|
-
}
|
13
|
-
|
14
|
-
bool finished;
|
15
|
-
};
|
16
|
-
|
17
|
-
unique_ptr<GlobalSourceState> PhysicalCreateSequence::GetGlobalSourceState(ClientContext &context) const {
|
18
|
-
return make_uniq<CreateSequenceSourceState>();
|
19
|
-
}
|
20
|
-
|
21
|
-
void PhysicalCreateSequence::GetData(ExecutionContext &context, DataChunk &chunk, GlobalSourceState &gstate,
|
22
|
-
LocalSourceState &lstate) const {
|
23
|
-
auto &state = gstate.Cast<CreateSequenceSourceState>();
|
24
|
-
if (state.finished) {
|
25
|
-
return;
|
26
|
-
}
|
9
|
+
SourceResultType PhysicalCreateSequence::GetData(ExecutionContext &context, DataChunk &chunk,
|
10
|
+
OperatorSourceInput &input) const {
|
27
11
|
auto &catalog = Catalog::GetCatalog(context.client, info->catalog);
|
28
12
|
catalog.CreateSequence(context.client, *info);
|
29
|
-
|
13
|
+
|
14
|
+
return SourceResultType::FINISHED;
|
30
15
|
}
|
31
16
|
|
32
17
|
} // namespace duckdb
|
@@ -16,27 +16,12 @@ PhysicalCreateTable::PhysicalCreateTable(LogicalOperator &op, SchemaCatalogEntry
|
|
16
16
|
//===--------------------------------------------------------------------===//
|
17
17
|
// Source
|
18
18
|
//===--------------------------------------------------------------------===//
|
19
|
-
|
20
|
-
|
21
|
-
CreateTableSourceState() : finished(false) {
|
22
|
-
}
|
23
|
-
|
24
|
-
bool finished;
|
25
|
-
};
|
26
|
-
|
27
|
-
unique_ptr<GlobalSourceState> PhysicalCreateTable::GetGlobalSourceState(ClientContext &context) const {
|
28
|
-
return make_uniq<CreateTableSourceState>();
|
29
|
-
}
|
30
|
-
|
31
|
-
void PhysicalCreateTable::GetData(ExecutionContext &context, DataChunk &chunk, GlobalSourceState &gstate,
|
32
|
-
LocalSourceState &lstate) const {
|
33
|
-
auto &state = gstate.Cast<CreateTableSourceState>();
|
34
|
-
if (state.finished) {
|
35
|
-
return;
|
36
|
-
}
|
19
|
+
SourceResultType PhysicalCreateTable::GetData(ExecutionContext &context, DataChunk &chunk,
|
20
|
+
OperatorSourceInput &input) const {
|
37
21
|
auto &catalog = schema.catalog;
|
38
22
|
catalog.CreateTable(catalog.GetCatalogTransaction(context.client), schema, *info);
|
39
|
-
|
23
|
+
|
24
|
+
return SourceResultType::FINISHED;
|
40
25
|
}
|
41
26
|
|
42
27
|
} // namespace duckdb
|