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
@@ -24,15 +24,15 @@ struct SchedulerThread {
|
|
24
24
|
};
|
25
25
|
|
26
26
|
#ifndef DUCKDB_NO_THREADS
|
27
|
-
typedef duckdb_moodycamel::ConcurrentQueue<
|
27
|
+
typedef duckdb_moodycamel::ConcurrentQueue<shared_ptr<Task>> concurrent_queue_t;
|
28
28
|
typedef duckdb_moodycamel::LightweightSemaphore lightweight_semaphore_t;
|
29
29
|
|
30
30
|
struct ConcurrentQueue {
|
31
31
|
concurrent_queue_t q;
|
32
32
|
lightweight_semaphore_t semaphore;
|
33
33
|
|
34
|
-
void Enqueue(ProducerToken &token,
|
35
|
-
bool DequeueFromProducer(ProducerToken &token,
|
34
|
+
void Enqueue(ProducerToken &token, shared_ptr<Task> task);
|
35
|
+
bool DequeueFromProducer(ProducerToken &token, shared_ptr<Task> &task);
|
36
36
|
};
|
37
37
|
|
38
38
|
struct QueueProducerToken {
|
@@ -42,7 +42,7 @@ struct QueueProducerToken {
|
|
42
42
|
duckdb_moodycamel::ProducerToken queue_token;
|
43
43
|
};
|
44
44
|
|
45
|
-
void ConcurrentQueue::Enqueue(ProducerToken &token,
|
45
|
+
void ConcurrentQueue::Enqueue(ProducerToken &token, shared_ptr<Task> task) {
|
46
46
|
lock_guard<mutex> producer_lock(token.producer_lock);
|
47
47
|
if (q.enqueue(token.token->queue_token, std::move(task))) {
|
48
48
|
semaphore.signal();
|
@@ -51,26 +51,26 @@ void ConcurrentQueue::Enqueue(ProducerToken &token, unique_ptr<Task> task) {
|
|
51
51
|
}
|
52
52
|
}
|
53
53
|
|
54
|
-
bool ConcurrentQueue::DequeueFromProducer(ProducerToken &token,
|
54
|
+
bool ConcurrentQueue::DequeueFromProducer(ProducerToken &token, shared_ptr<Task> &task) {
|
55
55
|
lock_guard<mutex> producer_lock(token.producer_lock);
|
56
56
|
return q.try_dequeue_from_producer(token.token->queue_token, task);
|
57
57
|
}
|
58
58
|
|
59
59
|
#else
|
60
60
|
struct ConcurrentQueue {
|
61
|
-
std::queue<
|
61
|
+
std::queue<shared_ptr<Task>> q;
|
62
62
|
mutex qlock;
|
63
63
|
|
64
|
-
void Enqueue(ProducerToken &token,
|
65
|
-
bool DequeueFromProducer(ProducerToken &token,
|
64
|
+
void Enqueue(ProducerToken &token, shared_ptr<Task> task);
|
65
|
+
bool DequeueFromProducer(ProducerToken &token, shared_ptr<Task> &task);
|
66
66
|
};
|
67
67
|
|
68
|
-
void ConcurrentQueue::Enqueue(ProducerToken &token,
|
68
|
+
void ConcurrentQueue::Enqueue(ProducerToken &token, shared_ptr<Task> task) {
|
69
69
|
lock_guard<mutex> lock(qlock);
|
70
70
|
q.push(std::move(task));
|
71
71
|
}
|
72
72
|
|
73
|
-
bool ConcurrentQueue::DequeueFromProducer(ProducerToken &token,
|
73
|
+
bool ConcurrentQueue::DequeueFromProducer(ProducerToken &token, shared_ptr<Task> &task) {
|
74
74
|
lock_guard<mutex> lock(qlock);
|
75
75
|
if (q.empty()) {
|
76
76
|
return false;
|
@@ -115,25 +115,37 @@ unique_ptr<ProducerToken> TaskScheduler::CreateProducer() {
|
|
115
115
|
return make_uniq<ProducerToken>(*this, std::move(token));
|
116
116
|
}
|
117
117
|
|
118
|
-
void TaskScheduler::ScheduleTask(ProducerToken &token,
|
118
|
+
void TaskScheduler::ScheduleTask(ProducerToken &token, shared_ptr<Task> task) {
|
119
119
|
// Enqueue a task for the given producer token and signal any sleeping threads
|
120
120
|
queue->Enqueue(token, std::move(task));
|
121
121
|
}
|
122
122
|
|
123
|
-
bool TaskScheduler::GetTaskFromProducer(ProducerToken &token,
|
123
|
+
bool TaskScheduler::GetTaskFromProducer(ProducerToken &token, shared_ptr<Task> &task) {
|
124
124
|
return queue->DequeueFromProducer(token, task);
|
125
125
|
}
|
126
126
|
|
127
127
|
void TaskScheduler::ExecuteForever(atomic<bool> *marker) {
|
128
128
|
#ifndef DUCKDB_NO_THREADS
|
129
|
-
|
129
|
+
shared_ptr<Task> task;
|
130
130
|
// loop until the marker is set to false
|
131
131
|
while (*marker) {
|
132
132
|
// wait for a signal with a timeout
|
133
133
|
queue->semaphore.wait();
|
134
134
|
if (queue->q.try_dequeue(task)) {
|
135
|
-
task->Execute(TaskExecutionMode::PROCESS_ALL);
|
136
|
-
|
135
|
+
auto execute_result = task->Execute(TaskExecutionMode::PROCESS_ALL);
|
136
|
+
|
137
|
+
switch (execute_result) {
|
138
|
+
case TaskExecutionResult::TASK_FINISHED:
|
139
|
+
case TaskExecutionResult::TASK_ERROR:
|
140
|
+
task.reset();
|
141
|
+
break;
|
142
|
+
case TaskExecutionResult::TASK_NOT_FINISHED:
|
143
|
+
throw InternalException("Task should not return TASK_NOT_FINISHED in PROCESS_ALL mode");
|
144
|
+
case TaskExecutionResult::TASK_BLOCKED:
|
145
|
+
task->Deschedule();
|
146
|
+
task.reset();
|
147
|
+
break;
|
148
|
+
}
|
137
149
|
}
|
138
150
|
}
|
139
151
|
#else
|
@@ -146,13 +158,25 @@ idx_t TaskScheduler::ExecuteTasks(atomic<bool> *marker, idx_t max_tasks) {
|
|
146
158
|
idx_t completed_tasks = 0;
|
147
159
|
// loop until the marker is set to false
|
148
160
|
while (*marker && completed_tasks < max_tasks) {
|
149
|
-
|
161
|
+
shared_ptr<Task> task;
|
150
162
|
if (!queue->q.try_dequeue(task)) {
|
151
163
|
return completed_tasks;
|
152
164
|
}
|
153
|
-
task->Execute(TaskExecutionMode::PROCESS_ALL);
|
154
|
-
|
155
|
-
|
165
|
+
auto execute_result = task->Execute(TaskExecutionMode::PROCESS_ALL);
|
166
|
+
|
167
|
+
switch (execute_result) {
|
168
|
+
case TaskExecutionResult::TASK_FINISHED:
|
169
|
+
case TaskExecutionResult::TASK_ERROR:
|
170
|
+
task.reset();
|
171
|
+
completed_tasks++;
|
172
|
+
break;
|
173
|
+
case TaskExecutionResult::TASK_NOT_FINISHED:
|
174
|
+
throw InternalException("Task should not return TASK_NOT_FINISHED in PROCESS_ALL mode");
|
175
|
+
case TaskExecutionResult::TASK_BLOCKED:
|
176
|
+
task->Deschedule();
|
177
|
+
task.reset();
|
178
|
+
break;
|
179
|
+
}
|
156
180
|
}
|
157
181
|
return completed_tasks;
|
158
182
|
#else
|
@@ -162,15 +186,26 @@ idx_t TaskScheduler::ExecuteTasks(atomic<bool> *marker, idx_t max_tasks) {
|
|
162
186
|
|
163
187
|
void TaskScheduler::ExecuteTasks(idx_t max_tasks) {
|
164
188
|
#ifndef DUCKDB_NO_THREADS
|
165
|
-
|
189
|
+
shared_ptr<Task> task;
|
166
190
|
for (idx_t i = 0; i < max_tasks; i++) {
|
167
191
|
queue->semaphore.wait(TASK_TIMEOUT_USECS);
|
168
192
|
if (!queue->q.try_dequeue(task)) {
|
169
193
|
return;
|
170
194
|
}
|
171
195
|
try {
|
172
|
-
task->Execute(TaskExecutionMode::PROCESS_ALL);
|
173
|
-
|
196
|
+
auto execute_result = task->Execute(TaskExecutionMode::PROCESS_ALL);
|
197
|
+
switch (execute_result) {
|
198
|
+
case TaskExecutionResult::TASK_FINISHED:
|
199
|
+
case TaskExecutionResult::TASK_ERROR:
|
200
|
+
task.reset();
|
201
|
+
break;
|
202
|
+
case TaskExecutionResult::TASK_NOT_FINISHED:
|
203
|
+
throw InternalException("Task should not return TASK_NOT_FINISHED in PROCESS_ALL mode");
|
204
|
+
case TaskExecutionResult::TASK_BLOCKED:
|
205
|
+
task->Deschedule();
|
206
|
+
task.reset();
|
207
|
+
break;
|
208
|
+
}
|
174
209
|
} catch (...) {
|
175
210
|
return;
|
176
211
|
}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
#include "duckdb/parser/base_expression.hpp"
|
2
2
|
|
3
|
+
#include "duckdb/main/config.hpp"
|
3
4
|
#include "duckdb/common/printer.hpp"
|
4
5
|
|
5
6
|
namespace duckdb {
|
@@ -9,6 +10,11 @@ void BaseExpression::Print() const {
|
|
9
10
|
}
|
10
11
|
|
11
12
|
string BaseExpression::GetName() const {
|
13
|
+
#ifdef DEBUG
|
14
|
+
if (DBConfigOptions::debug_print_bindings) {
|
15
|
+
return ToString();
|
16
|
+
}
|
17
|
+
#endif
|
12
18
|
return !alias.empty() ? alias : ToString();
|
13
19
|
}
|
14
20
|
|
@@ -29,10 +29,7 @@ unique_ptr<CreateStatement> Transformer::TransformCreateFunction(duckdb_libpgque
|
|
29
29
|
auto query_node = TransformSelect(stmt->query, true)->node->Copy();
|
30
30
|
macro_func = make_uniq<TableMacroFunction>(std::move(query_node));
|
31
31
|
}
|
32
|
-
|
33
|
-
throw ParserException("Cannot use PIVOT statement syntax in a macro. Use the SQL standard PIVOT syntax in the "
|
34
|
-
"FROM clause instead.");
|
35
|
-
}
|
32
|
+
PivotEntryCheck("macro");
|
36
33
|
|
37
34
|
auto info =
|
38
35
|
make_uniq<CreateMacroInfo>((stmt->function ? CatalogType::MACRO_ENTRY : CatalogType::TABLE_MACRO_ENTRY));
|
@@ -26,10 +26,8 @@ unique_ptr<CreateStatement> Transformer::TransformCreateView(duckdb_libpgquery::
|
|
26
26
|
info->on_conflict = TransformOnConflict(stmt->onconflict);
|
27
27
|
|
28
28
|
info->query = TransformSelect(stmt->query, false);
|
29
|
-
|
30
|
-
|
31
|
-
"FROM clause instead.");
|
32
|
-
}
|
29
|
+
|
30
|
+
PivotEntryCheck("view");
|
33
31
|
|
34
32
|
if (stmt->aliases && stmt->aliases->length > 0) {
|
35
33
|
for (auto c = stmt->aliases->head; c != nullptr; c = lnext(c)) {
|
@@ -18,33 +18,45 @@
|
|
18
18
|
|
19
19
|
namespace duckdb {
|
20
20
|
|
21
|
-
void Transformer::AddPivotEntry(string enum_name, unique_ptr<SelectNode> base, unique_ptr<ParsedExpression> column
|
21
|
+
void Transformer::AddPivotEntry(string enum_name, unique_ptr<SelectNode> base, unique_ptr<ParsedExpression> column,
|
22
|
+
unique_ptr<QueryNode> subquery) {
|
22
23
|
if (parent) {
|
23
|
-
parent->AddPivotEntry(std::move(enum_name), std::move(base), std::move(column));
|
24
|
+
parent->AddPivotEntry(std::move(enum_name), std::move(base), std::move(column), std::move(subquery));
|
24
25
|
return;
|
25
26
|
}
|
26
27
|
auto result = make_uniq<CreatePivotEntry>();
|
27
28
|
result->enum_name = std::move(enum_name);
|
28
29
|
result->base = std::move(base);
|
29
30
|
result->column = std::move(column);
|
31
|
+
result->subquery = std::move(subquery);
|
30
32
|
|
31
33
|
pivot_entries.push_back(std::move(result));
|
32
34
|
}
|
33
35
|
|
34
36
|
bool Transformer::HasPivotEntries() {
|
35
|
-
|
36
|
-
return parent->HasPivotEntries();
|
37
|
-
}
|
38
|
-
return !pivot_entries.empty();
|
37
|
+
return !GetPivotEntries().empty();
|
39
38
|
}
|
40
39
|
|
41
40
|
idx_t Transformer::PivotEntryCount() {
|
41
|
+
return GetPivotEntries().size();
|
42
|
+
}
|
43
|
+
|
44
|
+
vector<unique_ptr<Transformer::CreatePivotEntry>> &Transformer::GetPivotEntries() {
|
42
45
|
if (parent) {
|
43
|
-
return parent->
|
46
|
+
return parent->GetPivotEntries();
|
44
47
|
}
|
45
|
-
return pivot_entries
|
48
|
+
return pivot_entries;
|
46
49
|
}
|
47
50
|
|
51
|
+
void Transformer::PivotEntryCheck(const string &type) {
|
52
|
+
auto &entries = GetPivotEntries();
|
53
|
+
if (!entries.empty()) {
|
54
|
+
throw ParserException(
|
55
|
+
"PIVOT statements with pivot elements extracted from the data cannot be used in %ss.\nIn order to use "
|
56
|
+
"PIVOT in a %s the PIVOT values must be manually specified, e.g.:\nPIVOT ... ON %s IN (val1, val2, ...)",
|
57
|
+
type, type, entries[0]->column->ToString());
|
58
|
+
}
|
59
|
+
}
|
48
60
|
unique_ptr<SQLStatement> Transformer::GenerateCreateEnumStmt(unique_ptr<CreatePivotEntry> entry) {
|
49
61
|
auto result = make_uniq<CreateStatement>();
|
50
62
|
auto info = make_uniq<CreateTypeInfo>();
|
@@ -57,23 +69,30 @@ unique_ptr<SQLStatement> Transformer::GenerateCreateEnumStmt(unique_ptr<CreatePi
|
|
57
69
|
info->on_conflict = OnCreateConflict::REPLACE_ON_CONFLICT;
|
58
70
|
|
59
71
|
// generate the query that will result in the enum creation
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
72
|
+
unique_ptr<QueryNode> subselect;
|
73
|
+
if (!entry->subquery) {
|
74
|
+
auto select_node = std::move(entry->base);
|
75
|
+
auto columnref = entry->column->Copy();
|
76
|
+
auto cast = make_uniq<CastExpression>(LogicalType::VARCHAR, std::move(columnref));
|
77
|
+
select_node->select_list.push_back(std::move(cast));
|
78
|
+
|
79
|
+
auto is_not_null =
|
80
|
+
make_uniq<OperatorExpression>(ExpressionType::OPERATOR_IS_NOT_NULL, std::move(entry->column));
|
81
|
+
select_node->where_clause = std::move(is_not_null);
|
82
|
+
|
83
|
+
// order by the column
|
84
|
+
select_node->modifiers.push_back(make_uniq<DistinctModifier>());
|
85
|
+
auto modifier = make_uniq<OrderModifier>();
|
86
|
+
modifier->orders.emplace_back(OrderType::ASCENDING, OrderByNullType::ORDER_DEFAULT,
|
87
|
+
make_uniq<ConstantExpression>(Value::INTEGER(1)));
|
88
|
+
select_node->modifiers.push_back(std::move(modifier));
|
89
|
+
subselect = std::move(select_node);
|
90
|
+
} else {
|
91
|
+
subselect = std::move(entry->subquery);
|
92
|
+
}
|
74
93
|
|
75
94
|
auto select = make_uniq<SelectStatement>();
|
76
|
-
select->node = std::move(
|
95
|
+
select->node = std::move(subselect);
|
77
96
|
info->query = std::move(select);
|
78
97
|
info->type = LogicalType::INVALID;
|
79
98
|
|
@@ -150,7 +169,7 @@ unique_ptr<QueryNode> Transformer::TransformPivotStatement(duckdb_libpgquery::PG
|
|
150
169
|
auto new_select = make_uniq<SelectNode>();
|
151
170
|
ExtractCTEsRecursive(new_select->cte_map);
|
152
171
|
new_select->from_table = source->Copy();
|
153
|
-
AddPivotEntry(enum_name, std::move(new_select), col.pivot_expressions[0]->Copy());
|
172
|
+
AddPivotEntry(enum_name, std::move(new_select), col.pivot_expressions[0]->Copy(), std::move(col.subquery));
|
154
173
|
col.pivot_enum = enum_name;
|
155
174
|
}
|
156
175
|
|
@@ -59,6 +59,9 @@ PivotColumn Transformer::TransformPivotColumn(duckdb_libpgquery::PGPivot *pivot)
|
|
59
59
|
col.entries.push_back(std::move(entry));
|
60
60
|
}
|
61
61
|
}
|
62
|
+
if (pivot->subquery) {
|
63
|
+
col.subquery = TransformSelectNode(reinterpret_cast<duckdb_libpgquery::PGSelectStmt *>(pivot->subquery));
|
64
|
+
}
|
62
65
|
if (pivot->pivot_enum) {
|
63
66
|
col.pivot_enum = pivot->pivot_enum;
|
64
67
|
}
|
@@ -8,6 +8,8 @@
|
|
8
8
|
#include "duckdb/parser/expression/constant_expression.hpp"
|
9
9
|
#include "duckdb/parser/expression/function_expression.hpp"
|
10
10
|
#include "duckdb/parser/expression/subquery_expression.hpp"
|
11
|
+
#include "duckdb/planner/expression/bound_cast_expression.hpp"
|
12
|
+
#include "duckdb/planner/expression/bound_columnref_expression.hpp"
|
11
13
|
#include "duckdb/parser/parsed_data/create_index_info.hpp"
|
12
14
|
#include "duckdb/parser/parsed_data/create_macro_info.hpp"
|
13
15
|
#include "duckdb/parser/parsed_data/create_view_info.hpp"
|
@@ -24,6 +26,7 @@
|
|
24
26
|
#include "duckdb/planner/operator/logical_create_table.hpp"
|
25
27
|
#include "duckdb/planner/operator/logical_get.hpp"
|
26
28
|
#include "duckdb/planner/operator/logical_distinct.hpp"
|
29
|
+
#include "duckdb/planner/operator/logical_projection.hpp"
|
27
30
|
#include "duckdb/planner/parsed_data/bound_create_table_info.hpp"
|
28
31
|
#include "duckdb/planner/query_node/bound_select_node.hpp"
|
29
32
|
#include "duckdb/planner/tableref/bound_basetableref.hpp"
|
@@ -605,41 +608,27 @@ BoundStatement Binder::Bind(CreateStatement &stmt) {
|
|
605
608
|
}
|
606
609
|
case CatalogType::TYPE_ENTRY: {
|
607
610
|
auto &schema = BindCreateSchema(*stmt.info);
|
608
|
-
auto &create_type_info =
|
611
|
+
auto &create_type_info = stmt.info->Cast<CreateTypeInfo>();
|
609
612
|
result.plan = make_uniq<LogicalCreate>(LogicalOperatorType::LOGICAL_CREATE_TYPE, std::move(stmt.info), &schema);
|
610
613
|
if (create_type_info.query) {
|
611
614
|
// CREATE TYPE mood AS ENUM (SELECT 'happy')
|
612
|
-
auto &select_stmt = create_type_info.query->Cast<SelectStatement>();
|
613
|
-
auto &query_node = *select_stmt.node;
|
614
|
-
|
615
|
-
// We always add distinct modifier implicitly
|
616
|
-
bool need_to_add = true;
|
617
|
-
if (!query_node.modifiers.empty()) {
|
618
|
-
if (query_node.modifiers[0]->type == ResultModifierType::DISTINCT_MODIFIER) {
|
619
|
-
// There are cases where the same column is grouped repeatedly
|
620
|
-
// CREATE TYPE mood AS ENUM (SELECT DISTINCT ON(x) x FROM test);
|
621
|
-
// When we push into a constant expression
|
622
|
-
// => CREATE TYPE mood AS ENUM (SELECT DISTINCT ON(x, x) x FROM test);
|
623
|
-
auto &distinct_modifier = (DistinctModifier &)*query_node.modifiers[0];
|
624
|
-
if (distinct_modifier.distinct_on_targets.empty()) {
|
625
|
-
need_to_add = false;
|
626
|
-
}
|
627
|
-
}
|
628
|
-
}
|
629
|
-
|
630
|
-
// Add distinct modifier
|
631
|
-
if (need_to_add) {
|
632
|
-
auto distinct_modifier = make_uniq<DistinctModifier>();
|
633
|
-
query_node.modifiers.emplace(query_node.modifiers.begin(), std::move(distinct_modifier));
|
634
|
-
}
|
635
|
-
|
636
615
|
auto query_obj = Bind(*create_type_info.query);
|
637
616
|
auto query = std::move(query_obj.plan);
|
638
617
|
|
639
618
|
auto &sql_types = query_obj.types;
|
640
|
-
if (sql_types.size() != 1
|
619
|
+
if (sql_types.size() != 1) {
|
641
620
|
// add cast expression?
|
642
|
-
throw BinderException("The query must return
|
621
|
+
throw BinderException("The query must return a single column");
|
622
|
+
}
|
623
|
+
if (sql_types[0].id() != LogicalType::VARCHAR) {
|
624
|
+
// push a projection casting to varchar
|
625
|
+
vector<unique_ptr<Expression>> select_list;
|
626
|
+
auto ref = make_uniq<BoundColumnRefExpression>(sql_types[0], query->GetColumnBindings()[0]);
|
627
|
+
auto cast_expr = BoundCastExpression::AddCastToType(context, std::move(ref), LogicalType::VARCHAR);
|
628
|
+
select_list.push_back(std::move(cast_expr));
|
629
|
+
auto proj = make_uniq<LogicalProjection>(GenerateTableIndex(), std::move(select_list));
|
630
|
+
proj->AddChild(std::move(query));
|
631
|
+
query = std::move(proj);
|
643
632
|
}
|
644
633
|
|
645
634
|
result.plan->AddChild(std::move(query));
|
@@ -660,7 +649,7 @@ BoundStatement Binder::Bind(CreateStatement &stmt) {
|
|
660
649
|
}
|
661
650
|
case CatalogType::DATABASE_ENTRY: {
|
662
651
|
// not supported in DuckDB yet but allow extensions to intercept and implement this functionality
|
663
|
-
auto &base =
|
652
|
+
auto &base = stmt.info->Cast<CreateDatabaseInfo>();
|
664
653
|
string database_name = base.name;
|
665
654
|
string source_path = base.path;
|
666
655
|
|
@@ -1,8 +1,8 @@
|
|
1
1
|
#include "duckdb/planner/expression/bound_columnref_expression.hpp"
|
2
2
|
|
3
|
-
#include "duckdb/common/types/hash.hpp"
|
4
|
-
#include "duckdb/common/to_string.hpp"
|
5
3
|
#include "duckdb/common/field_writer.hpp"
|
4
|
+
#include "duckdb/common/types/hash.hpp"
|
5
|
+
#include "duckdb/main/config.hpp"
|
6
6
|
|
7
7
|
namespace duckdb {
|
8
8
|
|
@@ -35,11 +35,25 @@ bool BoundColumnRefExpression::Equals(const BaseExpression *other_p) const {
|
|
35
35
|
return other.binding == binding && other.depth == depth;
|
36
36
|
}
|
37
37
|
|
38
|
+
string BoundColumnRefExpression::GetName() const {
|
39
|
+
#ifdef DEBUG
|
40
|
+
if (DBConfigOptions::debug_print_bindings) {
|
41
|
+
return binding.ToString();
|
42
|
+
}
|
43
|
+
#endif
|
44
|
+
return Expression::GetName();
|
45
|
+
}
|
46
|
+
|
38
47
|
string BoundColumnRefExpression::ToString() const {
|
48
|
+
#ifdef DEBUG
|
49
|
+
if (DBConfigOptions::debug_print_bindings) {
|
50
|
+
return binding.ToString();
|
51
|
+
}
|
52
|
+
#endif
|
39
53
|
if (!alias.empty()) {
|
40
54
|
return alias;
|
41
55
|
}
|
42
|
-
return
|
56
|
+
return binding.ToString();
|
43
57
|
}
|
44
58
|
|
45
59
|
void BoundColumnRefExpression::Serialize(FieldWriter &writer) const {
|
@@ -1,9 +1,10 @@
|
|
1
1
|
#include "duckdb/planner/expression/bound_reference_expression.hpp"
|
2
2
|
|
3
|
+
#include "duckdb/common/field_writer.hpp"
|
3
4
|
#include "duckdb/common/serializer.hpp"
|
4
|
-
#include "duckdb/common/types/hash.hpp"
|
5
5
|
#include "duckdb/common/to_string.hpp"
|
6
|
-
#include "duckdb/common/
|
6
|
+
#include "duckdb/common/types/hash.hpp"
|
7
|
+
#include "duckdb/main/config.hpp"
|
7
8
|
|
8
9
|
namespace duckdb {
|
9
10
|
|
@@ -16,6 +17,11 @@ BoundReferenceExpression::BoundReferenceExpression(LogicalType type, idx_t index
|
|
16
17
|
}
|
17
18
|
|
18
19
|
string BoundReferenceExpression::ToString() const {
|
20
|
+
#ifdef DEBUG
|
21
|
+
if (DBConfigOptions::debug_print_bindings) {
|
22
|
+
return "#" + to_string(index);
|
23
|
+
}
|
24
|
+
#endif
|
19
25
|
if (!alias.empty()) {
|
20
26
|
return alias;
|
21
27
|
}
|
@@ -1,6 +1,8 @@
|
|
1
1
|
#include "duckdb/planner/operator/logical_aggregate.hpp"
|
2
|
-
|
2
|
+
|
3
3
|
#include "duckdb/common/field_writer.hpp"
|
4
|
+
#include "duckdb/common/string_util.hpp"
|
5
|
+
#include "duckdb/main/config.hpp"
|
4
6
|
|
5
7
|
namespace duckdb {
|
6
8
|
|
@@ -117,4 +119,14 @@ vector<idx_t> LogicalAggregate::GetTableIndex() const {
|
|
117
119
|
return result;
|
118
120
|
}
|
119
121
|
|
122
|
+
string LogicalAggregate::GetName() const {
|
123
|
+
#ifdef DEBUG
|
124
|
+
if (DBConfigOptions::debug_print_bindings) {
|
125
|
+
return LogicalOperator::GetName() +
|
126
|
+
StringUtil::Format(" #%llu, #%llu, #%llu", group_index, aggregate_index, groupings_index);
|
127
|
+
}
|
128
|
+
#endif
|
129
|
+
return LogicalOperator::GetName();
|
130
|
+
}
|
131
|
+
|
120
132
|
} // namespace duckdb
|
@@ -1,6 +1,8 @@
|
|
1
1
|
#include "duckdb/planner/operator/logical_column_data_get.hpp"
|
2
|
+
|
2
3
|
#include "duckdb/common/field_writer.hpp"
|
3
4
|
#include "duckdb/common/types/data_chunk.hpp"
|
5
|
+
#include "duckdb/main/config.hpp"
|
4
6
|
|
5
7
|
namespace duckdb {
|
6
8
|
|
@@ -42,4 +44,13 @@ vector<idx_t> LogicalColumnDataGet::GetTableIndex() const {
|
|
42
44
|
return vector<idx_t> {table_index};
|
43
45
|
}
|
44
46
|
|
47
|
+
string LogicalColumnDataGet::GetName() const {
|
48
|
+
#ifdef DEBUG
|
49
|
+
if (DBConfigOptions::debug_print_bindings) {
|
50
|
+
return LogicalOperator::GetName() + StringUtil::Format(" #%llu", table_index);
|
51
|
+
}
|
52
|
+
#endif
|
53
|
+
return LogicalOperator::GetName();
|
54
|
+
}
|
55
|
+
|
45
56
|
} // namespace duckdb
|
@@ -1,5 +1,7 @@
|
|
1
1
|
#include "duckdb/planner/operator/logical_cteref.hpp"
|
2
|
+
|
2
3
|
#include "duckdb/common/field_writer.hpp"
|
4
|
+
#include "duckdb/main/config.hpp"
|
3
5
|
|
4
6
|
namespace duckdb {
|
5
7
|
|
@@ -22,4 +24,13 @@ vector<idx_t> LogicalCTERef::GetTableIndex() const {
|
|
22
24
|
return vector<idx_t> {table_index};
|
23
25
|
}
|
24
26
|
|
27
|
+
string LogicalCTERef::GetName() const {
|
28
|
+
#ifdef DEBUG
|
29
|
+
if (DBConfigOptions::debug_print_bindings) {
|
30
|
+
return LogicalOperator::GetName() + StringUtil::Format(" #%llu", table_index);
|
31
|
+
}
|
32
|
+
#endif
|
33
|
+
return LogicalOperator::GetName();
|
34
|
+
}
|
35
|
+
|
25
36
|
} // namespace duckdb
|
@@ -1,6 +1,7 @@
|
|
1
1
|
#include "duckdb/planner/operator/logical_delete.hpp"
|
2
2
|
|
3
3
|
#include "duckdb/catalog/catalog_entry/table_catalog_entry.hpp"
|
4
|
+
#include "duckdb/main/config.hpp"
|
4
5
|
#include "duckdb/parser/parsed_data/create_table_info.hpp"
|
5
6
|
|
6
7
|
namespace duckdb {
|
@@ -51,4 +52,13 @@ void LogicalDelete::ResolveTypes() {
|
|
51
52
|
}
|
52
53
|
}
|
53
54
|
|
55
|
+
string LogicalDelete::GetName() const {
|
56
|
+
#ifdef DEBUG
|
57
|
+
if (DBConfigOptions::debug_print_bindings) {
|
58
|
+
return LogicalOperator::GetName() + StringUtil::Format(" #%llu", table_index);
|
59
|
+
}
|
60
|
+
#endif
|
61
|
+
return LogicalOperator::GetName();
|
62
|
+
}
|
63
|
+
|
54
64
|
} // namespace duckdb
|
@@ -1,6 +1,8 @@
|
|
1
|
-
#include "duckdb/common/field_writer.hpp"
|
2
1
|
#include "duckdb/planner/operator/logical_delim_get.hpp"
|
3
2
|
|
3
|
+
#include "duckdb/common/field_writer.hpp"
|
4
|
+
#include "duckdb/main/config.hpp"
|
5
|
+
|
4
6
|
namespace duckdb {
|
5
7
|
|
6
8
|
void LogicalDelimGet::Serialize(FieldWriter &writer) const {
|
@@ -18,4 +20,13 @@ vector<idx_t> LogicalDelimGet::GetTableIndex() const {
|
|
18
20
|
return vector<idx_t> {table_index};
|
19
21
|
}
|
20
22
|
|
23
|
+
string LogicalDelimGet::GetName() const {
|
24
|
+
#ifdef DEBUG
|
25
|
+
if (DBConfigOptions::debug_print_bindings) {
|
26
|
+
return LogicalOperator::GetName() + StringUtil::Format(" #%llu", table_index);
|
27
|
+
}
|
28
|
+
#endif
|
29
|
+
return LogicalOperator::GetName();
|
30
|
+
}
|
31
|
+
|
21
32
|
} // namespace duckdb
|
@@ -1,6 +1,8 @@
|
|
1
|
-
#include "duckdb/common/field_writer.hpp"
|
2
1
|
#include "duckdb/planner/operator/logical_dummy_scan.hpp"
|
3
2
|
|
3
|
+
#include "duckdb/common/field_writer.hpp"
|
4
|
+
#include "duckdb/main/config.hpp"
|
5
|
+
|
4
6
|
namespace duckdb {
|
5
7
|
|
6
8
|
void LogicalDummyScan::Serialize(FieldWriter &writer) const {
|
@@ -16,4 +18,13 @@ vector<idx_t> LogicalDummyScan::GetTableIndex() const {
|
|
16
18
|
return vector<idx_t> {table_index};
|
17
19
|
}
|
18
20
|
|
21
|
+
string LogicalDummyScan::GetName() const {
|
22
|
+
#ifdef DEBUG
|
23
|
+
if (DBConfigOptions::debug_print_bindings) {
|
24
|
+
return LogicalOperator::GetName() + StringUtil::Format(" #%llu", table_index);
|
25
|
+
}
|
26
|
+
#endif
|
27
|
+
return LogicalOperator::GetName();
|
28
|
+
}
|
29
|
+
|
19
30
|
} // namespace duckdb
|
@@ -1,6 +1,8 @@
|
|
1
|
-
#include "duckdb/common/field_writer.hpp"
|
2
1
|
#include "duckdb/planner/operator/logical_expression_get.hpp"
|
3
2
|
|
3
|
+
#include "duckdb/common/field_writer.hpp"
|
4
|
+
#include "duckdb/main/config.hpp"
|
5
|
+
|
4
6
|
namespace duckdb {
|
5
7
|
|
6
8
|
void LogicalExpressionGet::Serialize(FieldWriter &writer) const {
|
@@ -30,4 +32,13 @@ vector<idx_t> LogicalExpressionGet::GetTableIndex() const {
|
|
30
32
|
return vector<idx_t> {table_index};
|
31
33
|
}
|
32
34
|
|
35
|
+
string LogicalExpressionGet::GetName() const {
|
36
|
+
#ifdef DEBUG
|
37
|
+
if (DBConfigOptions::debug_print_bindings) {
|
38
|
+
return LogicalOperator::GetName() + StringUtil::Format(" #%llu", table_index);
|
39
|
+
}
|
40
|
+
#endif
|
41
|
+
return LogicalOperator::GetName();
|
42
|
+
}
|
43
|
+
|
33
44
|
} // namespace duckdb
|
@@ -6,6 +6,7 @@
|
|
6
6
|
#include "duckdb/common/string_util.hpp"
|
7
7
|
#include "duckdb/function/function_serialization.hpp"
|
8
8
|
#include "duckdb/function/table/table_scan.hpp"
|
9
|
+
#include "duckdb/main/config.hpp"
|
9
10
|
#include "duckdb/storage/data_table.hpp"
|
10
11
|
|
11
12
|
namespace duckdb {
|
@@ -16,10 +17,6 @@ LogicalGet::LogicalGet(idx_t table_index, TableFunction function, unique_ptr<Fun
|
|
16
17
|
bind_data(std::move(bind_data)), returned_types(std::move(returned_types)), names(std::move(returned_names)) {
|
17
18
|
}
|
18
19
|
|
19
|
-
string LogicalGet::GetName() const {
|
20
|
-
return StringUtil::Upper(function.name);
|
21
|
-
}
|
22
|
-
|
23
20
|
optional_ptr<TableCatalogEntry> LogicalGet::GetTable() const {
|
24
21
|
return TableScanFunction::GetTableEntry(function, bind_data.get());
|
25
22
|
}
|
@@ -201,4 +198,13 @@ vector<idx_t> LogicalGet::GetTableIndex() const {
|
|
201
198
|
return vector<idx_t> {table_index};
|
202
199
|
}
|
203
200
|
|
201
|
+
string LogicalGet::GetName() const {
|
202
|
+
#ifdef DEBUG
|
203
|
+
if (DBConfigOptions::debug_print_bindings) {
|
204
|
+
return StringUtil::Upper(function.name) + StringUtil::Format(" #%llu", table_index);
|
205
|
+
}
|
206
|
+
#endif
|
207
|
+
return StringUtil::Upper(function.name);
|
208
|
+
}
|
209
|
+
|
204
210
|
} // namespace duckdb
|