duckdb 0.7.2-dev1457.0 → 0.7.2-dev1533.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 +8 -8
- package/package.json +1 -1
- package/src/duckdb/extension/icu/icu-dateadd.cpp +2 -2
- package/src/duckdb/extension/icu/icu-datepart.cpp +3 -3
- package/src/duckdb/extension/icu/icu-datesub.cpp +2 -2
- package/src/duckdb/extension/icu/icu-datetrunc.cpp +1 -1
- package/src/duckdb/extension/icu/icu-extension.cpp +3 -3
- package/src/duckdb/extension/icu/icu-list-range.cpp +1 -1
- package/src/duckdb/extension/icu/icu-makedate.cpp +1 -1
- package/src/duckdb/extension/icu/icu-strptime.cpp +7 -7
- package/src/duckdb/extension/icu/icu-timebucket.cpp +6 -6
- package/src/duckdb/extension/icu/icu-timezone.cpp +4 -4
- package/src/duckdb/extension/json/include/json_executors.hpp +2 -2
- package/src/duckdb/extension/json/json_functions/copy_json.cpp +4 -4
- package/src/duckdb/extension/json/json_functions/json_create.cpp +3 -3
- package/src/duckdb/extension/json/json_functions/json_serialize_sql.cpp +3 -3
- package/src/duckdb/extension/json/json_functions.cpp +2 -2
- package/src/duckdb/extension/parquet/parquet-extension.cpp +28 -28
- package/src/duckdb/extension/parquet/parquet_metadata.cpp +3 -3
- package/src/duckdb/src/catalog/catalog_entry/duck_index_entry.cpp +2 -2
- package/src/duckdb/src/catalog/catalog_entry/duck_schema_entry.cpp +9 -9
- package/src/duckdb/src/catalog/catalog_entry/duck_table_entry.cpp +17 -17
- package/src/duckdb/src/catalog/catalog_entry/index_catalog_entry.cpp +3 -3
- package/src/duckdb/src/catalog/catalog_entry/scalar_macro_catalog_entry.cpp +2 -2
- package/src/duckdb/src/catalog/catalog_entry/schema_catalog_entry.cpp +2 -2
- package/src/duckdb/src/catalog/catalog_entry/sequence_catalog_entry.cpp +2 -2
- package/src/duckdb/src/catalog/catalog_entry/table_catalog_entry.cpp +5 -5
- package/src/duckdb/src/catalog/catalog_entry/type_catalog_entry.cpp +2 -2
- package/src/duckdb/src/catalog/catalog_entry/view_catalog_entry.cpp +3 -3
- package/src/duckdb/src/catalog/catalog_entry.cpp +2 -2
- package/src/duckdb/src/catalog/catalog_set.cpp +28 -28
- package/src/duckdb/src/catalog/default/default_functions.cpp +2 -1
- package/src/duckdb/src/catalog/dependency_manager.cpp +4 -4
- package/src/duckdb/src/common/enums/logical_operator_type.cpp +2 -0
- package/src/duckdb/src/common/enums/physical_operator_type.cpp +2 -0
- package/src/duckdb/src/common/hive_partitioning.cpp +1 -1
- package/src/duckdb/src/common/multi_file_reader.cpp +1 -1
- package/src/duckdb/src/common/row_operations/row_aggregate.cpp +3 -0
- package/src/duckdb/src/common/string_util.cpp +24 -2
- package/src/duckdb/src/common/tree_renderer.cpp +2 -4
- package/src/duckdb/src/common/types.cpp +3 -1
- package/src/duckdb/src/execution/column_binding_resolver.cpp +5 -5
- package/src/duckdb/src/execution/expression_executor.cpp +4 -3
- package/src/duckdb/src/execution/expression_executor_state.cpp +1 -1
- package/src/duckdb/src/execution/index/art/art.cpp +6 -8
- package/src/duckdb/src/execution/operator/aggregate/distinct_aggregate_data.cpp +7 -7
- package/src/duckdb/src/execution/operator/aggregate/grouped_aggregate_data.cpp +2 -2
- package/src/duckdb/src/execution/operator/aggregate/physical_hash_aggregate.cpp +33 -33
- package/src/duckdb/src/execution/operator/aggregate/physical_perfecthash_aggregate.cpp +13 -13
- package/src/duckdb/src/execution/operator/aggregate/physical_streaming_window.cpp +3 -3
- package/src/duckdb/src/execution/operator/aggregate/physical_ungrouped_aggregate.cpp +20 -20
- package/src/duckdb/src/execution/operator/aggregate/physical_window.cpp +12 -12
- package/src/duckdb/src/execution/operator/helper/physical_batch_collector.cpp +5 -5
- package/src/duckdb/src/execution/operator/helper/physical_explain_analyze.cpp +2 -2
- package/src/duckdb/src/execution/operator/helper/physical_limit.cpp +5 -5
- package/src/duckdb/src/execution/operator/helper/physical_limit_percent.cpp +4 -4
- package/src/duckdb/src/execution/operator/helper/physical_materialized_collector.cpp +4 -4
- package/src/duckdb/src/execution/operator/helper/physical_reservoir_sample.cpp +2 -2
- package/src/duckdb/src/execution/operator/helper/physical_streaming_limit.cpp +2 -2
- package/src/duckdb/src/execution/operator/helper/physical_streaming_sample.cpp +2 -2
- package/src/duckdb/src/execution/operator/helper/physical_vacuum.cpp +4 -4
- package/src/duckdb/src/execution/operator/join/physical_blockwise_nl_join.cpp +8 -8
- package/src/duckdb/src/execution/operator/join/physical_cross_product.cpp +3 -3
- package/src/duckdb/src/execution/operator/join/physical_delim_join.cpp +3 -3
- package/src/duckdb/src/execution/operator/join/physical_hash_join.cpp +12 -12
- package/src/duckdb/src/execution/operator/join/physical_iejoin.cpp +12 -12
- package/src/duckdb/src/execution/operator/join/physical_index_join.cpp +6 -5
- package/src/duckdb/src/execution/operator/join/physical_join.cpp +2 -2
- package/src/duckdb/src/execution/operator/join/physical_nested_loop_join.cpp +13 -13
- package/src/duckdb/src/execution/operator/join/physical_piecewise_merge_join.cpp +10 -10
- package/src/duckdb/src/execution/operator/join/physical_positional_join.cpp +3 -3
- package/src/duckdb/src/execution/operator/order/physical_order.cpp +11 -11
- package/src/duckdb/src/execution/operator/order/physical_top_n.cpp +6 -6
- package/src/duckdb/src/execution/operator/persistent/physical_batch_insert.cpp +7 -7
- package/src/duckdb/src/execution/operator/persistent/physical_copy_to_file.cpp +8 -8
- package/src/duckdb/src/execution/operator/persistent/physical_delete.cpp +5 -5
- package/src/duckdb/src/execution/operator/persistent/physical_export.cpp +1 -1
- package/src/duckdb/src/execution/operator/persistent/physical_insert.cpp +8 -8
- package/src/duckdb/src/execution/operator/persistent/physical_update.cpp +7 -7
- package/src/duckdb/src/execution/operator/projection/physical_pivot.cpp +81 -0
- package/src/duckdb/src/execution/operator/projection/physical_tableinout_function.cpp +5 -5
- package/src/duckdb/src/execution/operator/projection/physical_unnest.cpp +4 -5
- package/src/duckdb/src/execution/operator/scan/physical_column_data_scan.cpp +1 -1
- package/src/duckdb/src/execution/operator/scan/physical_positional_scan.cpp +4 -4
- package/src/duckdb/src/execution/operator/scan/physical_table_scan.cpp +7 -7
- package/src/duckdb/src/execution/operator/schema/physical_alter.cpp +1 -1
- package/src/duckdb/src/execution/operator/schema/physical_attach.cpp +1 -1
- package/src/duckdb/src/execution/operator/schema/physical_create_function.cpp +1 -1
- package/src/duckdb/src/execution/operator/schema/physical_create_index.cpp +8 -7
- package/src/duckdb/src/execution/operator/schema/physical_create_schema.cpp +1 -1
- package/src/duckdb/src/execution/operator/schema/physical_create_sequence.cpp +1 -1
- package/src/duckdb/src/execution/operator/schema/physical_create_table.cpp +1 -1
- package/src/duckdb/src/execution/operator/schema/physical_create_type.cpp +3 -3
- package/src/duckdb/src/execution/operator/schema/physical_create_view.cpp +1 -1
- package/src/duckdb/src/execution/operator/schema/physical_detach.cpp +1 -1
- package/src/duckdb/src/execution/operator/schema/physical_drop.cpp +1 -1
- package/src/duckdb/src/execution/operator/set/physical_recursive_cte.cpp +2 -2
- package/src/duckdb/src/execution/physical_operator.cpp +2 -2
- package/src/duckdb/src/execution/physical_plan/plan_aggregate.cpp +4 -4
- package/src/duckdb/src/execution/physical_plan/plan_comparison_join.cpp +2 -2
- package/src/duckdb/src/execution/physical_plan/plan_create_index.cpp +1 -1
- package/src/duckdb/src/execution/physical_plan/plan_delete.cpp +1 -1
- package/src/duckdb/src/execution/physical_plan/plan_delim_join.cpp +2 -2
- package/src/duckdb/src/execution/physical_plan/plan_distinct.cpp +4 -1
- package/src/duckdb/src/execution/physical_plan/plan_pivot.cpp +14 -0
- package/src/duckdb/src/execution/physical_plan/plan_projection.cpp +1 -1
- package/src/duckdb/src/execution/physical_plan/plan_window.cpp +8 -8
- package/src/duckdb/src/execution/physical_plan_generator.cpp +49 -42
- package/src/duckdb/src/execution/radix_partitioned_hashtable.cpp +14 -14
- package/src/duckdb/src/function/aggregate/algebraic/avg.cpp +2 -2
- package/src/duckdb/src/function/aggregate/distributive/bitstring_agg.cpp +1 -1
- package/src/duckdb/src/function/aggregate/distributive/string_agg.cpp +2 -2
- package/src/duckdb/src/function/aggregate/holistic/approximate_quantile.cpp +1 -1
- package/src/duckdb/src/function/aggregate/holistic/quantile.cpp +1 -1
- package/src/duckdb/src/function/aggregate/holistic/reservoir_quantile.cpp +1 -1
- package/src/duckdb/src/function/aggregate/nested/list.cpp +3 -3
- package/src/duckdb/src/function/cast/enum_casts.cpp +3 -3
- package/src/duckdb/src/function/cast/list_casts.cpp +2 -2
- package/src/duckdb/src/function/cast/string_cast.cpp +6 -6
- package/src/duckdb/src/function/cast/struct_cast.cpp +4 -4
- package/src/duckdb/src/function/cast/union_casts.cpp +6 -6
- package/src/duckdb/src/function/function.cpp +4 -4
- package/src/duckdb/src/function/function_binder.cpp +2 -1
- package/src/duckdb/src/function/macro_function.cpp +3 -3
- package/src/duckdb/src/function/pragma/pragma_queries.cpp +1 -1
- package/src/duckdb/src/function/pragma_function.cpp +1 -1
- package/src/duckdb/src/function/scalar/date/date_part.cpp +1 -1
- package/src/duckdb/src/function/scalar/date/strftime.cpp +6 -6
- package/src/duckdb/src/function/scalar/generic/alias.cpp +1 -1
- package/src/duckdb/src/function/scalar/generic/constant_or_null.cpp +3 -3
- package/src/duckdb/src/function/scalar/generic/current_setting.cpp +2 -2
- package/src/duckdb/src/function/scalar/generic/stats.cpp +3 -3
- package/src/duckdb/src/function/scalar/list/list_aggregates.cpp +5 -5
- package/src/duckdb/src/function/scalar/list/list_lambdas.cpp +3 -3
- package/src/duckdb/src/function/scalar/list/list_sort.cpp +3 -3
- package/src/duckdb/src/function/scalar/math/numeric.cpp +3 -3
- package/src/duckdb/src/function/scalar/math/random.cpp +2 -2
- package/src/duckdb/src/function/scalar/math/setseed.cpp +2 -2
- package/src/duckdb/src/function/scalar/operators/arithmetic.cpp +2 -2
- package/src/duckdb/src/function/scalar/sequence/nextval.cpp +4 -4
- package/src/duckdb/src/function/scalar/string/like.cpp +1 -1
- package/src/duckdb/src/function/scalar/string/regexp/regexp_extract_all.cpp +5 -5
- package/src/duckdb/src/function/scalar/string/regexp.cpp +11 -11
- package/src/duckdb/src/function/scalar/string/string_split.cpp +3 -3
- package/src/duckdb/src/function/scalar/struct/struct_extract.cpp +3 -3
- package/src/duckdb/src/function/scalar/struct/struct_pack.cpp +2 -2
- package/src/duckdb/src/function/scalar/system/aggregate_export.cpp +2 -2
- package/src/duckdb/src/function/scalar/union/union_extract.cpp +2 -2
- package/src/duckdb/src/function/scalar_macro_function.cpp +3 -3
- package/src/duckdb/src/function/table/arrow.cpp +5 -5
- package/src/duckdb/src/function/table/checkpoint.cpp +1 -1
- package/src/duckdb/src/function/table/glob.cpp +1 -1
- package/src/duckdb/src/function/table/pragma_detailed_profiling_output.cpp +1 -1
- package/src/duckdb/src/function/table/pragma_last_profiling_output.cpp +1 -1
- package/src/duckdb/src/function/table/range.cpp +5 -5
- package/src/duckdb/src/function/table/read_csv.cpp +10 -10
- package/src/duckdb/src/function/table/repeat.cpp +1 -1
- package/src/duckdb/src/function/table/system/duckdb_constraints.cpp +12 -12
- package/src/duckdb/src/function/table/system/duckdb_databases.cpp +1 -1
- package/src/duckdb/src/function/table/system/duckdb_functions.cpp +2 -2
- package/src/duckdb/src/function/table/system/duckdb_indexes.cpp +1 -1
- package/src/duckdb/src/function/table/system/duckdb_sequences.cpp +1 -1
- package/src/duckdb/src/function/table/system/duckdb_tables.cpp +2 -2
- package/src/duckdb/src/function/table/system/duckdb_views.cpp +1 -1
- package/src/duckdb/src/function/table/system/pragma_storage_info.cpp +1 -1
- package/src/duckdb/src/function/table/system/pragma_table_info.cpp +3 -3
- package/src/duckdb/src/function/table/system/test_vector_types.cpp +1 -1
- package/src/duckdb/src/function/table/table_scan.cpp +31 -31
- package/src/duckdb/src/function/table/unnest.cpp +4 -4
- package/src/duckdb/src/function/table/version/pragma_version.cpp +2 -2
- package/src/duckdb/src/function/table_macro_function.cpp +2 -2
- package/src/duckdb/src/include/duckdb/catalog/catalog.hpp +13 -0
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/duck_index_entry.hpp +2 -2
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/duck_table_entry.hpp +1 -1
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/index_catalog_entry.hpp +4 -4
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/macro_catalog_entry.hpp +3 -2
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/scalar_macro_catalog_entry.hpp +1 -1
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/schema_catalog_entry.hpp +2 -2
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/sequence_catalog_entry.hpp +2 -2
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/table_catalog_entry.hpp +2 -2
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/table_macro_catalog_entry.hpp +1 -1
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/type_catalog_entry.hpp +2 -2
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/view_catalog_entry.hpp +3 -3
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry.hpp +14 -3
- package/src/duckdb/src/include/duckdb/catalog/catalog_set.hpp +5 -5
- package/src/duckdb/src/include/duckdb/common/case_insensitive_map.hpp +2 -3
- package/src/duckdb/src/include/duckdb/common/enums/logical_operator_type.hpp +1 -0
- package/src/duckdb/src/include/duckdb/common/enums/physical_operator_type.hpp +2 -0
- package/src/duckdb/src/include/duckdb/common/multi_file_reader_options.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/string_util.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/index/art/art.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/aggregate/physical_hash_aggregate.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/operator/aggregate/physical_perfecthash_aggregate.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/operator/aggregate/physical_streaming_window.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/operator/aggregate/physical_ungrouped_aggregate.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/operator/aggregate/physical_window.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/operator/filter/physical_filter.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_execute.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_explain_analyze.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_limit.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_limit_percent.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_load.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_pragma.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_prepare.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_reset.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_set.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_streaming_limit.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_streaming_sample.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_transaction.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_vacuum.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_blockwise_nl_join.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_cross_product.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_delim_join.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_hash_join.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_iejoin.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_index_join.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_join.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_nested_loop_join.hpp +3 -4
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_piecewise_merge_join.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_positional_join.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/operator/order/physical_order.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/operator/order/physical_top_n.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_batch_insert.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_copy_to_file.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_delete.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_export.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_insert.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_update.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/operator/projection/physical_pivot.hpp +38 -0
- package/src/duckdb/src/include/duckdb/execution/operator/projection/physical_projection.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/operator/projection/physical_tableinout_function.hpp +4 -2
- package/src/duckdb/src/include/duckdb/execution/operator/projection/physical_unnest.hpp +3 -1
- package/src/duckdb/src/include/duckdb/execution/operator/scan/physical_column_data_scan.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/operator/scan/physical_dummy_scan.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/operator/scan/physical_empty_result.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/operator/scan/physical_expression_scan.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/operator/scan/physical_positional_scan.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/operator/scan/physical_table_scan.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_alter.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_attach.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_create_function.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_create_index.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_create_schema.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_create_sequence.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_create_table.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_create_type.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_create_view.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_detach.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_drop.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/operator/set/physical_recursive_cte.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/operator/set/physical_union.hpp +4 -0
- package/src/duckdb/src/include/duckdb/execution/physical_operator.hpp +18 -57
- package/src/duckdb/src/include/duckdb/execution/physical_operator_states.hpp +150 -0
- package/src/duckdb/src/include/duckdb/execution/physical_plan_generator.hpp +1 -0
- package/src/duckdb/src/include/duckdb/function/cast/default_casts.hpp +11 -0
- package/src/duckdb/src/include/duckdb/function/copy_function.hpp +22 -0
- package/src/duckdb/src/include/duckdb/function/function.hpp +20 -4
- package/src/duckdb/src/include/duckdb/function/macro_function.hpp +3 -3
- package/src/duckdb/src/include/duckdb/function/pragma_function.hpp +1 -1
- package/src/duckdb/src/include/duckdb/function/scalar/nested_functions.hpp +1 -1
- package/src/duckdb/src/include/duckdb/function/scalar_function.hpp +11 -0
- package/src/duckdb/src/include/duckdb/function/scalar_macro_function.hpp +2 -2
- package/src/duckdb/src/include/duckdb/function/table_function.hpp +22 -0
- package/src/duckdb/src/include/duckdb/function/table_macro_function.hpp +3 -3
- package/src/duckdb/src/include/duckdb/main/client_config.hpp +3 -2
- package/src/duckdb/src/include/duckdb/main/settings.hpp +10 -0
- package/src/duckdb/src/include/duckdb/optimizer/rule/like_optimizations.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/base_expression.hpp +18 -0
- package/src/duckdb/src/include/duckdb/parser/constraint.hpp +18 -0
- package/src/duckdb/src/include/duckdb/parser/constraints/check_constraint.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/constraints/foreign_key_constraint.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/constraints/not_null_constraint.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/constraints/unique_constraint.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/expression/between_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/expression/bound_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/expression/case_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/expression/cast_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/expression/collate_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/expression/columnref_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/expression/comparison_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/expression/conjunction_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/expression/constant_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/expression/default_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/expression/function_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/expression/lambda_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/expression/operator_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/expression/parameter_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/expression/positional_reference_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/expression/star_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/expression/subquery_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/expression/window_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/query_node/list.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/query_node/recursive_cte_node.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/query_node/select_node.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/query_node/set_operation_node.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/query_node.hpp +18 -0
- package/src/duckdb/src/include/duckdb/parser/sql_statement.hpp +18 -0
- package/src/duckdb/src/include/duckdb/parser/statement/alter_statement.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/statement/attach_statement.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/statement/call_statement.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/statement/copy_statement.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/statement/create_statement.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/statement/delete_statement.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/statement/detach_statement.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/statement/drop_statement.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/statement/execute_statement.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/statement/explain_statement.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/statement/export_statement.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/statement/extension_statement.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/statement/insert_statement.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/statement/list.hpp +1 -0
- package/src/duckdb/src/include/duckdb/parser/statement/load_statement.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/statement/logical_plan_statement.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/statement/multi_statement.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/statement/pragma_statement.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/statement/prepare_statement.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/statement/relation_statement.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/statement/select_statement.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/statement/set_statement.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/statement/show_statement.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/statement/transaction_statement.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/statement/update_statement.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/statement/vacuum_statement.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/tableref/basetableref.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/tableref/emptytableref.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/tableref/expressionlistref.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/tableref/joinref.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/tableref/pivotref.hpp +14 -0
- package/src/duckdb/src/include/duckdb/parser/tableref/subqueryref.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/tableref/table_function_ref.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/tableref.hpp +17 -0
- package/src/duckdb/src/include/duckdb/planner/bind_context.hpp +2 -0
- package/src/duckdb/src/include/duckdb/planner/binder.hpp +2 -0
- package/src/duckdb/src/include/duckdb/planner/bound_constraint.hpp +18 -0
- package/src/duckdb/src/include/duckdb/planner/bound_query_node.hpp +17 -0
- package/src/duckdb/src/include/duckdb/planner/bound_result_modifier.hpp +5 -1
- package/src/duckdb/src/include/duckdb/planner/bound_tableref.hpp +17 -0
- package/src/duckdb/src/include/duckdb/planner/bound_tokens.hpp +1 -0
- package/src/duckdb/src/include/duckdb/planner/constraints/bound_check_constraint.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/constraints/bound_foreign_key_constraint.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/constraints/bound_not_null_constraint.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/constraints/bound_unique_constraint.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_aggregate_expression.hpp +4 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_between_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_case_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_cast_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_columnref_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_comparison_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_conjunction_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_constant_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_default_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_function_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_lambda_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_lambdaref_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_operator_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_parameter_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_reference_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_subquery_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_unnest_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_window_expression.hpp +4 -1
- package/src/duckdb/src/include/duckdb/planner/expression_binder/table_function_binder.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression_binder.hpp +2 -0
- package/src/duckdb/src/include/duckdb/planner/logical_operator.hpp +17 -0
- package/src/duckdb/src/include/duckdb/planner/logical_tokens.hpp +1 -0
- package/src/duckdb/src/include/duckdb/planner/operator/list.hpp +1 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_aggregate.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_any_join.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_asof_join.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_column_data_get.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_comparison_join.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_copy_to_file.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_create.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_create_index.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_create_table.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_cross_product.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_cteref.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_delete.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_delim_get.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_delim_join.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_distinct.hpp +12 -4
- package/src/duckdb/src/include/duckdb/planner/operator/logical_dummy_scan.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_empty_result.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_execute.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_explain.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_export.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_expression_get.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_extension_operator.hpp +4 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_filter.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_get.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_insert.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_join.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_limit.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_limit_percent.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_order.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_pivot.hpp +36 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_positional_join.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_pragma.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_prepare.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_projection.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_recursive_cte.hpp +9 -5
- package/src/duckdb/src/include/duckdb/planner/operator/logical_reset.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_sample.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_set.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_set_operation.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_show.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_simple.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_top_n.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_unconditional_join.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_unnest.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_update.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_window.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/query_node/bound_recursive_cte_node.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/query_node/bound_select_node.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/query_node/bound_set_operation_node.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/query_node/list.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/tableref/bound_basetableref.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/tableref/bound_cteref.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/tableref/bound_dummytableref.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/tableref/bound_expressionlistref.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/tableref/bound_joinref.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/tableref/bound_pivotref.hpp +43 -0
- package/src/duckdb/src/include/duckdb/planner/tableref/bound_pos_join_ref.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/tableref/bound_subqueryref.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/tableref/bound_table_function.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/tableref/list.hpp +1 -0
- package/src/duckdb/src/include/duckdb/storage/index.hpp +15 -2
- package/src/duckdb/src/include/duckdb/storage/write_ahead_log.hpp +17 -17
- package/src/duckdb/src/include/duckdb/transaction/commit_state.hpp +1 -1
- package/src/duckdb/src/main/capi/table_function-c.cpp +9 -9
- package/src/duckdb/src/main/client_context.cpp +1 -1
- package/src/duckdb/src/main/config.cpp +1 -0
- package/src/duckdb/src/main/query_profiler.cpp +2 -2
- package/src/duckdb/src/main/relation/aggregate_relation.cpp +1 -1
- package/src/duckdb/src/main/relation/filter_relation.cpp +1 -1
- package/src/duckdb/src/main/relation/projection_relation.cpp +1 -1
- package/src/duckdb/src/main/relation.cpp +1 -1
- package/src/duckdb/src/main/settings/settings.cpp +17 -1
- package/src/duckdb/src/optimizer/column_lifetime_analyzer.cpp +3 -3
- package/src/duckdb/src/optimizer/common_aggregate_optimizer.cpp +1 -1
- package/src/duckdb/src/optimizer/cse_optimizer.cpp +1 -1
- package/src/duckdb/src/optimizer/deliminator.cpp +11 -11
- package/src/duckdb/src/optimizer/expression_heuristics.cpp +11 -11
- package/src/duckdb/src/optimizer/expression_rewriter.cpp +1 -1
- package/src/duckdb/src/optimizer/filter_combiner.cpp +40 -38
- package/src/duckdb/src/optimizer/filter_pullup.cpp +2 -2
- package/src/duckdb/src/optimizer/filter_pushdown.cpp +1 -1
- package/src/duckdb/src/optimizer/join_order/cardinality_estimator.cpp +8 -8
- package/src/duckdb/src/optimizer/join_order/join_order_optimizer.cpp +24 -24
- package/src/duckdb/src/optimizer/matcher/expression_matcher.cpp +12 -12
- package/src/duckdb/src/optimizer/pullup/pullup_filter.cpp +1 -1
- package/src/duckdb/src/optimizer/pullup/pullup_projection.cpp +2 -2
- package/src/duckdb/src/optimizer/pullup/pullup_set_operation.cpp +3 -3
- package/src/duckdb/src/optimizer/pushdown/pushdown_aggregate.cpp +3 -3
- package/src/duckdb/src/optimizer/pushdown/pushdown_filter.cpp +1 -1
- package/src/duckdb/src/optimizer/pushdown/pushdown_get.cpp +1 -1
- package/src/duckdb/src/optimizer/pushdown/pushdown_inner_join.cpp +3 -3
- package/src/duckdb/src/optimizer/pushdown/pushdown_left_join.cpp +3 -3
- package/src/duckdb/src/optimizer/pushdown/pushdown_limit.cpp +1 -1
- package/src/duckdb/src/optimizer/pushdown/pushdown_mark_join.cpp +3 -3
- package/src/duckdb/src/optimizer/pushdown/pushdown_projection.cpp +2 -2
- package/src/duckdb/src/optimizer/pushdown/pushdown_set_operation.cpp +4 -4
- package/src/duckdb/src/optimizer/pushdown/pushdown_single_join.cpp +1 -1
- package/src/duckdb/src/optimizer/regex_range_filter.cpp +2 -2
- package/src/duckdb/src/optimizer/remove_unused_columns.cpp +13 -9
- package/src/duckdb/src/optimizer/rule/arithmetic_simplification.cpp +20 -20
- package/src/duckdb/src/optimizer/rule/case_simplification.cpp +8 -8
- package/src/duckdb/src/optimizer/rule/comparison_simplification.cpp +14 -14
- package/src/duckdb/src/optimizer/rule/conjunction_simplification.cpp +5 -5
- package/src/duckdb/src/optimizer/rule/date_part_simplification.cpp +2 -2
- package/src/duckdb/src/optimizer/rule/distributivity.cpp +16 -16
- package/src/duckdb/src/optimizer/rule/empty_needle_removal.cpp +4 -5
- package/src/duckdb/src/optimizer/rule/enum_comparison.cpp +8 -9
- package/src/duckdb/src/optimizer/rule/in_clause_simplification_rule.cpp +13 -13
- package/src/duckdb/src/optimizer/rule/like_optimizations.cpp +12 -12
- package/src/duckdb/src/optimizer/rule/move_constants.cpp +31 -31
- package/src/duckdb/src/optimizer/rule/ordered_aggregate_optimizer.cpp +4 -4
- package/src/duckdb/src/optimizer/rule/regex_optimizations.cpp +10 -10
- package/src/duckdb/src/optimizer/statistics/operator/propagate_filter.cpp +9 -8
- package/src/duckdb/src/optimizer/statistics/operator/propagate_join.cpp +2 -2
- package/src/duckdb/src/optimizer/statistics_propagator.cpp +31 -20
- package/src/duckdb/src/optimizer/topn_optimizer.cpp +2 -2
- package/src/duckdb/src/optimizer/unnest_rewriter.cpp +13 -13
- package/src/duckdb/src/parser/column_definition.cpp +3 -3
- package/src/duckdb/src/parser/expression/columnref_expression.cpp +2 -5
- package/src/duckdb/src/parser/expression/conjunction_expression.cpp +1 -1
- package/src/duckdb/src/parser/expression/constant_expression.cpp +1 -1
- package/src/duckdb/src/parser/parsed_data/create_view_info.cpp +1 -1
- package/src/duckdb/src/parser/parsed_expression_iterator.cpp +20 -20
- package/src/duckdb/src/parser/parser.cpp +10 -10
- package/src/duckdb/src/parser/query_node/recursive_cte_node.cpp +4 -4
- package/src/duckdb/src/parser/query_node/select_node.cpp +10 -10
- package/src/duckdb/src/parser/query_node/set_operation_node.cpp +4 -4
- package/src/duckdb/src/parser/statement/insert_statement.cpp +1 -1
- package/src/duckdb/src/parser/statement/select_statement.cpp +2 -2
- package/src/duckdb/src/parser/transform/expression/transform_array_access.cpp +1 -1
- package/src/duckdb/src/parser/transform/expression/transform_columnref.cpp +3 -3
- package/src/duckdb/src/parser/transform/expression/transform_function.cpp +2 -42
- package/src/duckdb/src/parser/transform/expression/transform_operator.cpp +1 -1
- package/src/duckdb/src/parser/transform/helpers/transform_groupby.cpp +1 -1
- package/src/duckdb/src/parser/transform/statement/transform_create_type.cpp +0 -1
- package/src/duckdb/src/parser/transform/statement/transform_pivot_stmt.cpp +5 -2
- package/src/duckdb/src/parser/transform/statement/transform_pragma.cpp +5 -5
- package/src/duckdb/src/parser/transform/statement/transform_select_node.cpp +20 -20
- package/src/duckdb/src/parser/transform/tableref/transform_pivot.cpp +3 -3
- package/src/duckdb/src/planner/bind_context.cpp +11 -0
- package/src/duckdb/src/planner/binder/expression/bind_columnref_expression.cpp +47 -4
- package/src/duckdb/src/planner/binder/expression/bind_function_expression.cpp +5 -6
- package/src/duckdb/src/planner/binder/expression/bind_lambda.cpp +2 -2
- package/src/duckdb/src/planner/binder/expression/bind_macro_expression.cpp +3 -3
- package/src/duckdb/src/planner/binder/expression/bind_star_expression.cpp +8 -8
- package/src/duckdb/src/planner/binder/query_node/bind_select_node.cpp +23 -29
- package/src/duckdb/src/planner/binder/query_node/bind_setop_node.cpp +2 -2
- package/src/duckdb/src/planner/binder/query_node/bind_table_macro_node.cpp +1 -1
- package/src/duckdb/src/planner/binder/query_node/plan_query_node.cpp +3 -3
- package/src/duckdb/src/planner/binder/query_node/plan_recursive_cte_node.cpp +2 -3
- package/src/duckdb/src/planner/binder/query_node/plan_select_node.cpp +0 -2
- package/src/duckdb/src/planner/binder/query_node/plan_subquery.cpp +1 -1
- package/src/duckdb/src/planner/binder/statement/bind_call.cpp +3 -2
- package/src/duckdb/src/planner/binder/statement/bind_copy.cpp +1 -1
- package/src/duckdb/src/planner/binder/statement/bind_create.cpp +17 -16
- package/src/duckdb/src/planner/binder/statement/bind_create_table.cpp +7 -6
- package/src/duckdb/src/planner/binder/statement/bind_delete.cpp +3 -2
- package/src/duckdb/src/planner/binder/statement/bind_export.cpp +1 -1
- package/src/duckdb/src/planner/binder/statement/bind_extension.cpp +1 -1
- package/src/duckdb/src/planner/binder/statement/bind_insert.cpp +4 -4
- package/src/duckdb/src/planner/binder/statement/bind_set.cpp +2 -2
- package/src/duckdb/src/planner/binder/statement/bind_update.cpp +2 -1
- package/src/duckdb/src/planner/binder/statement/bind_vacuum.cpp +2 -2
- package/src/duckdb/src/planner/binder/tableref/bind_basetableref.cpp +4 -3
- package/src/duckdb/src/planner/binder/tableref/bind_pivot.cpp +303 -78
- package/src/duckdb/src/planner/binder/tableref/bind_subqueryref.cpp +4 -4
- package/src/duckdb/src/planner/binder/tableref/bind_table_function.cpp +10 -10
- package/src/duckdb/src/planner/binder/tableref/plan_joinref.cpp +6 -6
- package/src/duckdb/src/planner/binder/tableref/plan_pivotref.cpp +13 -0
- package/src/duckdb/src/planner/binder.cpp +52 -48
- package/src/duckdb/src/planner/expression/bound_aggregate_expression.cpp +8 -8
- package/src/duckdb/src/planner/expression/bound_between_expression.cpp +5 -5
- package/src/duckdb/src/planner/expression/bound_case_expression.cpp +1 -1
- package/src/duckdb/src/planner/expression/bound_cast_expression.cpp +5 -5
- package/src/duckdb/src/planner/expression/bound_columnref_expression.cpp +2 -2
- package/src/duckdb/src/planner/expression/bound_comparison_expression.cpp +3 -4
- package/src/duckdb/src/planner/expression/bound_conjunction_expression.cpp +2 -2
- package/src/duckdb/src/planner/expression/bound_constant_expression.cpp +2 -2
- package/src/duckdb/src/planner/expression/bound_function_expression.cpp +4 -4
- package/src/duckdb/src/planner/expression/bound_lambda_expression.cpp +4 -4
- package/src/duckdb/src/planner/expression/bound_lambdaref_expression.cpp +2 -2
- package/src/duckdb/src/planner/expression/bound_operator_expression.cpp +2 -2
- package/src/duckdb/src/planner/expression/bound_parameter_expression.cpp +3 -3
- package/src/duckdb/src/planner/expression/bound_reference_expression.cpp +2 -2
- package/src/duckdb/src/planner/expression/bound_unnest_expression.cpp +2 -2
- package/src/duckdb/src/planner/expression/bound_window_expression.cpp +16 -16
- package/src/duckdb/src/planner/expression_binder/alter_binder.cpp +1 -1
- package/src/duckdb/src/planner/expression_binder/base_select_binder.cpp +3 -3
- package/src/duckdb/src/planner/expression_binder/check_binder.cpp +1 -1
- package/src/duckdb/src/planner/expression_binder/constant_binder.cpp +11 -1
- package/src/duckdb/src/planner/expression_binder/group_binder.cpp +2 -2
- package/src/duckdb/src/planner/expression_binder/index_binder.cpp +1 -1
- package/src/duckdb/src/planner/expression_binder/lateral_binder.cpp +3 -3
- package/src/duckdb/src/planner/expression_binder/order_binder.cpp +3 -3
- package/src/duckdb/src/planner/expression_binder/qualify_binder.cpp +2 -1
- package/src/duckdb/src/planner/expression_binder/table_function_binder.cpp +7 -3
- package/src/duckdb/src/planner/expression_binder.cpp +24 -32
- package/src/duckdb/src/planner/expression_iterator.cpp +17 -17
- package/src/duckdb/src/planner/joinside.cpp +2 -2
- package/src/duckdb/src/planner/logical_operator.cpp +3 -0
- package/src/duckdb/src/planner/logical_operator_visitor.cpp +26 -26
- package/src/duckdb/src/planner/operator/logical_distinct.cpp +3 -1
- package/src/duckdb/src/planner/operator/logical_filter.cpp +1 -1
- package/src/duckdb/src/planner/operator/logical_join.cpp +1 -1
- package/src/duckdb/src/planner/operator/logical_pivot.cpp +35 -0
- package/src/duckdb/src/planner/operator/logical_recursive_cte.cpp +1 -1
- package/src/duckdb/src/planner/pragma_handler.cpp +2 -2
- package/src/duckdb/src/planner/subquery/flatten_dependent_join.cpp +25 -23
- package/src/duckdb/src/planner/subquery/rewrite_correlated_expressions.cpp +2 -2
- package/src/duckdb/src/planner/table_binding.cpp +8 -8
- package/src/duckdb/src/storage/checkpoint/table_data_writer.cpp +1 -1
- package/src/duckdb/src/storage/data_table.cpp +2 -1
- package/src/duckdb/src/storage/index.cpp +4 -5
- package/src/duckdb/src/storage/local_storage.cpp +2 -1
- package/src/duckdb/src/storage/table/row_group_collection.cpp +1 -1
- package/src/duckdb/src/storage/write_ahead_log.cpp +42 -42
- package/src/duckdb/src/transaction/commit_state.cpp +35 -35
- package/src/duckdb/src/transaction/duck_transaction.cpp +1 -1
- package/src/duckdb/src/transaction/rollback_state.cpp +1 -1
- package/src/duckdb/src/verification/deserialized_statement_verifier.cpp +1 -1
- package/src/duckdb/third_party/libpg_query/include/parser/gram.hpp +773 -793
- package/src/duckdb/third_party/libpg_query/include/parser/kwlist.hpp +1 -11
- package/src/duckdb/third_party/libpg_query/src_backend_parser_gram.cpp +17408 -17751
- package/src/duckdb/ub_extension_icu_third_party_icu_i18n.cpp +5 -5
- package/src/duckdb/ub_src_execution_operator_projection.cpp +2 -0
- package/src/duckdb/ub_src_execution_physical_plan.cpp +2 -0
- package/src/duckdb/ub_src_planner_binder_tableref.cpp +2 -0
- package/src/duckdb/ub_src_planner_operator.cpp +2 -0
@@ -37,7 +37,7 @@ struct AggregateState {
|
|
37
37
|
explicit AggregateState(const vector<unique_ptr<Expression>> &aggregate_expressions) {
|
38
38
|
for (auto &aggregate : aggregate_expressions) {
|
39
39
|
D_ASSERT(aggregate->GetExpressionClass() == ExpressionClass::BOUND_AGGREGATE);
|
40
|
-
auto &aggr = (
|
40
|
+
auto &aggr = aggregate->Cast<BoundAggregateExpression>();
|
41
41
|
auto state = unique_ptr<data_t[]>(new data_t[aggr.function.state_size()]);
|
42
42
|
aggr.function.initialize(state.get());
|
43
43
|
aggregates.push_back(std::move(state));
|
@@ -97,7 +97,7 @@ public:
|
|
97
97
|
UngroupedAggregateLocalState(const PhysicalUngroupedAggregate &op, const vector<LogicalType> &child_types,
|
98
98
|
GlobalSinkState &gstate_p, ExecutionContext &context)
|
99
99
|
: state(op.aggregates), child_executor(context.client), aggregate_input_chunk(), filter_set() {
|
100
|
-
auto &gstate = (
|
100
|
+
auto &gstate = gstate_p.Cast<UngroupedAggregateGlobalState>();
|
101
101
|
|
102
102
|
auto &allocator = Allocator::Get(context.client);
|
103
103
|
InitializeDistinctAggregates(op, gstate, context);
|
@@ -106,7 +106,7 @@ public:
|
|
106
106
|
vector<AggregateObject> aggregate_objects;
|
107
107
|
for (auto &aggregate : op.aggregates) {
|
108
108
|
D_ASSERT(aggregate->GetExpressionClass() == ExpressionClass::BOUND_AGGREGATE);
|
109
|
-
auto &aggr = (
|
109
|
+
auto &aggr = aggregate->Cast<BoundAggregateExpression>();
|
110
110
|
// initialize the payload chunk
|
111
111
|
for (auto &child : aggr.children) {
|
112
112
|
payload_types.push_back(child->return_type);
|
@@ -174,8 +174,8 @@ unique_ptr<LocalSinkState> PhysicalUngroupedAggregate::GetLocalSinkState(Executi
|
|
174
174
|
|
175
175
|
void PhysicalUngroupedAggregate::SinkDistinct(ExecutionContext &context, GlobalSinkState &state, LocalSinkState &lstate,
|
176
176
|
DataChunk &input) const {
|
177
|
-
auto &sink = (
|
178
|
-
auto &global_sink = (
|
177
|
+
auto &sink = lstate.Cast<UngroupedAggregateLocalState>();
|
178
|
+
auto &global_sink = state.Cast<UngroupedAggregateGlobalState>();
|
179
179
|
D_ASSERT(distinct_data);
|
180
180
|
auto &distinct_state = *global_sink.distinct_state;
|
181
181
|
auto &distinct_info = *distinct_collection_info;
|
@@ -186,7 +186,7 @@ void PhysicalUngroupedAggregate::SinkDistinct(ExecutionContext &context, GlobalS
|
|
186
186
|
auto &distinct_filter = distinct_info.Indices();
|
187
187
|
|
188
188
|
for (auto &idx : distinct_indices) {
|
189
|
-
auto &aggregate =
|
189
|
+
auto &aggregate = aggregates[idx]->Cast<BoundAggregateExpression>();
|
190
190
|
|
191
191
|
idx_t table_idx = distinct_info.table_map[idx];
|
192
192
|
if (!distinct_data->radix_tables[table_idx]) {
|
@@ -217,7 +217,7 @@ void PhysicalUngroupedAggregate::SinkDistinct(ExecutionContext &context, GlobalS
|
|
217
217
|
|
218
218
|
SinkResultType PhysicalUngroupedAggregate::Sink(ExecutionContext &context, GlobalSinkState &state,
|
219
219
|
LocalSinkState &lstate, DataChunk &input) const {
|
220
|
-
auto &sink = (
|
220
|
+
auto &sink = lstate.Cast<UngroupedAggregateLocalState>();
|
221
221
|
|
222
222
|
// perform the aggregation inside the local state
|
223
223
|
sink.Reset();
|
@@ -232,7 +232,7 @@ SinkResultType PhysicalUngroupedAggregate::Sink(ExecutionContext &context, Globa
|
|
232
232
|
idx_t next_payload_idx = 0;
|
233
233
|
|
234
234
|
for (idx_t aggr_idx = 0; aggr_idx < aggregates.size(); aggr_idx++) {
|
235
|
-
auto &aggregate =
|
235
|
+
auto &aggregate = aggregates[aggr_idx]->Cast<BoundAggregateExpression>();
|
236
236
|
|
237
237
|
payload_idx = next_payload_idx;
|
238
238
|
next_payload_idx = payload_idx + aggregate.children.size();
|
@@ -279,8 +279,8 @@ SinkResultType PhysicalUngroupedAggregate::Sink(ExecutionContext &context, Globa
|
|
279
279
|
|
280
280
|
void PhysicalUngroupedAggregate::CombineDistinct(ExecutionContext &context, GlobalSinkState &state,
|
281
281
|
LocalSinkState &lstate) const {
|
282
|
-
auto &global_sink = (
|
283
|
-
auto &source = (
|
282
|
+
auto &global_sink = state.Cast<UngroupedAggregateGlobalState>();
|
283
|
+
auto &source = lstate.Cast<UngroupedAggregateLocalState>();
|
284
284
|
|
285
285
|
if (!distinct_data) {
|
286
286
|
return;
|
@@ -299,8 +299,8 @@ void PhysicalUngroupedAggregate::CombineDistinct(ExecutionContext &context, Glob
|
|
299
299
|
|
300
300
|
void PhysicalUngroupedAggregate::Combine(ExecutionContext &context, GlobalSinkState &state,
|
301
301
|
LocalSinkState &lstate) const {
|
302
|
-
auto &gstate = (
|
303
|
-
auto &source = (
|
302
|
+
auto &gstate = state.Cast<UngroupedAggregateGlobalState>();
|
303
|
+
auto &source = lstate.Cast<UngroupedAggregateLocalState>();
|
304
304
|
D_ASSERT(!gstate.finished);
|
305
305
|
|
306
306
|
// finalize: combine the local state into the global state
|
@@ -311,7 +311,7 @@ void PhysicalUngroupedAggregate::Combine(ExecutionContext &context, GlobalSinkSt
|
|
311
311
|
CombineDistinct(context, state, lstate);
|
312
312
|
|
313
313
|
for (idx_t aggr_idx = 0; aggr_idx < aggregates.size(); aggr_idx++) {
|
314
|
-
auto &aggregate =
|
314
|
+
auto &aggregate = aggregates[aggr_idx]->Cast<BoundAggregateExpression>();
|
315
315
|
|
316
316
|
if (aggregate.IsDistinct()) {
|
317
317
|
continue;
|
@@ -353,7 +353,7 @@ public:
|
|
353
353
|
idx_t next_payload_idx = 0;
|
354
354
|
|
355
355
|
for (idx_t i = 0; i < aggregates.size(); i++) {
|
356
|
-
auto &aggregate =
|
356
|
+
auto &aggregate = aggregates[i]->Cast<BoundAggregateExpression>();
|
357
357
|
|
358
358
|
// Forward the payload idx
|
359
359
|
payload_idx = next_payload_idx;
|
@@ -478,7 +478,7 @@ public:
|
|
478
478
|
|
479
479
|
SinkFinalizeType PhysicalUngroupedAggregate::FinalizeDistinct(Pipeline &pipeline, Event &event, ClientContext &context,
|
480
480
|
GlobalSinkState &gstate_p) const {
|
481
|
-
auto &gstate = (
|
481
|
+
auto &gstate = gstate_p.Cast<UngroupedAggregateGlobalState>();
|
482
482
|
D_ASSERT(distinct_data);
|
483
483
|
auto &distinct_state = *gstate.distinct_state;
|
484
484
|
|
@@ -505,7 +505,7 @@ SinkFinalizeType PhysicalUngroupedAggregate::FinalizeDistinct(Pipeline &pipeline
|
|
505
505
|
|
506
506
|
SinkFinalizeType PhysicalUngroupedAggregate::Finalize(Pipeline &pipeline, Event &event, ClientContext &context,
|
507
507
|
GlobalSinkState &gstate_p) const {
|
508
|
-
auto &gstate = (
|
508
|
+
auto &gstate = gstate_p.Cast<UngroupedAggregateGlobalState>();
|
509
509
|
|
510
510
|
if (distinct_data) {
|
511
511
|
return FinalizeDistinct(pipeline, event, context, gstate_p);
|
@@ -534,7 +534,7 @@ unique_ptr<GlobalSourceState> PhysicalUngroupedAggregate::GetGlobalSourceState(C
|
|
534
534
|
void VerifyNullHandling(DataChunk &chunk, AggregateState &state, const vector<unique_ptr<Expression>> &aggregates) {
|
535
535
|
#ifdef DEBUG
|
536
536
|
for (idx_t aggr_idx = 0; aggr_idx < aggregates.size(); aggr_idx++) {
|
537
|
-
auto &aggr =
|
537
|
+
auto &aggr = aggregates[aggr_idx]->Cast<BoundAggregateExpression>();
|
538
538
|
if (state.counts[aggr_idx] == 0 && aggr.function.null_handling == FunctionNullHandling::DEFAULT_NULL_HANDLING) {
|
539
539
|
// Default is when 0 values go in, NULL comes out
|
540
540
|
UnifiedVectorFormat vdata;
|
@@ -547,7 +547,7 @@ void VerifyNullHandling(DataChunk &chunk, AggregateState &state, const vector<un
|
|
547
547
|
|
548
548
|
void PhysicalUngroupedAggregate::GetData(ExecutionContext &context, DataChunk &chunk, GlobalSourceState &gstate_p,
|
549
549
|
LocalSourceState &lstate) const {
|
550
|
-
auto &gstate = (
|
550
|
+
auto &gstate = sink_state->Cast<UngroupedAggregateGlobalState>();
|
551
551
|
auto &state = (UngroupedAggregateState &)gstate_p;
|
552
552
|
D_ASSERT(gstate.finished);
|
553
553
|
if (state.finished) {
|
@@ -557,7 +557,7 @@ void PhysicalUngroupedAggregate::GetData(ExecutionContext &context, DataChunk &c
|
|
557
557
|
// initialize the result chunk with the aggregate values
|
558
558
|
chunk.SetCardinality(1);
|
559
559
|
for (idx_t aggr_idx = 0; aggr_idx < aggregates.size(); aggr_idx++) {
|
560
|
-
auto &aggregate =
|
560
|
+
auto &aggregate = aggregates[aggr_idx]->Cast<BoundAggregateExpression>();
|
561
561
|
|
562
562
|
Vector state_vector(Value::POINTER((uintptr_t)gstate.state.aggregates[aggr_idx].get()));
|
563
563
|
AggregateInputData aggr_input_data(aggregate.bind_info.get(), Allocator::DefaultAllocator());
|
@@ -570,7 +570,7 @@ void PhysicalUngroupedAggregate::GetData(ExecutionContext &context, DataChunk &c
|
|
570
570
|
string PhysicalUngroupedAggregate::ParamsToString() const {
|
571
571
|
string result;
|
572
572
|
for (idx_t i = 0; i < aggregates.size(); i++) {
|
573
|
-
auto &aggregate =
|
573
|
+
auto &aggregate = aggregates[i]->Cast<BoundAggregateExpression>();
|
574
574
|
if (i > 0) {
|
575
575
|
result += "\n";
|
576
576
|
}
|
@@ -454,7 +454,7 @@ PhysicalWindow::PhysicalWindow(vector<LogicalType> types, vector<unique_ptr<Expr
|
|
454
454
|
is_order_dependent = false;
|
455
455
|
for (auto &expr : select_list) {
|
456
456
|
D_ASSERT(expr->expression_class == ExpressionClass::BOUND_WINDOW);
|
457
|
-
auto &bound_window = (
|
457
|
+
auto &bound_window = expr->Cast<BoundWindowExpression>();
|
458
458
|
if (bound_window.partitions.empty() && bound_window.orders.empty()) {
|
459
459
|
is_order_dependent = true;
|
460
460
|
}
|
@@ -1423,8 +1423,8 @@ void WindowExecutor::Evaluate(idx_t row_idx, DataChunk &input_chunk, Vector &res
|
|
1423
1423
|
//===--------------------------------------------------------------------===//
|
1424
1424
|
SinkResultType PhysicalWindow::Sink(ExecutionContext &context, GlobalSinkState &gstate_p, LocalSinkState &lstate_p,
|
1425
1425
|
DataChunk &input) const {
|
1426
|
-
auto &gstate = (
|
1427
|
-
auto &lstate = (
|
1426
|
+
auto &gstate = gstate_p.Cast<WindowGlobalSinkState>();
|
1427
|
+
auto &lstate = lstate_p.Cast<WindowLocalSinkState>();
|
1428
1428
|
|
1429
1429
|
lstate.Sink(input, gstate);
|
1430
1430
|
|
@@ -1432,8 +1432,8 @@ SinkResultType PhysicalWindow::Sink(ExecutionContext &context, GlobalSinkState &
|
|
1432
1432
|
}
|
1433
1433
|
|
1434
1434
|
void PhysicalWindow::Combine(ExecutionContext &context, GlobalSinkState &gstate_p, LocalSinkState &lstate_p) const {
|
1435
|
-
auto &gstate = (
|
1436
|
-
auto &lstate = (
|
1435
|
+
auto &gstate = gstate_p.Cast<WindowGlobalSinkState>();
|
1436
|
+
auto &lstate = lstate_p.Cast<WindowLocalSinkState>();
|
1437
1437
|
lstate.Combine(gstate);
|
1438
1438
|
}
|
1439
1439
|
|
@@ -1720,7 +1720,7 @@ public:
|
|
1720
1720
|
|
1721
1721
|
SinkFinalizeType PhysicalWindow::Finalize(Pipeline &pipeline, Event &event, ClientContext &context,
|
1722
1722
|
GlobalSinkState &gstate_p) const {
|
1723
|
-
auto &state = (
|
1723
|
+
auto &state = gstate_p.Cast<WindowGlobalSinkState>();
|
1724
1724
|
|
1725
1725
|
// Did we get any data?
|
1726
1726
|
if (!state.count) {
|
@@ -1761,7 +1761,7 @@ public:
|
|
1761
1761
|
|
1762
1762
|
public:
|
1763
1763
|
idx_t MaxThreads() override {
|
1764
|
-
auto &state =
|
1764
|
+
auto &state = op.sink_state->Cast<WindowGlobalSinkState>();
|
1765
1765
|
|
1766
1766
|
// If there is only one partition, we have to process it on one thread.
|
1767
1767
|
if (!state.grouping_data) {
|
@@ -1870,7 +1870,7 @@ void WindowLocalSourceState::MaterializeSortedData() {
|
|
1870
1870
|
}
|
1871
1871
|
|
1872
1872
|
void WindowLocalSourceState::GeneratePartition(WindowGlobalSinkState &gstate, const idx_t hash_bin_p) {
|
1873
|
-
auto &op =
|
1873
|
+
auto &op = gstate.op.Cast<PhysicalWindow>();
|
1874
1874
|
|
1875
1875
|
// Get rid of any stale data
|
1876
1876
|
hash_bin = hash_bin_p;
|
@@ -1990,7 +1990,7 @@ void WindowLocalSourceState::Scan(DataChunk &result) {
|
|
1990
1990
|
|
1991
1991
|
unique_ptr<LocalSourceState> PhysicalWindow::GetLocalSourceState(ExecutionContext &context,
|
1992
1992
|
GlobalSourceState &gstate_p) const {
|
1993
|
-
auto &gstate = (
|
1993
|
+
auto &gstate = gstate_p.Cast<WindowGlobalSourceState>();
|
1994
1994
|
return make_uniq<WindowLocalSourceState>(*this, context, gstate);
|
1995
1995
|
}
|
1996
1996
|
|
@@ -2000,9 +2000,9 @@ unique_ptr<GlobalSourceState> PhysicalWindow::GetGlobalSourceState(ClientContext
|
|
2000
2000
|
|
2001
2001
|
void PhysicalWindow::GetData(ExecutionContext &context, DataChunk &chunk, GlobalSourceState &gstate_p,
|
2002
2002
|
LocalSourceState &lstate_p) const {
|
2003
|
-
auto &state = (
|
2004
|
-
auto &global_source = (
|
2005
|
-
auto &gstate = (
|
2003
|
+
auto &state = lstate_p.Cast<WindowLocalSourceState>();
|
2004
|
+
auto &global_source = gstate_p.Cast<WindowGlobalSourceState>();
|
2005
|
+
auto &gstate = sink_state->Cast<WindowGlobalSinkState>();
|
2006
2006
|
|
2007
2007
|
const auto bin_count = gstate.hash_groups.empty() ? 1 : gstate.hash_groups.size();
|
2008
2008
|
|
@@ -31,15 +31,15 @@ public:
|
|
31
31
|
|
32
32
|
SinkResultType PhysicalBatchCollector::Sink(ExecutionContext &context, GlobalSinkState &gstate,
|
33
33
|
LocalSinkState &lstate_p, DataChunk &input) const {
|
34
|
-
auto &state = (
|
34
|
+
auto &state = lstate_p.Cast<BatchCollectorLocalState>();
|
35
35
|
state.data.Append(input, state.batch_index);
|
36
36
|
return SinkResultType::NEED_MORE_INPUT;
|
37
37
|
}
|
38
38
|
|
39
39
|
void PhysicalBatchCollector::Combine(ExecutionContext &context, GlobalSinkState &gstate_p,
|
40
40
|
LocalSinkState &lstate_p) const {
|
41
|
-
auto &gstate = (
|
42
|
-
auto &state = (
|
41
|
+
auto &gstate = gstate_p.Cast<BatchCollectorGlobalState>();
|
42
|
+
auto &state = lstate_p.Cast<BatchCollectorLocalState>();
|
43
43
|
|
44
44
|
lock_guard<mutex> lock(gstate.glock);
|
45
45
|
gstate.data.Merge(state.data);
|
@@ -47,7 +47,7 @@ void PhysicalBatchCollector::Combine(ExecutionContext &context, GlobalSinkState
|
|
47
47
|
|
48
48
|
SinkFinalizeType PhysicalBatchCollector::Finalize(Pipeline &pipeline, Event &event, ClientContext &context,
|
49
49
|
GlobalSinkState &gstate_p) const {
|
50
|
-
auto &gstate = (
|
50
|
+
auto &gstate = gstate_p.Cast<BatchCollectorGlobalState>();
|
51
51
|
auto collection = gstate.data.FetchCollection();
|
52
52
|
D_ASSERT(collection);
|
53
53
|
auto result = make_uniq<MaterializedQueryResult>(statement_type, properties, names, std::move(collection),
|
@@ -65,7 +65,7 @@ unique_ptr<GlobalSinkState> PhysicalBatchCollector::GetGlobalSinkState(ClientCon
|
|
65
65
|
}
|
66
66
|
|
67
67
|
unique_ptr<QueryResult> PhysicalBatchCollector::GetResult(GlobalSinkState &state) {
|
68
|
-
auto &gstate = (
|
68
|
+
auto &gstate = state.Cast<BatchCollectorGlobalState>();
|
69
69
|
D_ASSERT(gstate.result);
|
70
70
|
return std::move(gstate.result);
|
71
71
|
}
|
@@ -19,7 +19,7 @@ SinkResultType PhysicalExplainAnalyze::Sink(ExecutionContext &context, GlobalSin
|
|
19
19
|
|
20
20
|
SinkFinalizeType PhysicalExplainAnalyze::Finalize(Pipeline &pipeline, Event &event, ClientContext &context,
|
21
21
|
GlobalSinkState &gstate_p) const {
|
22
|
-
auto &gstate = (
|
22
|
+
auto &gstate = gstate_p.Cast<ExplainAnalyzeStateGlobalState>();
|
23
23
|
auto &profiler = QueryProfiler::Get(context);
|
24
24
|
gstate.analyzed_plan = profiler.ToString();
|
25
25
|
return SinkFinalizeType::READY;
|
@@ -47,7 +47,7 @@ unique_ptr<GlobalSourceState> PhysicalExplainAnalyze::GetGlobalSourceState(Clien
|
|
47
47
|
void PhysicalExplainAnalyze::GetData(ExecutionContext &context, DataChunk &chunk, GlobalSourceState &source_state,
|
48
48
|
LocalSourceState &lstate) const {
|
49
49
|
auto &state = (ExplainAnalyzeState &)source_state;
|
50
|
-
auto &gstate = (
|
50
|
+
auto &gstate = sink_state->Cast<ExplainAnalyzeStateGlobalState>();
|
51
51
|
if (state.finished) {
|
52
52
|
return;
|
53
53
|
}
|
@@ -96,7 +96,7 @@ SinkResultType PhysicalLimit::Sink(ExecutionContext &context, GlobalSinkState &g
|
|
96
96
|
DataChunk &input) const {
|
97
97
|
|
98
98
|
D_ASSERT(input.size() > 0);
|
99
|
-
auto &state = (
|
99
|
+
auto &state = lstate.Cast<LimitLocalState>();
|
100
100
|
auto &limit = state.limit;
|
101
101
|
auto &offset = state.offset;
|
102
102
|
|
@@ -118,8 +118,8 @@ SinkResultType PhysicalLimit::Sink(ExecutionContext &context, GlobalSinkState &g
|
|
118
118
|
}
|
119
119
|
|
120
120
|
void PhysicalLimit::Combine(ExecutionContext &context, GlobalSinkState &gstate_p, LocalSinkState &lstate_p) const {
|
121
|
-
auto &gstate = (
|
122
|
-
auto &state = (
|
121
|
+
auto &gstate = gstate_p.Cast<LimitGlobalState>();
|
122
|
+
auto &state = lstate_p.Cast<LimitLocalState>();
|
123
123
|
|
124
124
|
lock_guard<mutex> lock(gstate.glock);
|
125
125
|
gstate.limit = state.limit;
|
@@ -148,8 +148,8 @@ unique_ptr<GlobalSourceState> PhysicalLimit::GetGlobalSourceState(ClientContext
|
|
148
148
|
|
149
149
|
void PhysicalLimit::GetData(ExecutionContext &context, DataChunk &chunk, GlobalSourceState &gstate_p,
|
150
150
|
LocalSourceState &lstate) const {
|
151
|
-
auto &gstate = (
|
152
|
-
auto &state = (
|
151
|
+
auto &gstate = sink_state->Cast<LimitGlobalState>();
|
152
|
+
auto &state = gstate_p.Cast<LimitSourceState>();
|
153
153
|
while (state.current_offset < gstate.limit + gstate.offset) {
|
154
154
|
if (!state.initialized) {
|
155
155
|
gstate.data.InitializeScan(state.scan_state);
|
@@ -46,7 +46,7 @@ unique_ptr<GlobalSinkState> PhysicalLimitPercent::GetGlobalSinkState(ClientConte
|
|
46
46
|
SinkResultType PhysicalLimitPercent::Sink(ExecutionContext &context, GlobalSinkState &gstate, LocalSinkState &lstate,
|
47
47
|
DataChunk &input) const {
|
48
48
|
D_ASSERT(input.size() > 0);
|
49
|
-
auto &state = (
|
49
|
+
auto &state = gstate.Cast<LimitPercentGlobalState>();
|
50
50
|
auto &limit_percent = state.limit_percent;
|
51
51
|
auto &offset = state.offset;
|
52
52
|
|
@@ -88,7 +88,7 @@ public:
|
|
88
88
|
explicit LimitPercentOperatorState(const PhysicalLimitPercent &op)
|
89
89
|
: limit(DConstants::INVALID_INDEX), current_offset(0) {
|
90
90
|
D_ASSERT(op.sink_state);
|
91
|
-
auto &gstate =
|
91
|
+
auto &gstate = op.sink_state->Cast<LimitPercentGlobalState>();
|
92
92
|
gstate.data.InitializeScan(scan_state);
|
93
93
|
}
|
94
94
|
|
@@ -103,8 +103,8 @@ unique_ptr<GlobalSourceState> PhysicalLimitPercent::GetGlobalSourceState(ClientC
|
|
103
103
|
|
104
104
|
void PhysicalLimitPercent::GetData(ExecutionContext &context, DataChunk &chunk, GlobalSourceState &gstate_p,
|
105
105
|
LocalSourceState &lstate) const {
|
106
|
-
auto &gstate = (
|
107
|
-
auto &state = (
|
106
|
+
auto &gstate = sink_state->Cast<LimitPercentGlobalState>();
|
107
|
+
auto &state = gstate_p.Cast<LimitPercentOperatorState>();
|
108
108
|
auto &percent_limit = gstate.limit_percent;
|
109
109
|
auto &offset = gstate.offset;
|
110
110
|
auto &limit = state.limit;
|
@@ -27,15 +27,15 @@ public:
|
|
27
27
|
|
28
28
|
SinkResultType PhysicalMaterializedCollector::Sink(ExecutionContext &context, GlobalSinkState &gstate_p,
|
29
29
|
LocalSinkState &lstate_p, DataChunk &input) const {
|
30
|
-
auto &lstate = (
|
30
|
+
auto &lstate = lstate_p.Cast<MaterializedCollectorLocalState>();
|
31
31
|
lstate.collection->Append(lstate.append_state, input);
|
32
32
|
return SinkResultType::NEED_MORE_INPUT;
|
33
33
|
}
|
34
34
|
|
35
35
|
void PhysicalMaterializedCollector::Combine(ExecutionContext &context, GlobalSinkState &gstate_p,
|
36
36
|
LocalSinkState &lstate_p) const {
|
37
|
-
auto &gstate = (
|
38
|
-
auto &lstate = (
|
37
|
+
auto &gstate = gstate_p.Cast<MaterializedCollectorGlobalState>();
|
38
|
+
auto &lstate = lstate_p.Cast<MaterializedCollectorLocalState>();
|
39
39
|
if (lstate.collection->Count() == 0) {
|
40
40
|
return;
|
41
41
|
}
|
@@ -62,7 +62,7 @@ unique_ptr<LocalSinkState> PhysicalMaterializedCollector::GetLocalSinkState(Exec
|
|
62
62
|
}
|
63
63
|
|
64
64
|
unique_ptr<QueryResult> PhysicalMaterializedCollector::GetResult(GlobalSinkState &state) {
|
65
|
-
auto &gstate = (
|
65
|
+
auto &gstate = state.Cast<MaterializedCollectorGlobalState>();
|
66
66
|
if (!gstate.collection) {
|
67
67
|
gstate.collection = make_uniq<ColumnDataCollection>(Allocator::DefaultAllocator(), types);
|
68
68
|
}
|
@@ -36,7 +36,7 @@ unique_ptr<GlobalSinkState> PhysicalReservoirSample::GetGlobalSinkState(ClientCo
|
|
36
36
|
|
37
37
|
SinkResultType PhysicalReservoirSample::Sink(ExecutionContext &context, GlobalSinkState &state, LocalSinkState &lstate,
|
38
38
|
DataChunk &input) const {
|
39
|
-
auto &gstate = (
|
39
|
+
auto &gstate = state.Cast<SampleGlobalSinkState>();
|
40
40
|
if (!gstate.sample) {
|
41
41
|
return SinkResultType::FINISHED;
|
42
42
|
}
|
@@ -53,7 +53,7 @@ SinkResultType PhysicalReservoirSample::Sink(ExecutionContext &context, GlobalSi
|
|
53
53
|
//===--------------------------------------------------------------------===//
|
54
54
|
void PhysicalReservoirSample::GetData(ExecutionContext &context, DataChunk &chunk, GlobalSourceState &gstate,
|
55
55
|
LocalSourceState &lstate) const {
|
56
|
-
auto &sink =
|
56
|
+
auto &sink = this->sink_state->Cast<SampleGlobalSinkState>();
|
57
57
|
if (!sink.sample) {
|
58
58
|
return;
|
59
59
|
}
|
@@ -44,8 +44,8 @@ unique_ptr<GlobalOperatorState> PhysicalStreamingLimit::GetGlobalOperatorState(C
|
|
44
44
|
|
45
45
|
OperatorResultType PhysicalStreamingLimit::Execute(ExecutionContext &context, DataChunk &input, DataChunk &chunk,
|
46
46
|
GlobalOperatorState &gstate_p, OperatorState &state_p) const {
|
47
|
-
auto &gstate = (
|
48
|
-
auto &state = (
|
47
|
+
auto &gstate = gstate_p.Cast<StreamingLimitGlobalState>();
|
48
|
+
auto &state = state_p.Cast<StreamingLimitOperatorState>();
|
49
49
|
auto &limit = state.limit;
|
50
50
|
auto &offset = state.offset;
|
51
51
|
idx_t current_offset = gstate.current_offset.fetch_add(input.size());
|
@@ -23,7 +23,7 @@ public:
|
|
23
23
|
|
24
24
|
void PhysicalStreamingSample::SystemSample(DataChunk &input, DataChunk &result, OperatorState &state_p) const {
|
25
25
|
// system sampling: we throw one dice per chunk
|
26
|
-
auto &state = (
|
26
|
+
auto &state = state_p.Cast<StreamingSampleOperatorState>();
|
27
27
|
double rand = state.random.NextRandom();
|
28
28
|
if (rand <= percentage) {
|
29
29
|
// rand is smaller than sample_size: output chunk
|
@@ -34,7 +34,7 @@ void PhysicalStreamingSample::SystemSample(DataChunk &input, DataChunk &result,
|
|
34
34
|
void PhysicalStreamingSample::BernoulliSample(DataChunk &input, DataChunk &result, OperatorState &state_p) const {
|
35
35
|
// bernoulli sampling: we throw one dice per tuple
|
36
36
|
// then slice the result chunk
|
37
|
-
auto &state = (
|
37
|
+
auto &state = state_p.Cast<StreamingSampleOperatorState>();
|
38
38
|
idx_t result_count = 0;
|
39
39
|
SelectionVector sel(STANDARD_VECTOR_SIZE);
|
40
40
|
for (idx_t i = 0; i < input.size(); i++) {
|
@@ -45,7 +45,7 @@ unique_ptr<GlobalSinkState> PhysicalVacuum::GetGlobalSinkState(ClientContext &co
|
|
45
45
|
|
46
46
|
SinkResultType PhysicalVacuum::Sink(ExecutionContext &context, GlobalSinkState &gstate_p, LocalSinkState &lstate_p,
|
47
47
|
DataChunk &input) const {
|
48
|
-
auto &lstate = (
|
48
|
+
auto &lstate = lstate_p.Cast<VacuumLocalSinkState>();
|
49
49
|
D_ASSERT(lstate.column_distinct_stats.size() == info->column_id_map.size());
|
50
50
|
|
51
51
|
for (idx_t col_idx = 0; col_idx < input.data.size(); col_idx++) {
|
@@ -59,8 +59,8 @@ SinkResultType PhysicalVacuum::Sink(ExecutionContext &context, GlobalSinkState &
|
|
59
59
|
}
|
60
60
|
|
61
61
|
void PhysicalVacuum::Combine(ExecutionContext &context, GlobalSinkState &gstate_p, LocalSinkState &lstate_p) const {
|
62
|
-
auto &gstate = (
|
63
|
-
auto &lstate = (
|
62
|
+
auto &gstate = gstate_p.Cast<VacuumGlobalSinkState>();
|
63
|
+
auto &lstate = lstate_p.Cast<VacuumLocalSinkState>();
|
64
64
|
|
65
65
|
lock_guard<mutex> lock(gstate.stats_lock);
|
66
66
|
D_ASSERT(gstate.column_distinct_stats.size() == lstate.column_distinct_stats.size());
|
@@ -71,7 +71,7 @@ void PhysicalVacuum::Combine(ExecutionContext &context, GlobalSinkState &gstate_
|
|
71
71
|
|
72
72
|
SinkFinalizeType PhysicalVacuum::Finalize(Pipeline &pipeline, Event &event, ClientContext &context,
|
73
73
|
GlobalSinkState &gstate) const {
|
74
|
-
auto &sink = (
|
74
|
+
auto &sink = gstate.Cast<VacuumGlobalSinkState>();
|
75
75
|
|
76
76
|
auto table = info->table;
|
77
77
|
for (idx_t col_idx = 0; col_idx < sink.column_distinct_stats.size(); col_idx++) {
|
@@ -51,7 +51,7 @@ unique_ptr<LocalSinkState> PhysicalBlockwiseNLJoin::GetLocalSinkState(ExecutionC
|
|
51
51
|
|
52
52
|
SinkResultType PhysicalBlockwiseNLJoin::Sink(ExecutionContext &context, GlobalSinkState &state, LocalSinkState &lstate,
|
53
53
|
DataChunk &input) const {
|
54
|
-
auto &gstate = (
|
54
|
+
auto &gstate = state.Cast<BlockwiseNLJoinGlobalState>();
|
55
55
|
lock_guard<mutex> nl_lock(gstate.lock);
|
56
56
|
gstate.right_chunks.Append(input);
|
57
57
|
return SinkResultType::NEED_MORE_INPUT;
|
@@ -62,7 +62,7 @@ SinkResultType PhysicalBlockwiseNLJoin::Sink(ExecutionContext &context, GlobalSi
|
|
62
62
|
//===--------------------------------------------------------------------===//
|
63
63
|
SinkFinalizeType PhysicalBlockwiseNLJoin::Finalize(Pipeline &pipeline, Event &event, ClientContext &context,
|
64
64
|
GlobalSinkState &gstate_p) const {
|
65
|
-
auto &gstate = (
|
65
|
+
auto &gstate = gstate_p.Cast<BlockwiseNLJoinGlobalState>();
|
66
66
|
gstate.right_outer.Initialize(gstate.right_chunks.Count());
|
67
67
|
|
68
68
|
if (gstate.right_chunks.Count() == 0 && EmptyResultIfRHSIsEmpty()) {
|
@@ -91,7 +91,7 @@ public:
|
|
91
91
|
};
|
92
92
|
|
93
93
|
unique_ptr<OperatorState> PhysicalBlockwiseNLJoin::GetOperatorState(ExecutionContext &context) const {
|
94
|
-
auto &gstate = (
|
94
|
+
auto &gstate = sink_state->Cast<BlockwiseNLJoinGlobalState>();
|
95
95
|
auto result = make_uniq<BlockwiseNLJoinState>(context, gstate.right_chunks, *this);
|
96
96
|
if (join_type == JoinType::SEMI || join_type == JoinType::ANTI) {
|
97
97
|
vector<LogicalType> intermediate_types;
|
@@ -111,7 +111,7 @@ OperatorResultType PhysicalBlockwiseNLJoin::ExecuteInternal(ExecutionContext &co
|
|
111
111
|
OperatorState &state_p) const {
|
112
112
|
D_ASSERT(input.size() > 0);
|
113
113
|
auto &state = (BlockwiseNLJoinState &)state_p;
|
114
|
-
auto &gstate = (
|
114
|
+
auto &gstate = sink_state->Cast<BlockwiseNLJoinGlobalState>();
|
115
115
|
|
116
116
|
if (gstate.right_chunks.Count() == 0) {
|
117
117
|
// empty RHS
|
@@ -212,7 +212,7 @@ class BlockwiseNLJoinGlobalScanState : public GlobalSourceState {
|
|
212
212
|
public:
|
213
213
|
explicit BlockwiseNLJoinGlobalScanState(const PhysicalBlockwiseNLJoin &op) : op(op) {
|
214
214
|
D_ASSERT(op.sink_state);
|
215
|
-
auto &sink =
|
215
|
+
auto &sink = op.sink_state->Cast<BlockwiseNLJoinGlobalState>();
|
216
216
|
sink.right_outer.InitializeScan(sink.right_chunks, scan_state);
|
217
217
|
}
|
218
218
|
|
@@ -221,7 +221,7 @@ public:
|
|
221
221
|
|
222
222
|
public:
|
223
223
|
idx_t MaxThreads() override {
|
224
|
-
auto &sink =
|
224
|
+
auto &sink = op.sink_state->Cast<BlockwiseNLJoinGlobalState>();
|
225
225
|
return sink.right_outer.MaxThreads();
|
226
226
|
}
|
227
227
|
};
|
@@ -230,7 +230,7 @@ class BlockwiseNLJoinLocalScanState : public LocalSourceState {
|
|
230
230
|
public:
|
231
231
|
explicit BlockwiseNLJoinLocalScanState(const PhysicalBlockwiseNLJoin &op, BlockwiseNLJoinGlobalScanState &gstate) {
|
232
232
|
D_ASSERT(op.sink_state);
|
233
|
-
auto &sink =
|
233
|
+
auto &sink = op.sink_state->Cast<BlockwiseNLJoinGlobalState>();
|
234
234
|
sink.right_outer.InitializeScan(gstate.scan_state, scan_state);
|
235
235
|
}
|
236
236
|
|
@@ -250,7 +250,7 @@ void PhysicalBlockwiseNLJoin::GetData(ExecutionContext &context, DataChunk &chun
|
|
250
250
|
LocalSourceState &lstate_p) const {
|
251
251
|
D_ASSERT(IsRightOuterJoin(join_type));
|
252
252
|
// check if we need to scan any unmatched tuples from the RHS for the full/right outer join
|
253
|
-
auto &sink = (
|
253
|
+
auto &sink = sink_state->Cast<BlockwiseNLJoinGlobalState>();
|
254
254
|
auto &gstate = (BlockwiseNLJoinGlobalScanState &)gstate_p;
|
255
255
|
auto &lstate = (BlockwiseNLJoinLocalScanState &)lstate_p;
|
256
256
|
|
@@ -34,7 +34,7 @@ unique_ptr<GlobalSinkState> PhysicalCrossProduct::GetGlobalSinkState(ClientConte
|
|
34
34
|
|
35
35
|
SinkResultType PhysicalCrossProduct::Sink(ExecutionContext &context, GlobalSinkState &state, LocalSinkState &lstate_p,
|
36
36
|
DataChunk &input) const {
|
37
|
-
auto &sink = (
|
37
|
+
auto &sink = state.Cast<CrossProductGlobalState>();
|
38
38
|
lock_guard<mutex> client_guard(sink.rhs_lock);
|
39
39
|
sink.rhs_materialized.Append(sink.append_state, input);
|
40
40
|
return SinkResultType::NEED_MORE_INPUT;
|
@@ -123,13 +123,13 @@ public:
|
|
123
123
|
};
|
124
124
|
|
125
125
|
unique_ptr<OperatorState> PhysicalCrossProduct::GetOperatorState(ExecutionContext &context) const {
|
126
|
-
auto &sink = (
|
126
|
+
auto &sink = sink_state->Cast<CrossProductGlobalState>();
|
127
127
|
return make_uniq<CrossProductOperatorState>(sink.rhs_materialized);
|
128
128
|
}
|
129
129
|
|
130
130
|
OperatorResultType PhysicalCrossProduct::ExecuteInternal(ExecutionContext &context, DataChunk &input, DataChunk &chunk,
|
131
131
|
GlobalOperatorState &gstate, OperatorState &state_p) const {
|
132
|
-
auto &state = (
|
132
|
+
auto &state = state_p.Cast<CrossProductOperatorState>();
|
133
133
|
return state.executor.Execute(input, chunk);
|
134
134
|
}
|
135
135
|
|
@@ -92,15 +92,15 @@ unique_ptr<LocalSinkState> PhysicalDelimJoin::GetLocalSinkState(ExecutionContext
|
|
92
92
|
|
93
93
|
SinkResultType PhysicalDelimJoin::Sink(ExecutionContext &context, GlobalSinkState &state_p, LocalSinkState &lstate_p,
|
94
94
|
DataChunk &input) const {
|
95
|
-
auto &lstate = (
|
95
|
+
auto &lstate = lstate_p.Cast<DelimJoinLocalState>();
|
96
96
|
lstate.lhs_data.Append(lstate.append_state, input);
|
97
97
|
distinct->Sink(context, *distinct->sink_state, *lstate.distinct_state, input);
|
98
98
|
return SinkResultType::NEED_MORE_INPUT;
|
99
99
|
}
|
100
100
|
|
101
101
|
void PhysicalDelimJoin::Combine(ExecutionContext &context, GlobalSinkState &state, LocalSinkState &lstate_p) const {
|
102
|
-
auto &lstate = (
|
103
|
-
auto &gstate = (
|
102
|
+
auto &lstate = lstate_p.Cast<DelimJoinLocalState>();
|
103
|
+
auto &gstate = state.Cast<DelimJoinGlobalState>();
|
104
104
|
gstate.Merge(lstate.lhs_data);
|
105
105
|
distinct->Combine(context, *distinct->sink_state, *lstate.distinct_state);
|
106
106
|
}
|