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
@@ -25,7 +25,7 @@ unique_ptr<PhysicalOperator> PhysicalPlanGenerator::CreatePlan(LogicalDistinct &
|
|
25
25
|
for (idx_t i = 0; i < distinct_targets.size(); i++) {
|
26
26
|
auto &target = distinct_targets[i];
|
27
27
|
if (target->type == ExpressionType::BOUND_REF) {
|
28
|
-
auto &bound_ref = (
|
28
|
+
auto &bound_ref = target->Cast<BoundReferenceExpression>();
|
29
29
|
group_by_references[bound_ref.index] = i;
|
30
30
|
}
|
31
31
|
aggregate_types.push_back(target->return_type);
|
@@ -49,6 +49,9 @@ unique_ptr<PhysicalOperator> PhysicalPlanGenerator::CreatePlan(LogicalDistinct &
|
|
49
49
|
requires_projection = true;
|
50
50
|
}
|
51
51
|
} else {
|
52
|
+
if (op.distinct_type == DistinctType::DISTINCT && op.order_by) {
|
53
|
+
throw InternalException("Entry that is not a group, but not a DISTINCT ON aggregate");
|
54
|
+
}
|
52
55
|
// entry is not one of the groups: need to push a FIRST aggregate
|
53
56
|
auto bound = make_uniq<BoundReferenceExpression>(logical_type, i);
|
54
57
|
vector<unique_ptr<Expression>> first_children;
|
@@ -0,0 +1,14 @@
|
|
1
|
+
#include "duckdb/execution/operator/projection/physical_pivot.hpp"
|
2
|
+
#include "duckdb/execution/physical_plan_generator.hpp"
|
3
|
+
#include "duckdb/planner/operator/logical_pivot.hpp"
|
4
|
+
|
5
|
+
namespace duckdb {
|
6
|
+
|
7
|
+
unique_ptr<PhysicalOperator> PhysicalPlanGenerator::CreatePlan(LogicalPivot &op) {
|
8
|
+
D_ASSERT(op.children.size() == 1);
|
9
|
+
auto child_plan = CreatePlan(*op.children[0]);
|
10
|
+
auto pivot = make_uniq<PhysicalPivot>(std::move(op.types), std::move(child_plan), std::move(op.bound_pivot));
|
11
|
+
return std::move(pivot);
|
12
|
+
}
|
13
|
+
|
14
|
+
} // namespace duckdb
|
@@ -22,7 +22,7 @@ unique_ptr<PhysicalOperator> PhysicalPlanGenerator::CreatePlan(LogicalProjection
|
|
22
22
|
bool omit_projection = true;
|
23
23
|
for (idx_t i = 0; i < op.types.size(); i++) {
|
24
24
|
if (op.expressions[i]->type == ExpressionType::BOUND_REF) {
|
25
|
-
auto &bound_ref =
|
25
|
+
auto &bound_ref = op.expressions[i]->Cast<BoundReferenceExpression>();
|
26
26
|
if (bound_ref.index == i) {
|
27
27
|
continue;
|
28
28
|
}
|
@@ -11,16 +11,16 @@
|
|
11
11
|
namespace duckdb {
|
12
12
|
|
13
13
|
static bool IsStreamingWindow(unique_ptr<Expression> &expr) {
|
14
|
-
auto wexpr =
|
15
|
-
if (!wexpr
|
14
|
+
auto &wexpr = expr->Cast<BoundWindowExpression>();
|
15
|
+
if (!wexpr.partitions.empty() || !wexpr.orders.empty() || wexpr.ignore_nulls) {
|
16
16
|
return false;
|
17
17
|
}
|
18
|
-
switch (wexpr
|
18
|
+
switch (wexpr.type) {
|
19
19
|
// TODO: add more expression types here?
|
20
20
|
case ExpressionType::WINDOW_AGGREGATE:
|
21
21
|
// We can stream aggregates if they are "running totals" and don't use filters
|
22
|
-
return wexpr
|
23
|
-
!wexpr
|
22
|
+
return wexpr.start == WindowBoundary::UNBOUNDED_PRECEDING && wexpr.end == WindowBoundary::CURRENT_ROW_ROWS &&
|
23
|
+
!wexpr.filter_expr;
|
24
24
|
case ExpressionType::WINDOW_FIRST_VALUE:
|
25
25
|
case ExpressionType::WINDOW_PERCENT_RANK:
|
26
26
|
case ExpressionType::WINDOW_RANK:
|
@@ -68,14 +68,14 @@ unique_ptr<PhysicalOperator> PhysicalPlanGenerator::CreatePlan(LogicalWindow &op
|
|
68
68
|
|
69
69
|
// Find all functions that share the partitioning of the first remaining expression
|
70
70
|
const auto over_idx = remaining[0];
|
71
|
-
auto over_expr =
|
71
|
+
auto &over_expr = op.expressions[over_idx]->Cast<BoundWindowExpression>();
|
72
72
|
|
73
73
|
vector<idx_t> matching;
|
74
74
|
vector<idx_t> unprocessed;
|
75
75
|
for (const auto &expr_idx : remaining) {
|
76
76
|
D_ASSERT(op.expressions[expr_idx]->GetExpressionClass() == ExpressionClass::BOUND_WINDOW);
|
77
|
-
auto wexpr =
|
78
|
-
if (over_expr
|
77
|
+
auto &wexpr = op.expressions[expr_idx]->Cast<BoundWindowExpression>();
|
78
|
+
if (over_expr.KeysAreCompatible(wexpr)) {
|
79
79
|
matching.emplace_back(expr_idx);
|
80
80
|
} else {
|
81
81
|
unprocessed.emplace_back(expr_idx);
|
@@ -8,6 +8,7 @@
|
|
8
8
|
#include "duckdb/main/query_profiler.hpp"
|
9
9
|
#include "duckdb/planner/expression/bound_function_expression.hpp"
|
10
10
|
#include "duckdb/planner/operator/logical_extension_operator.hpp"
|
11
|
+
#include "duckdb/planner/operator/list.hpp"
|
11
12
|
|
12
13
|
namespace duckdb {
|
13
14
|
|
@@ -68,118 +69,118 @@ unique_ptr<PhysicalOperator> PhysicalPlanGenerator::CreatePlan(LogicalOperator &
|
|
68
69
|
|
69
70
|
switch (op.type) {
|
70
71
|
case LogicalOperatorType::LOGICAL_GET:
|
71
|
-
plan = CreatePlan((
|
72
|
+
plan = CreatePlan(op.Cast<LogicalGet>());
|
72
73
|
break;
|
73
74
|
case LogicalOperatorType::LOGICAL_PROJECTION:
|
74
|
-
plan = CreatePlan((
|
75
|
+
plan = CreatePlan(op.Cast<LogicalProjection>());
|
75
76
|
break;
|
76
77
|
case LogicalOperatorType::LOGICAL_EMPTY_RESULT:
|
77
|
-
plan = CreatePlan((
|
78
|
+
plan = CreatePlan(op.Cast<LogicalEmptyResult>());
|
78
79
|
break;
|
79
80
|
case LogicalOperatorType::LOGICAL_FILTER:
|
80
|
-
plan = CreatePlan((
|
81
|
+
plan = CreatePlan(op.Cast<LogicalFilter>());
|
81
82
|
break;
|
82
83
|
case LogicalOperatorType::LOGICAL_AGGREGATE_AND_GROUP_BY:
|
83
|
-
plan = CreatePlan((
|
84
|
+
plan = CreatePlan(op.Cast<LogicalAggregate>());
|
84
85
|
break;
|
85
86
|
case LogicalOperatorType::LOGICAL_WINDOW:
|
86
|
-
plan = CreatePlan((
|
87
|
+
plan = CreatePlan(op.Cast<LogicalWindow>());
|
87
88
|
break;
|
88
89
|
case LogicalOperatorType::LOGICAL_UNNEST:
|
89
|
-
plan = CreatePlan((
|
90
|
+
plan = CreatePlan(op.Cast<LogicalUnnest>());
|
90
91
|
break;
|
91
92
|
case LogicalOperatorType::LOGICAL_LIMIT:
|
92
|
-
plan = CreatePlan((
|
93
|
+
plan = CreatePlan(op.Cast<LogicalLimit>());
|
93
94
|
break;
|
94
95
|
case LogicalOperatorType::LOGICAL_LIMIT_PERCENT:
|
95
|
-
plan = CreatePlan((
|
96
|
+
plan = CreatePlan(op.Cast<LogicalLimitPercent>());
|
96
97
|
break;
|
97
98
|
case LogicalOperatorType::LOGICAL_SAMPLE:
|
98
|
-
plan = CreatePlan((
|
99
|
+
plan = CreatePlan(op.Cast<LogicalSample>());
|
99
100
|
break;
|
100
101
|
case LogicalOperatorType::LOGICAL_ORDER_BY:
|
101
|
-
plan = CreatePlan((
|
102
|
+
plan = CreatePlan(op.Cast<LogicalOrder>());
|
102
103
|
break;
|
103
104
|
case LogicalOperatorType::LOGICAL_TOP_N:
|
104
|
-
plan = CreatePlan((
|
105
|
+
plan = CreatePlan(op.Cast<LogicalTopN>());
|
105
106
|
break;
|
106
107
|
case LogicalOperatorType::LOGICAL_COPY_TO_FILE:
|
107
|
-
plan = CreatePlan((
|
108
|
+
plan = CreatePlan(op.Cast<LogicalCopyToFile>());
|
108
109
|
break;
|
109
110
|
case LogicalOperatorType::LOGICAL_DUMMY_SCAN:
|
110
|
-
plan = CreatePlan((
|
111
|
+
plan = CreatePlan(op.Cast<LogicalDummyScan>());
|
111
112
|
break;
|
112
113
|
case LogicalOperatorType::LOGICAL_ANY_JOIN:
|
113
|
-
plan = CreatePlan((
|
114
|
+
plan = CreatePlan(op.Cast<LogicalAnyJoin>());
|
114
115
|
break;
|
115
116
|
case LogicalOperatorType::LOGICAL_DELIM_JOIN:
|
116
|
-
plan = CreatePlan((
|
117
|
+
plan = CreatePlan(op.Cast<LogicalDelimJoin>());
|
117
118
|
break;
|
118
119
|
case LogicalOperatorType::LOGICAL_ASOF_JOIN:
|
119
|
-
plan = CreatePlan((
|
120
|
+
plan = CreatePlan(op.Cast<LogicalAsOfJoin>());
|
120
121
|
break;
|
121
122
|
case LogicalOperatorType::LOGICAL_COMPARISON_JOIN:
|
122
|
-
plan = CreatePlan((
|
123
|
+
plan = CreatePlan(op.Cast<LogicalComparisonJoin>());
|
123
124
|
break;
|
124
125
|
case LogicalOperatorType::LOGICAL_CROSS_PRODUCT:
|
125
|
-
plan = CreatePlan((
|
126
|
+
plan = CreatePlan(op.Cast<LogicalCrossProduct>());
|
126
127
|
break;
|
127
128
|
case LogicalOperatorType::LOGICAL_POSITIONAL_JOIN:
|
128
|
-
plan = CreatePlan((
|
129
|
+
plan = CreatePlan(op.Cast<LogicalPositionalJoin>());
|
129
130
|
break;
|
130
131
|
case LogicalOperatorType::LOGICAL_UNION:
|
131
132
|
case LogicalOperatorType::LOGICAL_EXCEPT:
|
132
133
|
case LogicalOperatorType::LOGICAL_INTERSECT:
|
133
|
-
plan = CreatePlan((
|
134
|
+
plan = CreatePlan(op.Cast<LogicalSetOperation>());
|
134
135
|
break;
|
135
136
|
case LogicalOperatorType::LOGICAL_INSERT:
|
136
|
-
plan = CreatePlan((
|
137
|
+
plan = CreatePlan(op.Cast<LogicalInsert>());
|
137
138
|
break;
|
138
139
|
case LogicalOperatorType::LOGICAL_DELETE:
|
139
|
-
plan = CreatePlan((
|
140
|
+
plan = CreatePlan(op.Cast<LogicalDelete>());
|
140
141
|
break;
|
141
142
|
case LogicalOperatorType::LOGICAL_CHUNK_GET:
|
142
|
-
plan = CreatePlan((
|
143
|
+
plan = CreatePlan(op.Cast<LogicalColumnDataGet>());
|
143
144
|
break;
|
144
145
|
case LogicalOperatorType::LOGICAL_DELIM_GET:
|
145
|
-
plan = CreatePlan((
|
146
|
+
plan = CreatePlan(op.Cast<LogicalDelimGet>());
|
146
147
|
break;
|
147
148
|
case LogicalOperatorType::LOGICAL_EXPRESSION_GET:
|
148
|
-
plan = CreatePlan((
|
149
|
+
plan = CreatePlan(op.Cast<LogicalExpressionGet>());
|
149
150
|
break;
|
150
151
|
case LogicalOperatorType::LOGICAL_UPDATE:
|
151
|
-
plan = CreatePlan((
|
152
|
+
plan = CreatePlan(op.Cast<LogicalUpdate>());
|
152
153
|
break;
|
153
154
|
case LogicalOperatorType::LOGICAL_CREATE_TABLE:
|
154
|
-
plan = CreatePlan((
|
155
|
+
plan = CreatePlan(op.Cast<LogicalCreateTable>());
|
155
156
|
break;
|
156
157
|
case LogicalOperatorType::LOGICAL_CREATE_INDEX:
|
157
|
-
plan = CreatePlan((
|
158
|
+
plan = CreatePlan(op.Cast<LogicalCreateIndex>());
|
158
159
|
break;
|
159
160
|
case LogicalOperatorType::LOGICAL_EXPLAIN:
|
160
|
-
plan = CreatePlan((
|
161
|
+
plan = CreatePlan(op.Cast<LogicalExplain>());
|
161
162
|
break;
|
162
163
|
case LogicalOperatorType::LOGICAL_SHOW:
|
163
|
-
plan = CreatePlan((
|
164
|
+
plan = CreatePlan(op.Cast<LogicalShow>());
|
164
165
|
break;
|
165
166
|
case LogicalOperatorType::LOGICAL_DISTINCT:
|
166
|
-
plan = CreatePlan((
|
167
|
+
plan = CreatePlan(op.Cast<LogicalDistinct>());
|
167
168
|
break;
|
168
169
|
case LogicalOperatorType::LOGICAL_PREPARE:
|
169
|
-
plan = CreatePlan((
|
170
|
+
plan = CreatePlan(op.Cast<LogicalPrepare>());
|
170
171
|
break;
|
171
172
|
case LogicalOperatorType::LOGICAL_EXECUTE:
|
172
|
-
plan = CreatePlan((
|
173
|
+
plan = CreatePlan(op.Cast<LogicalExecute>());
|
173
174
|
break;
|
174
175
|
case LogicalOperatorType::LOGICAL_CREATE_VIEW:
|
175
176
|
case LogicalOperatorType::LOGICAL_CREATE_SEQUENCE:
|
176
177
|
case LogicalOperatorType::LOGICAL_CREATE_SCHEMA:
|
177
178
|
case LogicalOperatorType::LOGICAL_CREATE_MACRO:
|
178
179
|
case LogicalOperatorType::LOGICAL_CREATE_TYPE:
|
179
|
-
plan = CreatePlan((
|
180
|
+
plan = CreatePlan(op.Cast<LogicalCreate>());
|
180
181
|
break;
|
181
182
|
case LogicalOperatorType::LOGICAL_PRAGMA:
|
182
|
-
plan = CreatePlan((
|
183
|
+
plan = CreatePlan(op.Cast<LogicalPragma>());
|
183
184
|
break;
|
184
185
|
case LogicalOperatorType::LOGICAL_TRANSACTION:
|
185
186
|
case LogicalOperatorType::LOGICAL_ALTER:
|
@@ -188,22 +189,25 @@ unique_ptr<PhysicalOperator> PhysicalPlanGenerator::CreatePlan(LogicalOperator &
|
|
188
189
|
case LogicalOperatorType::LOGICAL_LOAD:
|
189
190
|
case LogicalOperatorType::LOGICAL_ATTACH:
|
190
191
|
case LogicalOperatorType::LOGICAL_DETACH:
|
191
|
-
plan = CreatePlan((
|
192
|
+
plan = CreatePlan(op.Cast<LogicalSimple>());
|
192
193
|
break;
|
193
194
|
case LogicalOperatorType::LOGICAL_RECURSIVE_CTE:
|
194
|
-
plan = CreatePlan((
|
195
|
+
plan = CreatePlan(op.Cast<LogicalRecursiveCTE>());
|
195
196
|
break;
|
196
197
|
case LogicalOperatorType::LOGICAL_CTE_REF:
|
197
|
-
plan = CreatePlan((
|
198
|
+
plan = CreatePlan(op.Cast<LogicalCTERef>());
|
198
199
|
break;
|
199
200
|
case LogicalOperatorType::LOGICAL_EXPORT:
|
200
|
-
plan = CreatePlan((
|
201
|
+
plan = CreatePlan(op.Cast<LogicalExport>());
|
201
202
|
break;
|
202
203
|
case LogicalOperatorType::LOGICAL_SET:
|
203
|
-
plan = CreatePlan((
|
204
|
+
plan = CreatePlan(op.Cast<LogicalSet>());
|
204
205
|
break;
|
205
206
|
case LogicalOperatorType::LOGICAL_RESET:
|
206
|
-
plan = CreatePlan((
|
207
|
+
plan = CreatePlan(op.Cast<LogicalReset>());
|
208
|
+
break;
|
209
|
+
case LogicalOperatorType::LOGICAL_PIVOT:
|
210
|
+
plan = CreatePlan((LogicalPivot &)op);
|
207
211
|
break;
|
208
212
|
case LogicalOperatorType::LOGICAL_EXTENSION_OPERATOR:
|
209
213
|
plan = ((LogicalExtensionOperator &)op).CreatePlan(context, *this);
|
@@ -217,6 +221,9 @@ unique_ptr<PhysicalOperator> PhysicalPlanGenerator::CreatePlan(LogicalOperator &
|
|
217
221
|
throw NotImplementedException("Unimplemented logical operator type!");
|
218
222
|
}
|
219
223
|
}
|
224
|
+
if (!plan) {
|
225
|
+
throw InternalException("Physical plan generator - no plan generated");
|
226
|
+
}
|
220
227
|
|
221
228
|
if (op.estimated_props) {
|
222
229
|
plan->estimated_cardinality = op.estimated_props->GetCardinality<idx_t>();
|
@@ -102,7 +102,7 @@ public:
|
|
102
102
|
};
|
103
103
|
|
104
104
|
void RadixPartitionedHashTable::SetMultiScan(GlobalSinkState &state) {
|
105
|
-
auto &gstate = (
|
105
|
+
auto &gstate = state.Cast<RadixHTGlobalState>();
|
106
106
|
gstate.multi_scan = true;
|
107
107
|
}
|
108
108
|
|
@@ -121,7 +121,7 @@ void RadixPartitionedHashTable::PopulateGroupChunk(DataChunk &group_chunk, DataC
|
|
121
121
|
// Retrieve the expression containing the index in the input chunk
|
122
122
|
auto &group = op.groups[group_idx];
|
123
123
|
D_ASSERT(group->type == ExpressionType::BOUND_REF);
|
124
|
-
auto &bound_ref_expr = (
|
124
|
+
auto &bound_ref_expr = group->Cast<BoundReferenceExpression>();
|
125
125
|
// Reference from input_chunk[group.index] -> group_chunk[chunk_index]
|
126
126
|
group_chunk.data[chunk_index++].Reference(input_chunk.data[bound_ref_expr.index]);
|
127
127
|
}
|
@@ -132,8 +132,8 @@ void RadixPartitionedHashTable::PopulateGroupChunk(DataChunk &group_chunk, DataC
|
|
132
132
|
void RadixPartitionedHashTable::Sink(ExecutionContext &context, GlobalSinkState &state, LocalSinkState &lstate,
|
133
133
|
DataChunk &groups_input, DataChunk &payload_input,
|
134
134
|
const vector<idx_t> &filter) const {
|
135
|
-
auto &llstate = (
|
136
|
-
auto &gstate = (
|
135
|
+
auto &llstate = lstate.Cast<RadixHTLocalState>();
|
136
|
+
auto &gstate = state.Cast<RadixHTGlobalState>();
|
137
137
|
D_ASSERT(!gstate.is_finalized);
|
138
138
|
|
139
139
|
DataChunk &group_chunk = llstate.group_chunk;
|
@@ -176,8 +176,8 @@ void RadixPartitionedHashTable::Sink(ExecutionContext &context, GlobalSinkState
|
|
176
176
|
|
177
177
|
void RadixPartitionedHashTable::Combine(ExecutionContext &context, GlobalSinkState &state,
|
178
178
|
LocalSinkState &lstate) const {
|
179
|
-
auto &llstate = (
|
180
|
-
auto &gstate = (
|
179
|
+
auto &llstate = lstate.Cast<RadixHTLocalState>();
|
180
|
+
auto &gstate = state.Cast<RadixHTGlobalState>();
|
181
181
|
D_ASSERT(!gstate.is_finalized);
|
182
182
|
|
183
183
|
// this actually does not do a lot but just pushes the local HTs into the global state so we can later combine them
|
@@ -208,7 +208,7 @@ void RadixPartitionedHashTable::Combine(ExecutionContext &context, GlobalSinkSta
|
|
208
208
|
}
|
209
209
|
|
210
210
|
bool RadixPartitionedHashTable::Finalize(ClientContext &context, GlobalSinkState &gstate_p) const {
|
211
|
-
auto &gstate = (
|
211
|
+
auto &gstate = gstate_p.Cast<RadixHTGlobalState>();
|
212
212
|
D_ASSERT(!gstate.is_finalized);
|
213
213
|
gstate.is_finalized = true;
|
214
214
|
|
@@ -304,7 +304,7 @@ private:
|
|
304
304
|
|
305
305
|
void RadixPartitionedHashTable::ScheduleTasks(Executor &executor, const shared_ptr<Event> &event,
|
306
306
|
GlobalSinkState &state, vector<unique_ptr<Task>> &tasks) const {
|
307
|
-
auto &gstate = (
|
307
|
+
auto &gstate = state.Cast<RadixHTGlobalState>();
|
308
308
|
if (!gstate.is_partitioned) {
|
309
309
|
return;
|
310
310
|
}
|
@@ -316,7 +316,7 @@ void RadixPartitionedHashTable::ScheduleTasks(Executor &executor, const shared_p
|
|
316
316
|
}
|
317
317
|
|
318
318
|
bool RadixPartitionedHashTable::ForceSingleHT(GlobalSinkState &state) const {
|
319
|
-
auto &gstate = (
|
319
|
+
auto &gstate = state.Cast<RadixHTGlobalState>();
|
320
320
|
return gstate.partition_info.n_partitions < 2;
|
321
321
|
}
|
322
322
|
|
@@ -365,7 +365,7 @@ unique_ptr<LocalSourceState> RadixPartitionedHashTable::GetLocalSourceState(Exec
|
|
365
365
|
}
|
366
366
|
|
367
367
|
idx_t RadixPartitionedHashTable::Size(GlobalSinkState &sink_state) const {
|
368
|
-
auto &gstate = (
|
368
|
+
auto &gstate = sink_state.Cast<RadixHTGlobalState>();
|
369
369
|
if (gstate.is_empty && grouping_set.empty()) {
|
370
370
|
return 1;
|
371
371
|
}
|
@@ -379,9 +379,9 @@ idx_t RadixPartitionedHashTable::Size(GlobalSinkState &sink_state) const {
|
|
379
379
|
|
380
380
|
void RadixPartitionedHashTable::GetData(ExecutionContext &context, DataChunk &chunk, GlobalSinkState &sink_state,
|
381
381
|
GlobalSourceState &gsstate, LocalSourceState &lsstate) const {
|
382
|
-
auto &gstate = (
|
383
|
-
auto &state = (
|
384
|
-
auto &lstate = (
|
382
|
+
auto &gstate = sink_state.Cast<RadixHTGlobalState>();
|
383
|
+
auto &state = gsstate.Cast<RadixHTGlobalSourceState>();
|
384
|
+
auto &lstate = lsstate.Cast<RadixHTLocalSourceState>();
|
385
385
|
D_ASSERT(gstate.is_finalized);
|
386
386
|
if (state.finished) {
|
387
387
|
return;
|
@@ -399,7 +399,7 @@ void RadixPartitionedHashTable::GetData(ExecutionContext &context, DataChunk &ch
|
|
399
399
|
}
|
400
400
|
for (idx_t i = 0; i < op.aggregates.size(); i++) {
|
401
401
|
D_ASSERT(op.aggregates[i]->GetExpressionClass() == ExpressionClass::BOUND_AGGREGATE);
|
402
|
-
auto &aggr =
|
402
|
+
auto &aggr = op.aggregates[i]->Cast<BoundAggregateExpression>();
|
403
403
|
auto aggr_state = unique_ptr<data_t[]>(new data_t[aggr.function.state_size()]);
|
404
404
|
aggr.function.initialize(aggr_state.get());
|
405
405
|
|
@@ -52,7 +52,7 @@ public:
|
|
52
52
|
};
|
53
53
|
|
54
54
|
bool Equals(const FunctionData &other_p) const override {
|
55
|
-
auto &other = (
|
55
|
+
auto &other = other_p.Cast<AverageDecimalBindData>();
|
56
56
|
return scale == other.scale;
|
57
57
|
}
|
58
58
|
};
|
@@ -76,7 +76,7 @@ template <class T>
|
|
76
76
|
static T GetAverageDivident(uint64_t count, FunctionData *bind_data) {
|
77
77
|
T divident = T(count);
|
78
78
|
if (bind_data) {
|
79
|
-
auto &avg_bind_data = (
|
79
|
+
auto &avg_bind_data = bind_data->Cast<AverageDecimalBindData>();
|
80
80
|
divident *= avg_bind_data.scale;
|
81
81
|
}
|
82
82
|
return divident;
|
@@ -33,7 +33,7 @@ struct BitstringAggBindData : public FunctionData {
|
|
33
33
|
}
|
34
34
|
|
35
35
|
bool Equals(const FunctionData &other_p) const override {
|
36
|
-
auto &other = (
|
36
|
+
auto &other = other_p.Cast<BitstringAggBindData>();
|
37
37
|
if (min.IsNull() && other.min.IsNull() && max.IsNull() && other.max.IsNull()) {
|
38
38
|
return true;
|
39
39
|
}
|
@@ -25,7 +25,7 @@ struct StringAggBindData : public FunctionData {
|
|
25
25
|
return make_uniq<StringAggBindData>(sep);
|
26
26
|
}
|
27
27
|
bool Equals(const FunctionData &other_p) const override {
|
28
|
-
auto &other = (
|
28
|
+
auto &other = other_p.Cast<StringAggBindData>();
|
29
29
|
return sep == other.sep;
|
30
30
|
}
|
31
31
|
};
|
@@ -89,7 +89,7 @@ struct StringAggFunction {
|
|
89
89
|
}
|
90
90
|
|
91
91
|
static inline void PerformOperation(StringAggState *state, string_t str, FunctionData *data_p) {
|
92
|
-
auto &data = (
|
92
|
+
auto &data = data_p->Cast<StringAggBindData>();
|
93
93
|
PerformOperation(state, str.GetDataUnsafe(), data.sep.c_str(), str.GetSize(), data.sep.size());
|
94
94
|
}
|
95
95
|
|
@@ -28,7 +28,7 @@ struct ApproximateQuantileBindData : public FunctionData {
|
|
28
28
|
}
|
29
29
|
|
30
30
|
bool Equals(const FunctionData &other_p) const override {
|
31
|
-
auto &other = (
|
31
|
+
auto &other = other_p.Cast<ApproximateQuantileBindData>();
|
32
32
|
// return quantiles == other.quantiles;
|
33
33
|
if (quantiles != other.quantiles) {
|
34
34
|
return false;
|
@@ -440,7 +440,7 @@ struct QuantileBindData : public FunctionData {
|
|
440
440
|
}
|
441
441
|
|
442
442
|
bool Equals(const FunctionData &other_p) const override {
|
443
|
-
auto &other = (
|
443
|
+
auto &other = other_p.Cast<QuantileBindData>();
|
444
444
|
return desc == other.desc && quantiles == other.quantiles && order == other.order;
|
445
445
|
}
|
446
446
|
|
@@ -60,7 +60,7 @@ struct ReservoirQuantileBindData : public FunctionData {
|
|
60
60
|
}
|
61
61
|
|
62
62
|
bool Equals(const FunctionData &other_p) const override {
|
63
|
-
auto &other = (
|
63
|
+
auto &other = other_p.Cast<ReservoirQuantileBindData>();
|
64
64
|
return quantiles == other.quantiles && sample_size == other.sample_size;
|
65
65
|
}
|
66
66
|
|
@@ -118,7 +118,7 @@ static void ListUpdateFunction(Vector inputs[], AggregateInputData &aggr_input_d
|
|
118
118
|
auto states = (ListAggState **)sdata.data;
|
119
119
|
RecursiveFlatten(input, count);
|
120
120
|
|
121
|
-
auto &list_bind_data =
|
121
|
+
auto &list_bind_data = aggr_input_data.bind_data->Cast<ListBindData>();
|
122
122
|
|
123
123
|
for (idx_t i = 0; i < count; i++) {
|
124
124
|
auto state = states[sdata.sel->get_index(i)];
|
@@ -138,7 +138,7 @@ static void ListCombineFunction(Vector &state, Vector &combined, AggregateInputD
|
|
138
138
|
state.ToUnifiedFormat(count, sdata);
|
139
139
|
auto states_ptr = (ListAggState **)sdata.data;
|
140
140
|
|
141
|
-
auto &list_bind_data =
|
141
|
+
auto &list_bind_data = aggr_input_data.bind_data->Cast<ListBindData>();
|
142
142
|
|
143
143
|
auto combined_ptr = FlatVector::GetData<ListAggState *>(combined);
|
144
144
|
for (idx_t i = 0; i < count; i++) {
|
@@ -185,7 +185,7 @@ static void ListFinalize(Vector &state_vector, AggregateInputData &aggr_input_da
|
|
185
185
|
auto result_data = FlatVector::GetData<list_entry_t>(result);
|
186
186
|
size_t total_len = ListVector::GetListSize(result);
|
187
187
|
|
188
|
-
auto &list_bind_data =
|
188
|
+
auto &list_bind_data = aggr_input_data.bind_data->Cast<ListBindData>();
|
189
189
|
|
190
190
|
for (idx_t i = 0; i < count; i++) {
|
191
191
|
|
@@ -116,7 +116,7 @@ public:
|
|
116
116
|
};
|
117
117
|
|
118
118
|
static unique_ptr<FunctionLocalState> InitEnumCastLocalState(CastLocalStateParameters ¶meters) {
|
119
|
-
auto &cast_data =
|
119
|
+
auto &cast_data = parameters.cast_data->Cast<EnumBoundCastData>();
|
120
120
|
auto result = make_uniq<EnumCastLocalState>();
|
121
121
|
|
122
122
|
if (cast_data.from_varchar_cast.init_local_state) {
|
@@ -131,8 +131,8 @@ static unique_ptr<FunctionLocalState> InitEnumCastLocalState(CastLocalStateParam
|
|
131
131
|
}
|
132
132
|
|
133
133
|
static bool EnumToAnyCast(Vector &source, Vector &result, idx_t count, CastParameters ¶meters) {
|
134
|
-
auto &cast_data =
|
135
|
-
auto &lstate =
|
134
|
+
auto &cast_data = parameters.cast_data->Cast<EnumBoundCastData>();
|
135
|
+
auto &lstate = parameters.local_state->Cast<EnumCastLocalState>();
|
136
136
|
|
137
137
|
Vector varchar_cast(LogicalType::VARCHAR, count);
|
138
138
|
|
@@ -14,7 +14,7 @@ unique_ptr<BoundCastData> ListBoundCastData::BindListToListCast(BindCastInput &i
|
|
14
14
|
}
|
15
15
|
|
16
16
|
unique_ptr<FunctionLocalState> ListBoundCastData::InitListLocalState(CastLocalStateParameters ¶meters) {
|
17
|
-
auto &cast_data =
|
17
|
+
auto &cast_data = parameters.cast_data->Cast<ListBoundCastData>();
|
18
18
|
if (!cast_data.child_cast_info.init_local_state) {
|
19
19
|
return nullptr;
|
20
20
|
}
|
@@ -23,7 +23,7 @@ unique_ptr<FunctionLocalState> ListBoundCastData::InitListLocalState(CastLocalSt
|
|
23
23
|
}
|
24
24
|
|
25
25
|
bool ListCast::ListToListCast(Vector &source, Vector &result, idx_t count, CastParameters ¶meters) {
|
26
|
-
auto &cast_data =
|
26
|
+
auto &cast_data = parameters.cast_data->Cast<ListBoundCastData>();
|
27
27
|
|
28
28
|
// only handle constant and flat vectors here for now
|
29
29
|
if (source.GetVectorType() == VectorType::CONSTANT_VECTOR) {
|
@@ -165,7 +165,7 @@ bool VectorStringToList::StringToNestedTypeCastLoop(string_t *source_data, Valid
|
|
165
165
|
D_ASSERT(total_list_size == total);
|
166
166
|
|
167
167
|
auto &result_child = ListVector::GetEntry(result);
|
168
|
-
auto &cast_data =
|
168
|
+
auto &cast_data = parameters.cast_data->Cast<ListBoundCastData>();
|
169
169
|
CastParameters child_parameters(parameters, cast_data.child_cast_info.cast_data, parameters.local_state);
|
170
170
|
return cast_data.child_cast_info.function(varchar_vector, result_child, total_list_size, child_parameters) &&
|
171
171
|
all_converted;
|
@@ -219,8 +219,8 @@ bool VectorStringToStruct::StringToNestedTypeCastLoop(string_t *source_data, Val
|
|
219
219
|
}
|
220
220
|
}
|
221
221
|
|
222
|
-
auto &cast_data =
|
223
|
-
auto &lstate =
|
222
|
+
auto &cast_data = parameters.cast_data->Cast<StructBoundCastData>();
|
223
|
+
auto &lstate = parameters.local_state->Cast<StructCastLocalState>();
|
224
224
|
D_ASSERT(cast_data.child_cast_info.size() == result_children.size());
|
225
225
|
|
226
226
|
for (idx_t child_idx = 0; child_idx < result_children.size(); child_idx++) {
|
@@ -239,7 +239,7 @@ bool VectorStringToStruct::StringToNestedTypeCastLoop(string_t *source_data, Val
|
|
239
239
|
// string -> map casting
|
240
240
|
//===--------------------------------------------------------------------===//
|
241
241
|
unique_ptr<FunctionLocalState> InitMapCastLocalState(CastLocalStateParameters ¶meters) {
|
242
|
-
auto &cast_data =
|
242
|
+
auto &cast_data = parameters.cast_data->Cast<MapBoundCastData>();
|
243
243
|
auto result = make_uniq<MapCastLocalState>();
|
244
244
|
|
245
245
|
if (cast_data.key_cast.init_local_state) {
|
@@ -303,8 +303,8 @@ bool VectorStringToMap::StringToNestedTypeCastLoop(string_t *source_data, Validi
|
|
303
303
|
|
304
304
|
auto &result_key_child = MapVector::GetKeys(result);
|
305
305
|
auto &result_val_child = MapVector::GetValues(result);
|
306
|
-
auto &cast_data =
|
307
|
-
auto &lstate =
|
306
|
+
auto &cast_data = parameters.cast_data->Cast<MapBoundCastData>();
|
307
|
+
auto &lstate = parameters.local_state->Cast<MapCastLocalState>();
|
308
308
|
|
309
309
|
CastParameters key_params(parameters, cast_data.key_cast.cast_data, lstate.key_state);
|
310
310
|
if (!cast_data.key_cast.function(varchar_key_vector, result_key_child, total_elements, key_params)) {
|
@@ -20,7 +20,7 @@ unique_ptr<BoundCastData> StructBoundCastData::BindStructToStructCast(BindCastIn
|
|
20
20
|
}
|
21
21
|
|
22
22
|
unique_ptr<FunctionLocalState> StructBoundCastData::InitStructCastLocalState(CastLocalStateParameters ¶meters) {
|
23
|
-
auto &cast_data =
|
23
|
+
auto &cast_data = parameters.cast_data->Cast<StructBoundCastData>();
|
24
24
|
auto result = make_uniq<StructCastLocalState>();
|
25
25
|
|
26
26
|
for (auto &entry : cast_data.child_cast_info) {
|
@@ -35,8 +35,8 @@ unique_ptr<FunctionLocalState> StructBoundCastData::InitStructCastLocalState(Cas
|
|
35
35
|
}
|
36
36
|
|
37
37
|
static bool StructToStructCast(Vector &source, Vector &result, idx_t count, CastParameters ¶meters) {
|
38
|
-
auto &cast_data =
|
39
|
-
auto &lstate =
|
38
|
+
auto &cast_data = parameters.cast_data->Cast<StructBoundCastData>();
|
39
|
+
auto &lstate = parameters.local_state->Cast<StructCastLocalState>();
|
40
40
|
auto &source_child_types = StructType::GetChildTypes(source.GetType());
|
41
41
|
auto &source_children = StructVector::GetEntries(source);
|
42
42
|
D_ASSERT(source_children.size() == StructType::GetChildTypes(result.GetType()).size());
|
@@ -66,7 +66,7 @@ static bool StructToStructCast(Vector &source, Vector &result, idx_t count, Cast
|
|
66
66
|
static bool StructToVarcharCast(Vector &source, Vector &result, idx_t count, CastParameters ¶meters) {
|
67
67
|
auto constant = source.GetVectorType() == VectorType::CONSTANT_VECTOR;
|
68
68
|
// first cast all child elements to varchar
|
69
|
-
auto &cast_data =
|
69
|
+
auto &cast_data = parameters.cast_data->Cast<StructBoundCastData>();
|
70
70
|
Vector varchar_struct(cast_data.target, count);
|
71
71
|
StructToStructCast(source, varchar_struct, count, parameters);
|
72
72
|
|
@@ -99,7 +99,7 @@ unique_ptr<BoundCastData> BindToUnionCast(BindCastInput &input, const LogicalTyp
|
|
99
99
|
}
|
100
100
|
|
101
101
|
unique_ptr<FunctionLocalState> InitToUnionLocalState(CastLocalStateParameters ¶meters) {
|
102
|
-
auto &cast_data =
|
102
|
+
auto &cast_data = parameters.cast_data->Cast<ToUnionBoundCastData>();
|
103
103
|
if (!cast_data.member_cast_info.init_local_state) {
|
104
104
|
return nullptr;
|
105
105
|
}
|
@@ -109,7 +109,7 @@ unique_ptr<FunctionLocalState> InitToUnionLocalState(CastLocalStateParameters &p
|
|
109
109
|
|
110
110
|
static bool ToUnionCast(Vector &source, Vector &result, idx_t count, CastParameters ¶meters) {
|
111
111
|
D_ASSERT(result.GetType().id() == LogicalTypeId::UNION);
|
112
|
-
auto &cast_data =
|
112
|
+
auto &cast_data = parameters.cast_data->Cast<ToUnionBoundCastData>();
|
113
113
|
auto &selected_member_vector = UnionVector::GetMember(result, cast_data.tag);
|
114
114
|
|
115
115
|
CastParameters child_parameters(parameters, cast_data.member_cast_info.cast_data, parameters.local_state);
|
@@ -207,7 +207,7 @@ unique_ptr<BoundCastData> BindUnionToUnionCast(BindCastInput &input, const Logic
|
|
207
207
|
}
|
208
208
|
|
209
209
|
unique_ptr<FunctionLocalState> InitUnionToUnionLocalState(CastLocalStateParameters ¶meters) {
|
210
|
-
auto &cast_data =
|
210
|
+
auto &cast_data = parameters.cast_data->Cast<UnionToUnionBoundCastData>();
|
211
211
|
auto result = make_uniq<StructCastLocalState>();
|
212
212
|
|
213
213
|
for (auto &entry : cast_data.member_casts) {
|
@@ -222,8 +222,8 @@ unique_ptr<FunctionLocalState> InitUnionToUnionLocalState(CastLocalStateParamete
|
|
222
222
|
}
|
223
223
|
|
224
224
|
static bool UnionToUnionCast(Vector &source, Vector &result, idx_t count, CastParameters ¶meters) {
|
225
|
-
auto &cast_data =
|
226
|
-
auto &lstate =
|
225
|
+
auto &cast_data = parameters.cast_data->Cast<UnionToUnionBoundCastData>();
|
226
|
+
auto &lstate = parameters.local_state->Cast<StructCastLocalState>();
|
227
227
|
|
228
228
|
auto source_member_count = UnionType::GetMemberCount(source.GetType());
|
229
229
|
auto target_member_count = UnionType::GetMemberCount(result.GetType());
|
@@ -313,7 +313,7 @@ static bool UnionToUnionCast(Vector &source, Vector &result, idx_t count, CastPa
|
|
313
313
|
static bool UnionToVarcharCast(Vector &source, Vector &result, idx_t count, CastParameters ¶meters) {
|
314
314
|
auto constant = source.GetVectorType() == VectorType::CONSTANT_VECTOR;
|
315
315
|
// first cast all union members to varchar
|
316
|
-
auto &cast_data =
|
316
|
+
auto &cast_data = parameters.cast_data->Cast<UnionToUnionBoundCastData>();
|
317
317
|
Vector varchar_union(cast_data.target_type, count);
|
318
318
|
|
319
319
|
UnionToUnionCast(source, varchar_union, count, parameters);
|