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
@@ -6,15 +6,16 @@
|
|
6
6
|
#include "duckdb/parser/parsed_expression_iterator.hpp"
|
7
7
|
#include "duckdb/parser/query_node/select_node.hpp"
|
8
8
|
#include "duckdb/parser/statement/list.hpp"
|
9
|
-
#include "duckdb/parser/tableref/
|
9
|
+
#include "duckdb/parser/tableref/list.hpp"
|
10
10
|
#include "duckdb/parser/tableref/table_function_ref.hpp"
|
11
11
|
#include "duckdb/planner/bound_query_node.hpp"
|
12
|
-
#include "duckdb/planner/
|
12
|
+
#include "duckdb/planner/tableref/list.hpp"
|
13
|
+
#include "duckdb/planner/query_node/list.hpp"
|
13
14
|
#include "duckdb/planner/expression.hpp"
|
14
15
|
#include "duckdb/planner/expression_binder/returning_binder.hpp"
|
15
|
-
#include "duckdb/planner/expression_iterator.hpp"
|
16
16
|
#include "duckdb/planner/operator/logical_projection.hpp"
|
17
17
|
#include "duckdb/planner/operator/logical_sample.hpp"
|
18
|
+
#include "duckdb/parser/query_node/list.hpp"
|
18
19
|
|
19
20
|
#include <algorithm>
|
20
21
|
|
@@ -46,53 +47,53 @@ BoundStatement Binder::Bind(SQLStatement &statement) {
|
|
46
47
|
root_statement = &statement;
|
47
48
|
switch (statement.type) {
|
48
49
|
case StatementType::SELECT_STATEMENT:
|
49
|
-
return Bind((
|
50
|
+
return Bind(statement.Cast<SelectStatement>());
|
50
51
|
case StatementType::INSERT_STATEMENT:
|
51
|
-
return Bind((
|
52
|
+
return Bind(statement.Cast<InsertStatement>());
|
52
53
|
case StatementType::COPY_STATEMENT:
|
53
|
-
return Bind((
|
54
|
+
return Bind(statement.Cast<CopyStatement>());
|
54
55
|
case StatementType::DELETE_STATEMENT:
|
55
|
-
return Bind((
|
56
|
+
return Bind(statement.Cast<DeleteStatement>());
|
56
57
|
case StatementType::UPDATE_STATEMENT:
|
57
|
-
return Bind((
|
58
|
+
return Bind(statement.Cast<UpdateStatement>());
|
58
59
|
case StatementType::RELATION_STATEMENT:
|
59
|
-
return Bind((
|
60
|
+
return Bind(statement.Cast<RelationStatement>());
|
60
61
|
case StatementType::CREATE_STATEMENT:
|
61
|
-
return Bind((
|
62
|
+
return Bind(statement.Cast<CreateStatement>());
|
62
63
|
case StatementType::DROP_STATEMENT:
|
63
|
-
return Bind((
|
64
|
+
return Bind(statement.Cast<DropStatement>());
|
64
65
|
case StatementType::ALTER_STATEMENT:
|
65
|
-
return Bind((
|
66
|
+
return Bind(statement.Cast<AlterStatement>());
|
66
67
|
case StatementType::TRANSACTION_STATEMENT:
|
67
|
-
return Bind((
|
68
|
+
return Bind(statement.Cast<TransactionStatement>());
|
68
69
|
case StatementType::PRAGMA_STATEMENT:
|
69
|
-
return Bind((
|
70
|
+
return Bind(statement.Cast<PragmaStatement>());
|
70
71
|
case StatementType::EXPLAIN_STATEMENT:
|
71
|
-
return Bind((
|
72
|
+
return Bind(statement.Cast<ExplainStatement>());
|
72
73
|
case StatementType::VACUUM_STATEMENT:
|
73
|
-
return Bind((
|
74
|
+
return Bind(statement.Cast<VacuumStatement>());
|
74
75
|
case StatementType::SHOW_STATEMENT:
|
75
|
-
return Bind((
|
76
|
+
return Bind(statement.Cast<ShowStatement>());
|
76
77
|
case StatementType::CALL_STATEMENT:
|
77
|
-
return Bind((
|
78
|
+
return Bind(statement.Cast<CallStatement>());
|
78
79
|
case StatementType::EXPORT_STATEMENT:
|
79
|
-
return Bind((
|
80
|
+
return Bind(statement.Cast<ExportStatement>());
|
80
81
|
case StatementType::SET_STATEMENT:
|
81
|
-
return Bind((
|
82
|
+
return Bind(statement.Cast<SetStatement>());
|
82
83
|
case StatementType::LOAD_STATEMENT:
|
83
|
-
return Bind((
|
84
|
+
return Bind(statement.Cast<LoadStatement>());
|
84
85
|
case StatementType::EXTENSION_STATEMENT:
|
85
|
-
return Bind((
|
86
|
+
return Bind(statement.Cast<ExtensionStatement>());
|
86
87
|
case StatementType::PREPARE_STATEMENT:
|
87
|
-
return Bind((
|
88
|
+
return Bind(statement.Cast<PrepareStatement>());
|
88
89
|
case StatementType::EXECUTE_STATEMENT:
|
89
|
-
return Bind((
|
90
|
+
return Bind(statement.Cast<ExecuteStatement>());
|
90
91
|
case StatementType::LOGICAL_PLAN_STATEMENT:
|
91
|
-
return Bind((
|
92
|
+
return Bind(statement.Cast<LogicalPlanStatement>());
|
92
93
|
case StatementType::ATTACH_STATEMENT:
|
93
|
-
return Bind((
|
94
|
+
return Bind(statement.Cast<AttachStatement>());
|
94
95
|
case StatementType::DETACH_STATEMENT:
|
95
|
-
return Bind((
|
96
|
+
return Bind(statement.Cast<DetachStatement>());
|
96
97
|
default: // LCOV_EXCL_START
|
97
98
|
throw NotImplementedException("Unimplemented statement type \"%s\" for Bind",
|
98
99
|
StatementTypeToString(statement.type));
|
@@ -112,14 +113,14 @@ unique_ptr<BoundQueryNode> Binder::BindNode(QueryNode &node) {
|
|
112
113
|
unique_ptr<BoundQueryNode> result;
|
113
114
|
switch (node.type) {
|
114
115
|
case QueryNodeType::SELECT_NODE:
|
115
|
-
result = BindNode((
|
116
|
+
result = BindNode(node.Cast<SelectNode>());
|
116
117
|
break;
|
117
118
|
case QueryNodeType::RECURSIVE_CTE_NODE:
|
118
|
-
result = BindNode((
|
119
|
+
result = BindNode(node.Cast<RecursiveCTENode>());
|
119
120
|
break;
|
120
121
|
default:
|
121
122
|
D_ASSERT(node.type == QueryNodeType::SET_OPERATION_NODE);
|
122
|
-
result = BindNode((
|
123
|
+
result = BindNode(node.Cast<SetOperationNode>());
|
123
124
|
break;
|
124
125
|
}
|
125
126
|
return result;
|
@@ -140,11 +141,11 @@ BoundStatement Binder::Bind(QueryNode &node) {
|
|
140
141
|
unique_ptr<LogicalOperator> Binder::CreatePlan(BoundQueryNode &node) {
|
141
142
|
switch (node.type) {
|
142
143
|
case QueryNodeType::SELECT_NODE:
|
143
|
-
return CreatePlan((
|
144
|
+
return CreatePlan(node.Cast<BoundSelectNode>());
|
144
145
|
case QueryNodeType::SET_OPERATION_NODE:
|
145
|
-
return CreatePlan((
|
146
|
+
return CreatePlan(node.Cast<BoundSetOperationNode>());
|
146
147
|
case QueryNodeType::RECURSIVE_CTE_NODE:
|
147
|
-
return CreatePlan((
|
148
|
+
return CreatePlan(node.Cast<BoundRecursiveCTENode>());
|
148
149
|
default:
|
149
150
|
throw InternalException("Unsupported bound query node type");
|
150
151
|
}
|
@@ -154,25 +155,25 @@ unique_ptr<BoundTableRef> Binder::Bind(TableRef &ref) {
|
|
154
155
|
unique_ptr<BoundTableRef> result;
|
155
156
|
switch (ref.type) {
|
156
157
|
case TableReferenceType::BASE_TABLE:
|
157
|
-
result = Bind((
|
158
|
+
result = Bind(ref.Cast<BaseTableRef>());
|
158
159
|
break;
|
159
160
|
case TableReferenceType::JOIN:
|
160
|
-
result = Bind((
|
161
|
+
result = Bind(ref.Cast<JoinRef>());
|
161
162
|
break;
|
162
163
|
case TableReferenceType::SUBQUERY:
|
163
|
-
result = Bind((
|
164
|
+
result = Bind(ref.Cast<SubqueryRef>());
|
164
165
|
break;
|
165
166
|
case TableReferenceType::EMPTY:
|
166
|
-
result = Bind((
|
167
|
+
result = Bind(ref.Cast<EmptyTableRef>());
|
167
168
|
break;
|
168
169
|
case TableReferenceType::TABLE_FUNCTION:
|
169
|
-
result = Bind((
|
170
|
+
result = Bind(ref.Cast<TableFunctionRef>());
|
170
171
|
break;
|
171
172
|
case TableReferenceType::EXPRESSION_LIST:
|
172
|
-
result = Bind((
|
173
|
+
result = Bind(ref.Cast<ExpressionListRef>());
|
173
174
|
break;
|
174
175
|
case TableReferenceType::PIVOT:
|
175
|
-
result = Bind((
|
176
|
+
result = Bind(ref.Cast<PivotRef>());
|
176
177
|
break;
|
177
178
|
case TableReferenceType::CTE:
|
178
179
|
case TableReferenceType::INVALID:
|
@@ -187,25 +188,28 @@ unique_ptr<LogicalOperator> Binder::CreatePlan(BoundTableRef &ref) {
|
|
187
188
|
unique_ptr<LogicalOperator> root;
|
188
189
|
switch (ref.type) {
|
189
190
|
case TableReferenceType::BASE_TABLE:
|
190
|
-
root = CreatePlan((
|
191
|
+
root = CreatePlan(ref.Cast<BoundBaseTableRef>());
|
191
192
|
break;
|
192
193
|
case TableReferenceType::SUBQUERY:
|
193
|
-
root = CreatePlan((
|
194
|
+
root = CreatePlan(ref.Cast<BoundSubqueryRef>());
|
194
195
|
break;
|
195
196
|
case TableReferenceType::JOIN:
|
196
|
-
root = CreatePlan((
|
197
|
+
root = CreatePlan(ref.Cast<BoundJoinRef>());
|
197
198
|
break;
|
198
199
|
case TableReferenceType::TABLE_FUNCTION:
|
199
|
-
root = CreatePlan((
|
200
|
+
root = CreatePlan(ref.Cast<BoundTableFunction>());
|
200
201
|
break;
|
201
202
|
case TableReferenceType::EMPTY:
|
202
|
-
root = CreatePlan((
|
203
|
+
root = CreatePlan(ref.Cast<BoundEmptyTableRef>());
|
203
204
|
break;
|
204
205
|
case TableReferenceType::EXPRESSION_LIST:
|
205
|
-
root = CreatePlan((
|
206
|
+
root = CreatePlan(ref.Cast<BoundExpressionListRef>());
|
206
207
|
break;
|
207
208
|
case TableReferenceType::CTE:
|
208
|
-
root = CreatePlan((
|
209
|
+
root = CreatePlan(ref.Cast<BoundCTERef>());
|
210
|
+
break;
|
211
|
+
case TableReferenceType::PIVOT:
|
212
|
+
root = CreatePlan((BoundPivotRef &)ref);
|
209
213
|
break;
|
210
214
|
case TableReferenceType::INVALID:
|
211
215
|
default:
|
@@ -423,7 +427,7 @@ string Binder::FormatErrorRecursive(idx_t query_location, const string &message,
|
|
423
427
|
// FIXME: this is extremely naive
|
424
428
|
void VerifyNotExcluded(ParsedExpression &expr) {
|
425
429
|
if (expr.type == ExpressionType::COLUMN_REF) {
|
426
|
-
auto &column_ref = (
|
430
|
+
auto &column_ref = expr.Cast<ColumnRefExpression>();
|
427
431
|
if (!column_ref.IsQualified()) {
|
428
432
|
return;
|
429
433
|
}
|
@@ -34,28 +34,28 @@ bool BoundAggregateExpression::Equals(const BaseExpression *other_p) const {
|
|
34
34
|
if (!Expression::Equals(other_p)) {
|
35
35
|
return false;
|
36
36
|
}
|
37
|
-
auto other = (
|
38
|
-
if (other
|
37
|
+
auto &other = other_p->Cast<BoundAggregateExpression>();
|
38
|
+
if (other.aggr_type != aggr_type) {
|
39
39
|
return false;
|
40
40
|
}
|
41
|
-
if (other
|
41
|
+
if (other.function != function) {
|
42
42
|
return false;
|
43
43
|
}
|
44
|
-
if (children.size() != other
|
44
|
+
if (children.size() != other.children.size()) {
|
45
45
|
return false;
|
46
46
|
}
|
47
|
-
if (!Expression::Equals(other
|
47
|
+
if (!Expression::Equals(other.filter.get(), filter.get())) {
|
48
48
|
return false;
|
49
49
|
}
|
50
50
|
for (idx_t i = 0; i < children.size(); i++) {
|
51
|
-
if (!Expression::Equals(children[i].get(), other
|
51
|
+
if (!Expression::Equals(children[i].get(), other.children[i].get())) {
|
52
52
|
return false;
|
53
53
|
}
|
54
54
|
}
|
55
|
-
if (!FunctionData::Equals(bind_info.get(), other
|
55
|
+
if (!FunctionData::Equals(bind_info.get(), other.bind_info.get())) {
|
56
56
|
return false;
|
57
57
|
}
|
58
|
-
if (!BoundOrderModifier::Equals(order_bys.get(), other
|
58
|
+
if (!BoundOrderModifier::Equals(order_bys.get(), other.order_bys.get())) {
|
59
59
|
return false;
|
60
60
|
}
|
61
61
|
return true;
|
@@ -19,17 +19,17 @@ bool BoundBetweenExpression::Equals(const BaseExpression *other_p) const {
|
|
19
19
|
if (!Expression::Equals(other_p)) {
|
20
20
|
return false;
|
21
21
|
}
|
22
|
-
auto other = (
|
23
|
-
if (!Expression::Equals(input.get(), other
|
22
|
+
auto &other = other_p->Cast<BoundBetweenExpression>();
|
23
|
+
if (!Expression::Equals(input.get(), other.input.get())) {
|
24
24
|
return false;
|
25
25
|
}
|
26
|
-
if (!Expression::Equals(lower.get(), other
|
26
|
+
if (!Expression::Equals(lower.get(), other.lower.get())) {
|
27
27
|
return false;
|
28
28
|
}
|
29
|
-
if (!Expression::Equals(upper.get(), other
|
29
|
+
if (!Expression::Equals(upper.get(), other.upper.get())) {
|
30
30
|
return false;
|
31
31
|
}
|
32
|
-
return lower_inclusive == other
|
32
|
+
return lower_inclusive == other.lower_inclusive && upper_inclusive == other.upper_inclusive;
|
33
33
|
}
|
34
34
|
|
35
35
|
unique_ptr<Expression> BoundBetweenExpression::Copy() {
|
@@ -26,7 +26,7 @@ bool BoundCaseExpression::Equals(const BaseExpression *other_p) const {
|
|
26
26
|
if (!Expression::Equals(other_p)) {
|
27
27
|
return false;
|
28
28
|
}
|
29
|
-
auto &other = (
|
29
|
+
auto &other = other_p->Cast<BoundCaseExpression>();
|
30
30
|
if (case_checks.size() != other.case_checks.size()) {
|
31
31
|
return false;
|
32
32
|
}
|
@@ -41,7 +41,7 @@ unique_ptr<Expression> AddCastToTypeInternal(unique_ptr<Expression> expr, const
|
|
41
41
|
bool try_cast) {
|
42
42
|
D_ASSERT(expr);
|
43
43
|
if (expr->expression_class == ExpressionClass::BOUND_PARAMETER) {
|
44
|
-
auto ¶meter = (
|
44
|
+
auto ¶meter = expr->Cast<BoundParameterExpression>();
|
45
45
|
if (!target_type.IsValid()) {
|
46
46
|
// invalidate the parameter
|
47
47
|
parameter.parameter_data->return_type = LogicalType::INVALID;
|
@@ -71,7 +71,7 @@ unique_ptr<Expression> AddCastToTypeInternal(unique_ptr<Expression> expr, const
|
|
71
71
|
return expr;
|
72
72
|
} else if (expr->expression_class == ExpressionClass::BOUND_DEFAULT) {
|
73
73
|
D_ASSERT(target_type.IsValid());
|
74
|
-
auto &def = (
|
74
|
+
auto &def = expr->Cast<BoundDefaultExpression>();
|
75
75
|
def.return_type = target_type;
|
76
76
|
}
|
77
77
|
if (!target_type.IsValid()) {
|
@@ -173,11 +173,11 @@ bool BoundCastExpression::Equals(const BaseExpression *other_p) const {
|
|
173
173
|
if (!Expression::Equals(other_p)) {
|
174
174
|
return false;
|
175
175
|
}
|
176
|
-
auto other = (
|
177
|
-
if (!Expression::Equals(child.get(), other
|
176
|
+
auto &other = other_p->Cast<BoundCastExpression>();
|
177
|
+
if (!Expression::Equals(child.get(), other.child.get())) {
|
178
178
|
return false;
|
179
179
|
}
|
180
|
-
if (try_cast != other
|
180
|
+
if (try_cast != other.try_cast) {
|
181
181
|
return false;
|
182
182
|
}
|
183
183
|
return true;
|
@@ -31,8 +31,8 @@ bool BoundColumnRefExpression::Equals(const BaseExpression *other_p) const {
|
|
31
31
|
if (!Expression::Equals(other_p)) {
|
32
32
|
return false;
|
33
33
|
}
|
34
|
-
auto other = (
|
35
|
-
return other
|
34
|
+
auto &other = other_p->Cast<BoundColumnRefExpression>();
|
35
|
+
return other.binding == binding && other.depth == depth;
|
36
36
|
}
|
37
37
|
|
38
38
|
string BoundColumnRefExpression::ToString() const {
|
@@ -18,14 +18,13 @@ bool BoundComparisonExpression::Equals(const BaseExpression *other_p) const {
|
|
18
18
|
if (!Expression::Equals(other_p)) {
|
19
19
|
return false;
|
20
20
|
}
|
21
|
-
auto other = (
|
22
|
-
if (!Expression::Equals(left.get(), other
|
21
|
+
auto &other = other_p->Cast<BoundComparisonExpression>();
|
22
|
+
if (!Expression::Equals(left.get(), other.left.get())) {
|
23
23
|
return false;
|
24
24
|
}
|
25
|
-
if (!Expression::Equals(right.get(), other
|
25
|
+
if (!Expression::Equals(right.get(), other.right.get())) {
|
26
26
|
return false;
|
27
27
|
}
|
28
|
-
|
29
28
|
return true;
|
30
29
|
}
|
31
30
|
|
@@ -24,8 +24,8 @@ bool BoundConjunctionExpression::Equals(const BaseExpression *other_p) const {
|
|
24
24
|
if (!Expression::Equals(other_p)) {
|
25
25
|
return false;
|
26
26
|
}
|
27
|
-
auto other = (
|
28
|
-
return ExpressionUtil::SetEquals(children, other
|
27
|
+
auto &other = other_p->Cast<BoundConjunctionExpression>();
|
28
|
+
return ExpressionUtil::SetEquals(children, other.children);
|
29
29
|
}
|
30
30
|
|
31
31
|
bool BoundConjunctionExpression::PropagatesNullValues() const {
|
@@ -18,8 +18,8 @@ bool BoundConstantExpression::Equals(const BaseExpression *other_p) const {
|
|
18
18
|
if (!Expression::Equals(other_p)) {
|
19
19
|
return false;
|
20
20
|
}
|
21
|
-
auto other = (
|
22
|
-
return value.type() == other
|
21
|
+
auto &other = other_p->Cast<BoundConstantExpression>();
|
22
|
+
return value.type() == other.value.type() && !ValueOperations::DistinctFrom(value, other.value);
|
23
23
|
}
|
24
24
|
|
25
25
|
hash_t BoundConstantExpression::Hash() const {
|
@@ -43,14 +43,14 @@ bool BoundFunctionExpression::Equals(const BaseExpression *other_p) const {
|
|
43
43
|
if (!Expression::Equals(other_p)) {
|
44
44
|
return false;
|
45
45
|
}
|
46
|
-
auto other = (
|
47
|
-
if (other
|
46
|
+
auto &other = other_p->Cast<BoundFunctionExpression>();
|
47
|
+
if (other.function != function) {
|
48
48
|
return false;
|
49
49
|
}
|
50
|
-
if (!ExpressionUtil::ListEquals(children, other
|
50
|
+
if (!ExpressionUtil::ListEquals(children, other.children)) {
|
51
51
|
return false;
|
52
52
|
}
|
53
|
-
if (!FunctionData::Equals(bind_info.get(), other
|
53
|
+
if (!FunctionData::Equals(bind_info.get(), other.bind_info.get())) {
|
54
54
|
return false;
|
55
55
|
}
|
56
56
|
return true;
|
@@ -18,14 +18,14 @@ bool BoundLambdaExpression::Equals(const BaseExpression *other_p) const {
|
|
18
18
|
if (!Expression::Equals(other_p)) {
|
19
19
|
return false;
|
20
20
|
}
|
21
|
-
auto other = (
|
22
|
-
if (!Expression::Equals(lambda_expr.get(), other
|
21
|
+
auto &other = other_p->Cast<BoundLambdaExpression>();
|
22
|
+
if (!Expression::Equals(lambda_expr.get(), other.lambda_expr.get())) {
|
23
23
|
return false;
|
24
24
|
}
|
25
|
-
if (!ExpressionUtil::ListEquals(captures, other
|
25
|
+
if (!ExpressionUtil::ListEquals(captures, other.captures)) {
|
26
26
|
return false;
|
27
27
|
}
|
28
|
-
if (parameter_count != other
|
28
|
+
if (parameter_count != other.parameter_count) {
|
29
29
|
return false;
|
30
30
|
}
|
31
31
|
return true;
|
@@ -34,8 +34,8 @@ bool BoundLambdaRefExpression::Equals(const BaseExpression *other_p) const {
|
|
34
34
|
if (!Expression::Equals(other_p)) {
|
35
35
|
return false;
|
36
36
|
}
|
37
|
-
auto other = (
|
38
|
-
return other
|
37
|
+
auto &other = other_p->Cast<BoundLambdaRefExpression>();
|
38
|
+
return other.binding == binding && other.lambda_index == lambda_index && other.depth == depth;
|
39
39
|
}
|
40
40
|
|
41
41
|
string BoundLambdaRefExpression::ToString() const {
|
@@ -18,8 +18,8 @@ bool BoundOperatorExpression::Equals(const BaseExpression *other_p) const {
|
|
18
18
|
if (!Expression::Equals(other_p)) {
|
19
19
|
return false;
|
20
20
|
}
|
21
|
-
auto other = (
|
22
|
-
if (!ExpressionUtil::ListEquals(children, other
|
21
|
+
auto &other = other_p->Cast<BoundOperatorExpression>();
|
22
|
+
if (!ExpressionUtil::ListEquals(children, other.children)) {
|
23
23
|
return false;
|
24
24
|
}
|
25
25
|
return true;
|
@@ -16,7 +16,7 @@ void BoundParameterExpression::Invalidate(Expression &expr) {
|
|
16
16
|
if (expr.type != ExpressionType::VALUE_PARAMETER) {
|
17
17
|
throw InternalException("BoundParameterExpression::Invalidate requires a parameter as input");
|
18
18
|
}
|
19
|
-
auto &bound_parameter = (
|
19
|
+
auto &bound_parameter = expr.Cast<BoundParameterExpression>();
|
20
20
|
bound_parameter.return_type = LogicalTypeId::SQLNULL;
|
21
21
|
bound_parameter.parameter_data->return_type = LogicalTypeId::INVALID;
|
22
22
|
}
|
@@ -47,8 +47,8 @@ bool BoundParameterExpression::Equals(const BaseExpression *other_p) const {
|
|
47
47
|
if (!Expression::Equals(other_p)) {
|
48
48
|
return false;
|
49
49
|
}
|
50
|
-
auto other = (
|
51
|
-
return parameter_nr == other
|
50
|
+
auto &other = other_p->Cast<BoundParameterExpression>();
|
51
|
+
return parameter_nr == other.parameter_nr;
|
52
52
|
}
|
53
53
|
|
54
54
|
hash_t BoundParameterExpression::Hash() const {
|
@@ -26,8 +26,8 @@ bool BoundReferenceExpression::Equals(const BaseExpression *other_p) const {
|
|
26
26
|
if (!Expression::Equals(other_p)) {
|
27
27
|
return false;
|
28
28
|
}
|
29
|
-
auto other = (
|
30
|
-
return other
|
29
|
+
auto &other = other_p->Cast<BoundReferenceExpression>();
|
30
|
+
return other.index == index;
|
31
31
|
}
|
32
32
|
|
33
33
|
hash_t BoundReferenceExpression::Hash() const {
|
@@ -27,8 +27,8 @@ bool BoundUnnestExpression::Equals(const BaseExpression *other_p) const {
|
|
27
27
|
if (!Expression::Equals(other_p)) {
|
28
28
|
return false;
|
29
29
|
}
|
30
|
-
auto other = (
|
31
|
-
if (!Expression::Equals(child.get(), other
|
30
|
+
auto &other = other_p->Cast<BoundUnnestExpression>();
|
31
|
+
if (!Expression::Equals(child.get(), other.child.get())) {
|
32
32
|
return false;
|
33
33
|
}
|
34
34
|
return true;
|
@@ -25,59 +25,59 @@ bool BoundWindowExpression::Equals(const BaseExpression *other_p) const {
|
|
25
25
|
if (!Expression::Equals(other_p)) {
|
26
26
|
return false;
|
27
27
|
}
|
28
|
-
auto other = (
|
28
|
+
auto &other = other_p->Cast<BoundWindowExpression>();
|
29
29
|
|
30
|
-
if (ignore_nulls != other
|
30
|
+
if (ignore_nulls != other.ignore_nulls) {
|
31
31
|
return false;
|
32
32
|
}
|
33
|
-
if (start != other
|
33
|
+
if (start != other.start || end != other.end) {
|
34
34
|
return false;
|
35
35
|
}
|
36
36
|
// check if the child expressions are equivalent
|
37
|
-
if (other
|
37
|
+
if (other.children.size() != children.size()) {
|
38
38
|
return false;
|
39
39
|
}
|
40
40
|
for (idx_t i = 0; i < children.size(); i++) {
|
41
|
-
if (!Expression::Equals(children[i].get(), other
|
41
|
+
if (!Expression::Equals(children[i].get(), other.children[i].get())) {
|
42
42
|
return false;
|
43
43
|
}
|
44
44
|
}
|
45
45
|
// check if the filter expressions are equivalent
|
46
|
-
if (!Expression::Equals(filter_expr.get(), other
|
46
|
+
if (!Expression::Equals(filter_expr.get(), other.filter_expr.get())) {
|
47
47
|
return false;
|
48
48
|
}
|
49
49
|
|
50
50
|
// check if the framing expressions are equivalent
|
51
|
-
if (!Expression::Equals(start_expr.get(), other
|
52
|
-
!Expression::Equals(end_expr.get(), other
|
53
|
-
!Expression::Equals(offset_expr.get(), other
|
54
|
-
!Expression::Equals(default_expr.get(), other
|
51
|
+
if (!Expression::Equals(start_expr.get(), other.start_expr.get()) ||
|
52
|
+
!Expression::Equals(end_expr.get(), other.end_expr.get()) ||
|
53
|
+
!Expression::Equals(offset_expr.get(), other.offset_expr.get()) ||
|
54
|
+
!Expression::Equals(default_expr.get(), other.default_expr.get())) {
|
55
55
|
return false;
|
56
56
|
}
|
57
57
|
|
58
58
|
return KeysAreCompatible(other);
|
59
59
|
}
|
60
60
|
|
61
|
-
bool BoundWindowExpression::KeysAreCompatible(const BoundWindowExpression
|
61
|
+
bool BoundWindowExpression::KeysAreCompatible(const BoundWindowExpression &other) const {
|
62
62
|
// check if the partitions are equivalent
|
63
|
-
if (partitions.size() != other
|
63
|
+
if (partitions.size() != other.partitions.size()) {
|
64
64
|
return false;
|
65
65
|
}
|
66
66
|
for (idx_t i = 0; i < partitions.size(); i++) {
|
67
|
-
if (!Expression::Equals(partitions[i].get(), other
|
67
|
+
if (!Expression::Equals(partitions[i].get(), other.partitions[i].get())) {
|
68
68
|
return false;
|
69
69
|
}
|
70
70
|
}
|
71
71
|
// check if the orderings are equivalent
|
72
|
-
if (orders.size() != other
|
72
|
+
if (orders.size() != other.orders.size()) {
|
73
73
|
return false;
|
74
74
|
}
|
75
75
|
for (idx_t i = 0; i < orders.size(); i++) {
|
76
|
-
if (orders[i].type != other
|
76
|
+
if (orders[i].type != other.orders[i].type) {
|
77
77
|
return false;
|
78
78
|
}
|
79
79
|
if (!BaseExpression::Equals((BaseExpression *)orders[i].expression.get(),
|
80
|
-
(BaseExpression *)other
|
80
|
+
(BaseExpression *)other.orders[i].expression.get())) {
|
81
81
|
return false;
|
82
82
|
}
|
83
83
|
}
|
@@ -20,7 +20,7 @@ BindResult AlterBinder::BindExpression(unique_ptr<ParsedExpression> *expr_ptr, i
|
|
20
20
|
case ExpressionClass::SUBQUERY:
|
21
21
|
return BindResult("cannot use subquery in alter statement");
|
22
22
|
case ExpressionClass::COLUMN_REF:
|
23
|
-
return BindColumn((
|
23
|
+
return BindColumn(expr.Cast<ColumnRefExpression>());
|
24
24
|
default:
|
25
25
|
return ExpressionBinder::BindExpression(expr_ptr, depth);
|
26
26
|
}
|
@@ -36,7 +36,7 @@ BindResult BaseSelectBinder::BindExpression(unique_ptr<ParsedExpression> *expr_p
|
|
36
36
|
case ExpressionClass::DEFAULT:
|
37
37
|
return BindResult("SELECT clause cannot contain DEFAULT clause");
|
38
38
|
case ExpressionClass::WINDOW:
|
39
|
-
return BindWindow((
|
39
|
+
return BindWindow(expr.Cast<WindowExpression>(), depth);
|
40
40
|
default:
|
41
41
|
return ExpressionBinder::BindExpression(expr_ptr, depth, root_expression);
|
42
42
|
}
|
@@ -45,7 +45,7 @@ BindResult BaseSelectBinder::BindExpression(unique_ptr<ParsedExpression> *expr_p
|
|
45
45
|
idx_t BaseSelectBinder::TryBindGroup(ParsedExpression &expr, idx_t depth) {
|
46
46
|
// first check the group alias map, if expr is a ColumnRefExpression
|
47
47
|
if (expr.type == ExpressionType::COLUMN_REF) {
|
48
|
-
auto &colref = (
|
48
|
+
auto &colref = expr.Cast<ColumnRefExpression>();
|
49
49
|
if (!colref.IsQualified()) {
|
50
50
|
auto alias_entry = info.alias_map.find(colref.column_names[0]);
|
51
51
|
if (alias_entry != info.alias_map.end()) {
|
@@ -100,7 +100,7 @@ BindResult BaseSelectBinder::BindColumnRef(unique_ptr<ParsedExpression> *expr_pt
|
|
100
100
|
}
|
101
101
|
auto result = BindResult(node.select_list[index]->Copy());
|
102
102
|
if (result.expression->type == ExpressionType::BOUND_COLUMN_REF) {
|
103
|
-
auto &result_expr =
|
103
|
+
auto &result_expr = result.expression->Cast<BoundColumnRefExpression>();
|
104
104
|
result_expr.depth = depth;
|
105
105
|
}
|
106
106
|
return result;
|
@@ -20,7 +20,7 @@ BindResult CheckBinder::BindExpression(unique_ptr<ParsedExpression> *expr_ptr, i
|
|
20
20
|
case ExpressionClass::SUBQUERY:
|
21
21
|
return BindResult("cannot use subquery in check constraint");
|
22
22
|
case ExpressionClass::COLUMN_REF:
|
23
|
-
return BindCheckColumn((
|
23
|
+
return BindCheckColumn(expr.Cast<ColumnRefExpression>());
|
24
24
|
default:
|
25
25
|
return ExpressionBinder::BindExpression(expr_ptr, depth);
|
26
26
|
}
|
@@ -1,4 +1,5 @@
|
|
1
1
|
#include "duckdb/planner/expression_binder/constant_binder.hpp"
|
2
|
+
#include "duckdb/parser/expression/columnref_expression.hpp"
|
2
3
|
|
3
4
|
namespace duckdb {
|
4
5
|
|
@@ -9,8 +10,17 @@ ConstantBinder::ConstantBinder(Binder &binder, ClientContext &context, string cl
|
|
9
10
|
BindResult ConstantBinder::BindExpression(unique_ptr<ParsedExpression> *expr_ptr, idx_t depth, bool root_expression) {
|
10
11
|
auto &expr = **expr_ptr;
|
11
12
|
switch (expr.GetExpressionClass()) {
|
12
|
-
case ExpressionClass::COLUMN_REF:
|
13
|
+
case ExpressionClass::COLUMN_REF: {
|
14
|
+
auto &colref = expr.Cast<ColumnRefExpression>();
|
15
|
+
if (!colref.IsQualified()) {
|
16
|
+
auto value_function = GetSQLValueFunction(colref.GetColumnName());
|
17
|
+
if (value_function) {
|
18
|
+
*expr_ptr = std::move(value_function);
|
19
|
+
return BindExpression(expr_ptr, depth, root_expression);
|
20
|
+
}
|
21
|
+
}
|
13
22
|
return BindResult(clause + " cannot contain column names");
|
23
|
+
}
|
14
24
|
case ExpressionClass::SUBQUERY:
|
15
25
|
throw BinderException(clause + " cannot contain subqueries");
|
16
26
|
case ExpressionClass::DEFAULT:
|
@@ -19,9 +19,9 @@ BindResult GroupBinder::BindExpression(unique_ptr<ParsedExpression> *expr_ptr, i
|
|
19
19
|
if (root_expression && depth == 0) {
|
20
20
|
switch (expr.expression_class) {
|
21
21
|
case ExpressionClass::COLUMN_REF:
|
22
|
-
return BindColumnRef((
|
22
|
+
return BindColumnRef(expr.Cast<ColumnRefExpression>());
|
23
23
|
case ExpressionClass::CONSTANT:
|
24
|
-
return BindConstant((
|
24
|
+
return BindConstant(expr.Cast<ConstantExpression>());
|
25
25
|
case ExpressionClass::PARAMETER:
|
26
26
|
throw ParameterNotAllowedException("Parameter not supported in GROUP BY clause");
|
27
27
|
default:
|