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
@@ -3,12 +3,10 @@
|
|
3
3
|
#include "duckdb/execution/physical_operator.hpp"
|
4
4
|
#include "duckdb/common/string_util.hpp"
|
5
5
|
#include "duckdb/common/pair.hpp"
|
6
|
-
#include "duckdb/common/to_string.hpp"
|
7
6
|
#include "duckdb/execution/operator/join/physical_delim_join.hpp"
|
8
7
|
#include "duckdb/execution/operator/aggregate/physical_hash_aggregate.hpp"
|
9
8
|
#include "duckdb/execution/operator/scan/physical_positional_scan.hpp"
|
10
9
|
#include "duckdb/parallel/pipeline.hpp"
|
11
|
-
|
12
10
|
#include "utf8proc_wrapper.hpp"
|
13
11
|
|
14
12
|
#include <sstream>
|
@@ -394,10 +392,10 @@ void TreeChildrenIterator::Iterate(const PhysicalOperator &op,
|
|
394
392
|
callback(*child);
|
395
393
|
}
|
396
394
|
if (op.type == PhysicalOperatorType::DELIM_JOIN) {
|
397
|
-
auto &delim = (
|
395
|
+
auto &delim = op.Cast<PhysicalDelimJoin>();
|
398
396
|
callback(*delim.join);
|
399
397
|
} else if ((op.type == PhysicalOperatorType::POSITIONAL_SCAN)) {
|
400
|
-
auto &pscan = (
|
398
|
+
auto &pscan = op.Cast<PhysicalPositionalScan>();
|
401
399
|
for (auto &table : pscan.child_tables) {
|
402
400
|
callback(*table);
|
403
401
|
}
|
@@ -847,7 +847,9 @@ bool LogicalType::HasAlias() const {
|
|
847
847
|
|
848
848
|
void LogicalType::SetCatalog(LogicalType &type, TypeCatalogEntry *catalog_entry) {
|
849
849
|
auto info = type.AuxInfo();
|
850
|
-
|
850
|
+
if (!info) {
|
851
|
+
return;
|
852
|
+
}
|
851
853
|
((ExtraTypeInfo &)*info).catalog_entry = catalog_entry;
|
852
854
|
}
|
853
855
|
TypeCatalogEntry *LogicalType::GetCatalog(const LogicalType &type) {
|
@@ -23,7 +23,7 @@ void ColumnBindingResolver::VisitOperator(LogicalOperator &op) {
|
|
23
23
|
case LogicalOperatorType::LOGICAL_COMPARISON_JOIN:
|
24
24
|
case LogicalOperatorType::LOGICAL_DELIM_JOIN: {
|
25
25
|
// special case: comparison join
|
26
|
-
auto &comp_join = (
|
26
|
+
auto &comp_join = op.Cast<LogicalComparisonJoin>();
|
27
27
|
// first get the bindings of the LHS and resolve the LHS expressions
|
28
28
|
VisitOperator(*comp_join.children[0]);
|
29
29
|
for (auto &cond : comp_join.conditions) {
|
@@ -31,7 +31,7 @@ void ColumnBindingResolver::VisitOperator(LogicalOperator &op) {
|
|
31
31
|
}
|
32
32
|
if (op.type == LogicalOperatorType::LOGICAL_DELIM_JOIN) {
|
33
33
|
// visit the duplicate eliminated columns on the LHS, if any
|
34
|
-
auto &delim_join = (
|
34
|
+
auto &delim_join = op.Cast<LogicalDelimJoin>();
|
35
35
|
for (auto &expr : delim_join.duplicate_eliminated_columns) {
|
36
36
|
VisitExpression(&expr);
|
37
37
|
}
|
@@ -51,7 +51,7 @@ void ColumnBindingResolver::VisitOperator(LogicalOperator &op) {
|
|
51
51
|
// this operator
|
52
52
|
VisitOperatorChildren(op);
|
53
53
|
bindings = op.GetColumnBindings();
|
54
|
-
auto &any_join = (
|
54
|
+
auto &any_join = op.Cast<LogicalAnyJoin>();
|
55
55
|
if (any_join.join_type == JoinType::SEMI || any_join.join_type == JoinType::ANTI) {
|
56
56
|
auto right_bindings = op.children[1]->GetColumnBindings();
|
57
57
|
bindings.insert(bindings.end(), right_bindings.begin(), right_bindings.end());
|
@@ -62,7 +62,7 @@ void ColumnBindingResolver::VisitOperator(LogicalOperator &op) {
|
|
62
62
|
case LogicalOperatorType::LOGICAL_CREATE_INDEX: {
|
63
63
|
// CREATE INDEX statement, add the columns of the table with table index 0 to the binding set
|
64
64
|
// afterwards bind the expressions of the CREATE INDEX statement
|
65
|
-
auto &create_index = (
|
65
|
+
auto &create_index = op.Cast<LogicalCreateIndex>();
|
66
66
|
bindings = LogicalOperator::GenerateColumnBindings(0, create_index.table.GetColumns().LogicalColumnCount());
|
67
67
|
VisitOperatorExpressions(op);
|
68
68
|
return;
|
@@ -76,7 +76,7 @@ void ColumnBindingResolver::VisitOperator(LogicalOperator &op) {
|
|
76
76
|
case LogicalOperatorType::LOGICAL_INSERT: {
|
77
77
|
//! We want to execute the normal path, but also add a dummy 'excluded' binding if there is a
|
78
78
|
// ON CONFLICT DO UPDATE clause
|
79
|
-
auto &insert_op = (
|
79
|
+
auto &insert_op = op.Cast<LogicalInsert>();
|
80
80
|
if (insert_op.action_type != OnConflictAction::THROW) {
|
81
81
|
// Get the bindings from the children
|
82
82
|
VisitOperatorChildren(op);
|
@@ -3,6 +3,7 @@
|
|
3
3
|
#include "duckdb/common/vector_operations/vector_operations.hpp"
|
4
4
|
#include "duckdb/execution/execution_context.hpp"
|
5
5
|
#include "duckdb/storage/statistics/base_statistics.hpp"
|
6
|
+
#include "duckdb/planner/expression/list.hpp"
|
6
7
|
|
7
8
|
namespace duckdb {
|
8
9
|
|
@@ -225,11 +226,11 @@ idx_t ExpressionExecutor::Select(const Expression &expr, ExpressionState *state,
|
|
225
226
|
D_ASSERT(expr.return_type.id() == LogicalTypeId::BOOLEAN);
|
226
227
|
switch (expr.expression_class) {
|
227
228
|
case ExpressionClass::BOUND_BETWEEN:
|
228
|
-
return Select((
|
229
|
+
return Select(expr.Cast<BoundBetweenExpression>(), state, sel, count, true_sel, false_sel);
|
229
230
|
case ExpressionClass::BOUND_COMPARISON:
|
230
|
-
return Select((
|
231
|
+
return Select(expr.Cast<BoundComparisonExpression>(), state, sel, count, true_sel, false_sel);
|
231
232
|
case ExpressionClass::BOUND_CONJUNCTION:
|
232
|
-
return Select((
|
233
|
+
return Select(expr.Cast<BoundConjunctionExpression>(), state, sel, count, true_sel, false_sel);
|
233
234
|
default:
|
234
235
|
return DefaultSelect(expr, state, sel, count, true_sel, false_sel);
|
235
236
|
}
|
@@ -26,7 +26,7 @@ bool ExpressionState::HasContext() {
|
|
26
26
|
|
27
27
|
ClientContext &ExpressionState::GetContext() {
|
28
28
|
if (!HasContext()) {
|
29
|
-
throw BinderException("Cannot use %s in this context", ((
|
29
|
+
throw BinderException("Cannot use %s in this context", (expr.Cast<BoundFunctionExpression>()).function.name);
|
30
30
|
}
|
31
31
|
return root.executor->GetContext();
|
32
32
|
}
|
@@ -1002,19 +1002,17 @@ BlockPointer ART::Serialize(MetaBlockWriter &writer) {
|
|
1002
1002
|
//===--------------------------------------------------------------------===//
|
1003
1003
|
// Merging
|
1004
1004
|
//===--------------------------------------------------------------------===//
|
1005
|
-
|
1006
|
-
|
1007
|
-
|
1008
|
-
auto other_art = (ART *)other_index;
|
1005
|
+
bool ART::MergeIndexes(IndexLock &state, Index &other_index) {
|
1006
|
+
auto &other_art = other_index.Cast<ART>();
|
1009
1007
|
|
1010
1008
|
if (!this->tree) {
|
1011
|
-
IncreaseMemorySize(other_art
|
1012
|
-
tree = other_art
|
1013
|
-
other_art
|
1009
|
+
IncreaseMemorySize(other_art.memory_size);
|
1010
|
+
tree = other_art.tree;
|
1011
|
+
other_art.tree = nullptr;
|
1014
1012
|
return true;
|
1015
1013
|
}
|
1016
1014
|
|
1017
|
-
return Node::MergeARTs(this, other_art);
|
1015
|
+
return Node::MergeARTs(this, &other_art);
|
1018
1016
|
}
|
1019
1017
|
|
1020
1018
|
//===--------------------------------------------------------------------===//
|
@@ -16,7 +16,7 @@ DistinctAggregateCollectionInfo::DistinctAggregateCollectionInfo(const vector<un
|
|
16
16
|
|
17
17
|
total_child_count = 0;
|
18
18
|
for (idx_t i = 0; i < aggregate_count; i++) {
|
19
|
-
auto &aggregate =
|
19
|
+
auto &aggregate = aggregates[i]->Cast<BoundAggregateExpression>();
|
20
20
|
|
21
21
|
if (!aggregate.IsDistinct()) {
|
22
22
|
continue;
|
@@ -35,7 +35,7 @@ DistinctAggregateState::DistinctAggregateState(const DistinctAggregateData &data
|
|
35
35
|
|
36
36
|
idx_t aggregate_count = data.info.aggregates.size();
|
37
37
|
for (idx_t i = 0; i < aggregate_count; i++) {
|
38
|
-
auto &aggregate =
|
38
|
+
auto &aggregate = data.info.aggregates[i]->Cast<BoundAggregateExpression>();
|
39
39
|
|
40
40
|
// Initialize the child executor and get the payload types for every aggregate
|
41
41
|
for (auto &child : aggregate.children) {
|
@@ -80,7 +80,7 @@ DistinctAggregateData::DistinctAggregateData(const DistinctAggregateCollectionIn
|
|
80
80
|
grouping_sets.resize(info.table_count);
|
81
81
|
|
82
82
|
for (auto &i : info.indices) {
|
83
|
-
auto &aggregate =
|
83
|
+
auto &aggregate = info.aggregates[i]->Cast<BoundAggregateExpression>();
|
84
84
|
|
85
85
|
D_ASSERT(info.table_map.count(i));
|
86
86
|
idx_t table_idx = info.table_map.at(i);
|
@@ -128,8 +128,8 @@ struct FindMatchingAggregate {
|
|
128
128
|
return false;
|
129
129
|
}
|
130
130
|
for (idx_t i = 0; i < aggr.children.size(); i++) {
|
131
|
-
auto &other_child =
|
132
|
-
auto &aggr_child =
|
131
|
+
auto &other_child = other.children[i]->Cast<BoundReferenceExpression>();
|
132
|
+
auto &aggr_child = aggr.children[i]->Cast<BoundReferenceExpression>();
|
133
133
|
if (other_child.index != aggr_child.index) {
|
134
134
|
return false;
|
135
135
|
}
|
@@ -145,7 +145,7 @@ idx_t DistinctAggregateCollectionInfo::CreateTableIndexMap() {
|
|
145
145
|
D_ASSERT(table_map.empty());
|
146
146
|
for (auto &agg_idx : indices) {
|
147
147
|
D_ASSERT(agg_idx < aggregates.size());
|
148
|
-
auto &aggregate =
|
148
|
+
auto &aggregate = aggregates[agg_idx]->Cast<BoundAggregateExpression>();
|
149
149
|
|
150
150
|
auto matching_inputs =
|
151
151
|
std::find_if(table_inputs.begin(), table_inputs.end(), FindMatchingAggregate(std::ref(aggregate)));
|
@@ -179,7 +179,7 @@ static vector<idx_t> GetDistinctIndices(vector<unique_ptr<Expression>> &aggregat
|
|
179
179
|
vector<idx_t> distinct_indices;
|
180
180
|
for (idx_t i = 0; i < aggregates.size(); i++) {
|
181
181
|
auto &aggregate = aggregates[i];
|
182
|
-
auto &aggr = (
|
182
|
+
auto &aggr = aggregate->Cast<BoundAggregateExpression>();
|
183
183
|
if (aggr.IsDistinct()) {
|
184
184
|
distinct_indices.push_back(i);
|
185
185
|
}
|
@@ -22,7 +22,7 @@ void GroupedAggregateData::InitializeGroupby(vector<unique_ptr<Expression>> grou
|
|
22
22
|
for (auto &expr : expressions) {
|
23
23
|
D_ASSERT(expr->expression_class == ExpressionClass::BOUND_AGGREGATE);
|
24
24
|
D_ASSERT(expr->IsAggregate());
|
25
|
-
auto &aggr = (
|
25
|
+
auto &aggr = expr->Cast<BoundAggregateExpression>();
|
26
26
|
bindings.push_back(&aggr);
|
27
27
|
|
28
28
|
aggregate_return_types.push_back(aggr.return_type);
|
@@ -45,7 +45,7 @@ void GroupedAggregateData::InitializeGroupby(vector<unique_ptr<Expression>> grou
|
|
45
45
|
|
46
46
|
void GroupedAggregateData::InitializeDistinct(const unique_ptr<Expression> &aggregate,
|
47
47
|
const vector<unique_ptr<Expression>> *groups_p) {
|
48
|
-
auto &aggr = (
|
48
|
+
auto &aggr = aggregate->Cast<BoundAggregateExpression>();
|
49
49
|
D_ASSERT(aggr.IsDistinct());
|
50
50
|
|
51
51
|
// Add the (empty in ungrouped case) groups of the aggregates
|
@@ -73,13 +73,13 @@ static vector<LogicalType> CreateGroupChunkTypes(vector<unique_ptr<Expression>>
|
|
73
73
|
|
74
74
|
for (auto &group : groups) {
|
75
75
|
D_ASSERT(group->type == ExpressionType::BOUND_REF);
|
76
|
-
auto &bound_ref = (
|
76
|
+
auto &bound_ref = group->Cast<BoundReferenceExpression>();
|
77
77
|
group_indices.insert(bound_ref.index);
|
78
78
|
}
|
79
79
|
idx_t highest_index = *group_indices.rbegin();
|
80
80
|
vector<LogicalType> types(highest_index + 1, LogicalType::SQLNULL);
|
81
81
|
for (auto &group : groups) {
|
82
|
-
auto &bound_ref = (
|
82
|
+
auto &bound_ref = group->Cast<BoundReferenceExpression>();
|
83
83
|
types[bound_ref.index] = bound_ref.return_type;
|
84
84
|
}
|
85
85
|
return types;
|
@@ -139,7 +139,7 @@ PhysicalHashAggregate::PhysicalHashAggregate(ClientContext &context, vector<Logi
|
|
139
139
|
idx_t aggregate_input_idx = 0;
|
140
140
|
for (idx_t i = 0; i < aggregates.size(); i++) {
|
141
141
|
auto &aggregate = aggregates[i];
|
142
|
-
auto &aggr = (
|
142
|
+
auto &aggr = aggregate->Cast<BoundAggregateExpression>();
|
143
143
|
aggregate_input_idx += aggr.children.size();
|
144
144
|
if (aggr.aggr_type == AggregateType::DISTINCT) {
|
145
145
|
distinct_filter.push_back(i);
|
@@ -152,9 +152,9 @@ PhysicalHashAggregate::PhysicalHashAggregate(ClientContext &context, vector<Logi
|
|
152
152
|
|
153
153
|
for (idx_t i = 0; i < aggregates.size(); i++) {
|
154
154
|
auto &aggregate = aggregates[i];
|
155
|
-
auto &aggr = (
|
155
|
+
auto &aggr = aggregate->Cast<BoundAggregateExpression>();
|
156
156
|
if (aggr.filter) {
|
157
|
-
auto &bound_ref_expr =
|
157
|
+
auto &bound_ref_expr = aggr.filter->Cast<BoundReferenceExpression>();
|
158
158
|
if (!filter_indexes.count(aggr.filter.get())) {
|
159
159
|
// Replace the bound reference expression's index with the corresponding index of the payload chunk
|
160
160
|
filter_indexes[aggr.filter.get()] = bound_ref_expr.index;
|
@@ -184,7 +184,7 @@ public:
|
|
184
184
|
}
|
185
185
|
vector<LogicalType> filter_types;
|
186
186
|
for (auto &aggr : op.grouped_aggregate_data.aggregates) {
|
187
|
-
auto &aggregate = (
|
187
|
+
auto &aggregate = aggr->Cast<BoundAggregateExpression>();
|
188
188
|
for (auto &child : aggregate.children) {
|
189
189
|
payload_types.push_back(child->return_type);
|
190
190
|
}
|
@@ -219,7 +219,7 @@ public:
|
|
219
219
|
// the filtering of data for the regular aggregates is done within the hashtable
|
220
220
|
vector<AggregateObject> aggregate_objects;
|
221
221
|
for (auto &aggregate : op.grouped_aggregate_data.aggregates) {
|
222
|
-
auto &aggr = (
|
222
|
+
auto &aggr = aggregate->Cast<BoundAggregateExpression>();
|
223
223
|
aggregate_objects.emplace_back(&aggr);
|
224
224
|
}
|
225
225
|
|
@@ -232,7 +232,7 @@ public:
|
|
232
232
|
};
|
233
233
|
|
234
234
|
void PhysicalHashAggregate::SetMultiScan(GlobalSinkState &state) {
|
235
|
-
auto &gstate = (
|
235
|
+
auto &gstate = state.Cast<HashAggregateGlobalState>();
|
236
236
|
for (auto &grouping_state : gstate.grouping_states) {
|
237
237
|
auto &radix_state = grouping_state.table_state;
|
238
238
|
RadixPartitionedHashTable::SetMultiScan(*radix_state);
|
@@ -252,8 +252,8 @@ unique_ptr<LocalSinkState> PhysicalHashAggregate::GetLocalSinkState(ExecutionCon
|
|
252
252
|
|
253
253
|
void PhysicalHashAggregate::SinkDistinctGrouping(ExecutionContext &context, GlobalSinkState &state,
|
254
254
|
LocalSinkState &lstate, DataChunk &input, idx_t grouping_idx) const {
|
255
|
-
auto &sink = (
|
256
|
-
auto &global_sink = (
|
255
|
+
auto &sink = lstate.Cast<HashAggregateLocalState>();
|
256
|
+
auto &global_sink = state.Cast<HashAggregateGlobalState>();
|
257
257
|
|
258
258
|
auto &grouping_gstate = global_sink.grouping_states[grouping_idx];
|
259
259
|
auto &grouping_lstate = sink.grouping_states[grouping_idx];
|
@@ -268,7 +268,7 @@ void PhysicalHashAggregate::SinkDistinctGrouping(ExecutionContext &context, Glob
|
|
268
268
|
vector<idx_t> empty_filter;
|
269
269
|
|
270
270
|
for (idx_t &idx : distinct_info.indices) {
|
271
|
-
auto &aggregate =
|
271
|
+
auto &aggregate = grouped_aggregate_data.aggregates[idx]->Cast<BoundAggregateExpression>();
|
272
272
|
|
273
273
|
D_ASSERT(distinct_info.table_map.count(idx));
|
274
274
|
idx_t table_idx = distinct_info.table_map[idx];
|
@@ -289,7 +289,7 @@ void PhysicalHashAggregate::SinkDistinctGrouping(ExecutionContext &context, Glob
|
|
289
289
|
auto it = filter_indexes.find(aggregate.filter.get());
|
290
290
|
D_ASSERT(it != filter_indexes.end());
|
291
291
|
D_ASSERT(it->second < input.data.size());
|
292
|
-
auto &filter_bound_ref =
|
292
|
+
auto &filter_bound_ref = aggregate.filter->Cast<BoundReferenceExpression>();
|
293
293
|
filter_chunk.data[filter_bound_ref.index].Reference(input.data[it->second]);
|
294
294
|
filter_chunk.SetCardinality(input.size());
|
295
295
|
|
@@ -309,12 +309,12 @@ void PhysicalHashAggregate::SinkDistinctGrouping(ExecutionContext &context, Glob
|
|
309
309
|
|
310
310
|
for (idx_t group_idx = 0; group_idx < grouped_aggregate_data.groups.size(); group_idx++) {
|
311
311
|
auto &group = grouped_aggregate_data.groups[group_idx];
|
312
|
-
auto &bound_ref = (
|
312
|
+
auto &bound_ref = group->Cast<BoundReferenceExpression>();
|
313
313
|
filtered_input.data[bound_ref.index].Reference(input.data[bound_ref.index]);
|
314
314
|
}
|
315
315
|
for (idx_t child_idx = 0; child_idx < aggregate.children.size(); child_idx++) {
|
316
316
|
auto &child = aggregate.children[child_idx];
|
317
|
-
auto &bound_ref = (
|
317
|
+
auto &bound_ref = child->Cast<BoundReferenceExpression>();
|
318
318
|
|
319
319
|
filtered_input.data[bound_ref.index].Reference(input.data[bound_ref.index]);
|
320
320
|
}
|
@@ -337,8 +337,8 @@ void PhysicalHashAggregate::SinkDistinct(ExecutionContext &context, GlobalSinkSt
|
|
337
337
|
|
338
338
|
SinkResultType PhysicalHashAggregate::Sink(ExecutionContext &context, GlobalSinkState &state, LocalSinkState &lstate,
|
339
339
|
DataChunk &input) const {
|
340
|
-
auto &llstate = (
|
341
|
-
auto &gstate = (
|
340
|
+
auto &llstate = lstate.Cast<HashAggregateLocalState>();
|
341
|
+
auto &gstate = state.Cast<HashAggregateGlobalState>();
|
342
342
|
|
343
343
|
if (distinct_collection_info) {
|
344
344
|
SinkDistinct(context, state, lstate, input);
|
@@ -355,17 +355,17 @@ SinkResultType PhysicalHashAggregate::Sink(ExecutionContext &context, GlobalSink
|
|
355
355
|
|
356
356
|
// Populate the aggregate child vectors
|
357
357
|
for (auto &aggregate : aggregates) {
|
358
|
-
auto &aggr = (
|
358
|
+
auto &aggr = aggregate->Cast<BoundAggregateExpression>();
|
359
359
|
for (auto &child_expr : aggr.children) {
|
360
360
|
D_ASSERT(child_expr->type == ExpressionType::BOUND_REF);
|
361
|
-
auto &bound_ref_expr = (
|
361
|
+
auto &bound_ref_expr = child_expr->Cast<BoundReferenceExpression>();
|
362
362
|
D_ASSERT(bound_ref_expr.index < input.data.size());
|
363
363
|
aggregate_input_chunk.data[aggregate_input_idx++].Reference(input.data[bound_ref_expr.index]);
|
364
364
|
}
|
365
365
|
}
|
366
366
|
// Populate the filter vectors
|
367
367
|
for (auto &aggregate : aggregates) {
|
368
|
-
auto &aggr = (
|
368
|
+
auto &aggr = aggregate->Cast<BoundAggregateExpression>();
|
369
369
|
if (aggr.filter) {
|
370
370
|
auto it = filter_indexes.find(aggr.filter.get());
|
371
371
|
D_ASSERT(it != filter_indexes.end());
|
@@ -393,8 +393,8 @@ SinkResultType PhysicalHashAggregate::Sink(ExecutionContext &context, GlobalSink
|
|
393
393
|
|
394
394
|
void PhysicalHashAggregate::CombineDistinct(ExecutionContext &context, GlobalSinkState &state,
|
395
395
|
LocalSinkState &lstate) const {
|
396
|
-
auto &global_sink = (
|
397
|
-
auto &sink = (
|
396
|
+
auto &global_sink = state.Cast<HashAggregateGlobalState>();
|
397
|
+
auto &sink = lstate.Cast<HashAggregateLocalState>();
|
398
398
|
|
399
399
|
if (!distinct_collection_info) {
|
400
400
|
return;
|
@@ -421,8 +421,8 @@ void PhysicalHashAggregate::CombineDistinct(ExecutionContext &context, GlobalSin
|
|
421
421
|
}
|
422
422
|
|
423
423
|
void PhysicalHashAggregate::Combine(ExecutionContext &context, GlobalSinkState &state, LocalSinkState &lstate) const {
|
424
|
-
auto &gstate = (
|
425
|
-
auto &llstate = (
|
424
|
+
auto &gstate = state.Cast<HashAggregateGlobalState>();
|
425
|
+
auto &llstate = lstate.Cast<HashAggregateLocalState>();
|
426
426
|
|
427
427
|
CombineDistinct(context, state, lstate);
|
428
428
|
|
@@ -553,7 +553,7 @@ public:
|
|
553
553
|
idx_t next_payload_idx = 0;
|
554
554
|
|
555
555
|
for (idx_t i = 0; i < op.grouped_aggregate_data.aggregates.size(); i++) {
|
556
|
-
auto &aggregate =
|
556
|
+
auto &aggregate = aggregates[i]->Cast<BoundAggregateExpression>();
|
557
557
|
|
558
558
|
// Forward the payload idx
|
559
559
|
payload_idx = next_payload_idx;
|
@@ -590,7 +590,7 @@ public:
|
|
590
590
|
|
591
591
|
for (idx_t group_idx = 0; group_idx < group_by_size; group_idx++) {
|
592
592
|
auto &group = grouped_aggregate_data.groups[group_idx];
|
593
|
-
auto &bound_ref_expr = (
|
593
|
+
auto &bound_ref_expr = group->Cast<BoundReferenceExpression>();
|
594
594
|
group_chunk.data[bound_ref_expr.index].Reference(output_chunk.data[group_idx]);
|
595
595
|
}
|
596
596
|
group_chunk.SetCardinality(output_chunk);
|
@@ -681,7 +681,7 @@ private:
|
|
681
681
|
|
682
682
|
for (idx_t i = 0; i < op.grouped_aggregate_data.aggregates.size(); i++) {
|
683
683
|
auto &aggregate = op.grouped_aggregate_data.aggregates[i];
|
684
|
-
auto &aggr = (
|
684
|
+
auto &aggr = aggregate->Cast<BoundAggregateExpression>();
|
685
685
|
|
686
686
|
if (!aggr.IsDistinct()) {
|
687
687
|
aggregate_sources.push_back(nullptr);
|
@@ -743,7 +743,7 @@ public:
|
|
743
743
|
|
744
744
|
SinkFinalizeType PhysicalHashAggregate::FinalizeDistinct(Pipeline &pipeline, Event &event, ClientContext &context,
|
745
745
|
GlobalSinkState &gstate_p) const {
|
746
|
-
auto &gstate = (
|
746
|
+
auto &gstate = gstate_p.Cast<HashAggregateGlobalState>();
|
747
747
|
D_ASSERT(distinct_collection_info);
|
748
748
|
|
749
749
|
bool any_partitioned = false;
|
@@ -779,7 +779,7 @@ SinkFinalizeType PhysicalHashAggregate::FinalizeDistinct(Pipeline &pipeline, Eve
|
|
779
779
|
|
780
780
|
SinkFinalizeType PhysicalHashAggregate::FinalizeInternal(Pipeline &pipeline, Event &event, ClientContext &context,
|
781
781
|
GlobalSinkState &gstate_p, bool check_distinct) const {
|
782
|
-
auto &gstate = (
|
782
|
+
auto &gstate = gstate_p.Cast<HashAggregateGlobalState>();
|
783
783
|
|
784
784
|
if (check_distinct && distinct_collection_info) {
|
785
785
|
// There are distinct aggregates
|
@@ -836,7 +836,7 @@ public:
|
|
836
836
|
return 1;
|
837
837
|
}
|
838
838
|
|
839
|
-
auto &ht_state =
|
839
|
+
auto &ht_state = op.sink_state->Cast<HashAggregateGlobalState>();
|
840
840
|
idx_t count = 0;
|
841
841
|
for (size_t sidx = 0; sidx < op.groupings.size(); ++sidx) {
|
842
842
|
auto &grouping = op.groupings[sidx];
|
@@ -870,9 +870,9 @@ unique_ptr<LocalSourceState> PhysicalHashAggregate::GetLocalSourceState(Executio
|
|
870
870
|
|
871
871
|
void PhysicalHashAggregate::GetData(ExecutionContext &context, DataChunk &chunk, GlobalSourceState &gstate_p,
|
872
872
|
LocalSourceState &lstate_p) const {
|
873
|
-
auto &sink_gstate = (
|
874
|
-
auto &gstate = (
|
875
|
-
auto &lstate = (
|
873
|
+
auto &sink_gstate = sink_state->Cast<HashAggregateGlobalState>();
|
874
|
+
auto &gstate = gstate_p.Cast<PhysicalHashAggregateGlobalSourceState>();
|
875
|
+
auto &lstate = lstate_p.Cast<PhysicalHashAggregateLocalSourceState>();
|
876
876
|
while (true) {
|
877
877
|
idx_t radix_idx = gstate.state_index;
|
878
878
|
if (radix_idx >= groupings.size()) {
|
@@ -908,7 +908,7 @@ string PhysicalHashAggregate::ParamsToString() const {
|
|
908
908
|
result += groups[i]->GetName();
|
909
909
|
}
|
910
910
|
for (idx_t i = 0; i < aggregates.size(); i++) {
|
911
|
-
auto &aggregate =
|
911
|
+
auto &aggregate = aggregates[i]->Cast<BoundAggregateExpression>();
|
912
912
|
if (i > 0 || !groups.empty()) {
|
913
913
|
result += "\n";
|
914
914
|
}
|
@@ -31,7 +31,7 @@ PhysicalPerfectHashAggregate::PhysicalPerfectHashAggregate(ClientContext &contex
|
|
31
31
|
for (auto &expr : aggregates) {
|
32
32
|
D_ASSERT(expr->expression_class == ExpressionClass::BOUND_AGGREGATE);
|
33
33
|
D_ASSERT(expr->IsAggregate());
|
34
|
-
auto &aggr = (
|
34
|
+
auto &aggr = expr->Cast<BoundAggregateExpression>();
|
35
35
|
bindings.push_back(&aggr);
|
36
36
|
|
37
37
|
D_ASSERT(!aggr.IsDistinct());
|
@@ -51,13 +51,13 @@ PhysicalPerfectHashAggregate::PhysicalPerfectHashAggregate(ClientContext &contex
|
|
51
51
|
// filter_indexes must be pre-built, not lazily instantiated in parallel...
|
52
52
|
idx_t aggregate_input_idx = 0;
|
53
53
|
for (auto &aggregate : aggregates) {
|
54
|
-
auto &aggr = (
|
54
|
+
auto &aggr = aggregate->Cast<BoundAggregateExpression>();
|
55
55
|
aggregate_input_idx += aggr.children.size();
|
56
56
|
}
|
57
57
|
for (auto &aggregate : aggregates) {
|
58
|
-
auto &aggr = (
|
58
|
+
auto &aggr = aggregate->Cast<BoundAggregateExpression>();
|
59
59
|
if (aggr.filter) {
|
60
|
-
auto &bound_ref_expr =
|
60
|
+
auto &bound_ref_expr = aggr.filter->Cast<BoundReferenceExpression>();
|
61
61
|
auto it = filter_indexes.find(aggr.filter.get());
|
62
62
|
if (it == filter_indexes.end()) {
|
63
63
|
filter_indexes[aggr.filter.get()] = bound_ref_expr.index;
|
@@ -116,27 +116,27 @@ unique_ptr<LocalSinkState> PhysicalPerfectHashAggregate::GetLocalSinkState(Execu
|
|
116
116
|
|
117
117
|
SinkResultType PhysicalPerfectHashAggregate::Sink(ExecutionContext &context, GlobalSinkState &state,
|
118
118
|
LocalSinkState &lstate_p, DataChunk &input) const {
|
119
|
-
auto &lstate = (
|
119
|
+
auto &lstate = lstate_p.Cast<PerfectHashAggregateLocalState>();
|
120
120
|
DataChunk &group_chunk = lstate.group_chunk;
|
121
121
|
DataChunk &aggregate_input_chunk = lstate.aggregate_input_chunk;
|
122
122
|
|
123
123
|
for (idx_t group_idx = 0; group_idx < groups.size(); group_idx++) {
|
124
124
|
auto &group = groups[group_idx];
|
125
125
|
D_ASSERT(group->type == ExpressionType::BOUND_REF);
|
126
|
-
auto &bound_ref_expr = (
|
126
|
+
auto &bound_ref_expr = group->Cast<BoundReferenceExpression>();
|
127
127
|
group_chunk.data[group_idx].Reference(input.data[bound_ref_expr.index]);
|
128
128
|
}
|
129
129
|
idx_t aggregate_input_idx = 0;
|
130
130
|
for (auto &aggregate : aggregates) {
|
131
|
-
auto &aggr = (
|
131
|
+
auto &aggr = aggregate->Cast<BoundAggregateExpression>();
|
132
132
|
for (auto &child_expr : aggr.children) {
|
133
133
|
D_ASSERT(child_expr->type == ExpressionType::BOUND_REF);
|
134
|
-
auto &bound_ref_expr = (
|
134
|
+
auto &bound_ref_expr = child_expr->Cast<BoundReferenceExpression>();
|
135
135
|
aggregate_input_chunk.data[aggregate_input_idx++].Reference(input.data[bound_ref_expr.index]);
|
136
136
|
}
|
137
137
|
}
|
138
138
|
for (auto &aggregate : aggregates) {
|
139
|
-
auto &aggr = (
|
139
|
+
auto &aggr = aggregate->Cast<BoundAggregateExpression>();
|
140
140
|
if (aggr.filter) {
|
141
141
|
auto it = filter_indexes.find(aggr.filter.get());
|
142
142
|
D_ASSERT(it != filter_indexes.end());
|
@@ -161,8 +161,8 @@ SinkResultType PhysicalPerfectHashAggregate::Sink(ExecutionContext &context, Glo
|
|
161
161
|
//===--------------------------------------------------------------------===//
|
162
162
|
void PhysicalPerfectHashAggregate::Combine(ExecutionContext &context, GlobalSinkState &gstate_p,
|
163
163
|
LocalSinkState &lstate_p) const {
|
164
|
-
auto &lstate = (
|
165
|
-
auto &gstate = (
|
164
|
+
auto &lstate = lstate_p.Cast<PerfectHashAggregateLocalState>();
|
165
|
+
auto &gstate = gstate_p.Cast<PerfectHashAggregateGlobalState>();
|
166
166
|
|
167
167
|
lock_guard<mutex> l(gstate.lock);
|
168
168
|
gstate.ht->Combine(*lstate.ht);
|
@@ -187,7 +187,7 @@ unique_ptr<GlobalSourceState> PhysicalPerfectHashAggregate::GetGlobalSourceState
|
|
187
187
|
void PhysicalPerfectHashAggregate::GetData(ExecutionContext &context, DataChunk &chunk, GlobalSourceState &gstate_p,
|
188
188
|
LocalSourceState &lstate) const {
|
189
189
|
auto &state = (PerfectHashAggregateState &)gstate_p;
|
190
|
-
auto &gstate = (
|
190
|
+
auto &gstate = sink_state->Cast<PerfectHashAggregateGlobalState>();
|
191
191
|
|
192
192
|
gstate.ht->Scan(state.ht_scan_position, chunk);
|
193
193
|
}
|
@@ -205,7 +205,7 @@ string PhysicalPerfectHashAggregate::ParamsToString() const {
|
|
205
205
|
result += "\n";
|
206
206
|
}
|
207
207
|
result += aggregates[i]->GetName();
|
208
|
-
auto &aggregate =
|
208
|
+
auto &aggregate = aggregates[i]->Cast<BoundAggregateExpression>();
|
209
209
|
if (aggregate.filter) {
|
210
210
|
result += " Filter: " + aggregate.filter->GetName();
|
211
211
|
}
|
@@ -46,7 +46,7 @@ public:
|
|
46
46
|
|
47
47
|
for (idx_t expr_idx = 0; expr_idx < expressions.size(); expr_idx++) {
|
48
48
|
auto &expr = *expressions[expr_idx];
|
49
|
-
auto &wexpr = (
|
49
|
+
auto &wexpr = expr.Cast<BoundWindowExpression>();
|
50
50
|
switch (expr.GetExpressionType()) {
|
51
51
|
case ExpressionType::WINDOW_AGGREGATE: {
|
52
52
|
auto &aggregate = *wexpr.aggregate;
|
@@ -104,7 +104,7 @@ unique_ptr<OperatorState> PhysicalStreamingWindow::GetOperatorState(ExecutionCon
|
|
104
104
|
|
105
105
|
OperatorResultType PhysicalStreamingWindow::Execute(ExecutionContext &context, DataChunk &input, DataChunk &chunk,
|
106
106
|
GlobalOperatorState &gstate_p, OperatorState &state_p) const {
|
107
|
-
auto &gstate = (
|
107
|
+
auto &gstate = gstate_p.Cast<StreamingWindowGlobalState>();
|
108
108
|
auto &state = (StreamingWindowState &)state_p;
|
109
109
|
if (!state.initialized) {
|
110
110
|
state.Initialize(context.client, input, select_list);
|
@@ -122,7 +122,7 @@ OperatorResultType PhysicalStreamingWindow::Execute(ExecutionContext &context, D
|
|
122
122
|
switch (expr.GetExpressionType()) {
|
123
123
|
case ExpressionType::WINDOW_AGGREGATE: {
|
124
124
|
// Establish the aggregation environment
|
125
|
-
auto &wexpr = (
|
125
|
+
auto &wexpr = expr.Cast<BoundWindowExpression>();
|
126
126
|
auto &aggregate = *wexpr.aggregate;
|
127
127
|
auto &statev = state.statev;
|
128
128
|
state.state_ptr = state.aggregate_states[expr_idx].data();
|