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
@@ -115,6 +115,8 @@ void Binder::BindModifiers(OrderBinder &order_binder, QueryNode &statement, Boun
|
|
115
115
|
case ResultModifierType::DISTINCT_MODIFIER: {
|
116
116
|
auto &distinct = (DistinctModifier &)*mod;
|
117
117
|
auto bound_distinct = make_uniq<BoundDistinctModifier>();
|
118
|
+
bound_distinct->distinct_type =
|
119
|
+
distinct.distinct_on_targets.empty() ? DistinctType::DISTINCT : DistinctType::DISTINCT_ON;
|
118
120
|
if (distinct.distinct_on_targets.empty()) {
|
119
121
|
for (idx_t i = 0; i < result.names.size(); i++) {
|
120
122
|
distinct.distinct_on_targets.push_back(make_uniq<ConstantExpression>(Value::INTEGER(1 + i)));
|
@@ -137,8 +139,8 @@ void Binder::BindModifiers(OrderBinder &order_binder, QueryNode &statement, Boun
|
|
137
139
|
D_ASSERT(!order.orders.empty());
|
138
140
|
auto &order_binders = order_binder.GetBinders();
|
139
141
|
if (order.orders.size() == 1 && order.orders[0].expression->type == ExpressionType::STAR) {
|
140
|
-
auto star =
|
141
|
-
if (star
|
142
|
+
auto &star = order.orders[0].expression->Cast<StarExpression>();
|
143
|
+
if (star.exclude_list.empty() && star.replace_list.empty() && !star.expr) {
|
142
144
|
// ORDER BY ALL
|
143
145
|
// replace the order list with the all elements in the SELECT list
|
144
146
|
auto order_type = order.orders[0].type;
|
@@ -189,15 +191,14 @@ void Binder::BindModifiers(OrderBinder &order_binder, QueryNode &statement, Boun
|
|
189
191
|
}
|
190
192
|
}
|
191
193
|
|
192
|
-
static void AssignReturnType(unique_ptr<Expression> &expr, const vector<LogicalType> &sql_types
|
193
|
-
idx_t projection_index) {
|
194
|
+
static void AssignReturnType(unique_ptr<Expression> &expr, const vector<LogicalType> &sql_types) {
|
194
195
|
if (!expr) {
|
195
196
|
return;
|
196
197
|
}
|
197
198
|
if (expr->type != ExpressionType::BOUND_COLUMN_REF) {
|
198
199
|
return;
|
199
200
|
}
|
200
|
-
auto &bound_colref = (
|
201
|
+
auto &bound_colref = expr->Cast<BoundColumnRefExpression>();
|
201
202
|
bound_colref.return_type = sql_types[bound_colref.binding.column_index];
|
202
203
|
}
|
203
204
|
|
@@ -206,26 +207,19 @@ void Binder::BindModifierTypes(BoundQueryNode &result, const vector<LogicalType>
|
|
206
207
|
switch (bound_mod->type) {
|
207
208
|
case ResultModifierType::DISTINCT_MODIFIER: {
|
208
209
|
auto &distinct = (BoundDistinctModifier &)*bound_mod;
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
// DISTINCT with target list: set types
|
217
|
-
for (auto &expr : distinct.target_distincts) {
|
218
|
-
D_ASSERT(expr->type == ExpressionType::BOUND_COLUMN_REF);
|
219
|
-
auto &bound_colref = (BoundColumnRefExpression &)*expr;
|
220
|
-
if (bound_colref.binding.column_index == DConstants::INVALID_INDEX) {
|
221
|
-
throw BinderException("Ambiguous name in DISTINCT ON!");
|
222
|
-
}
|
223
|
-
D_ASSERT(bound_colref.binding.column_index < sql_types.size());
|
224
|
-
bound_colref.return_type = sql_types[bound_colref.binding.column_index];
|
210
|
+
D_ASSERT(!distinct.target_distincts.empty());
|
211
|
+
// set types of distinct targets
|
212
|
+
for (auto &expr : distinct.target_distincts) {
|
213
|
+
D_ASSERT(expr->type == ExpressionType::BOUND_COLUMN_REF);
|
214
|
+
auto &bound_colref = expr->Cast<BoundColumnRefExpression>();
|
215
|
+
if (bound_colref.binding.column_index == DConstants::INVALID_INDEX) {
|
216
|
+
throw BinderException("Ambiguous name in DISTINCT ON!");
|
225
217
|
}
|
218
|
+
D_ASSERT(bound_colref.binding.column_index < sql_types.size());
|
219
|
+
bound_colref.return_type = sql_types[bound_colref.binding.column_index];
|
226
220
|
}
|
227
221
|
for (auto &target_distinct : distinct.target_distincts) {
|
228
|
-
auto &bound_colref = (
|
222
|
+
auto &bound_colref = target_distinct->Cast<BoundColumnRefExpression>();
|
229
223
|
const auto &sql_type = sql_types[bound_colref.binding.column_index];
|
230
224
|
if (sql_type.id() == LogicalTypeId::VARCHAR) {
|
231
225
|
target_distinct = ExpressionBinder::PushCollation(context, std::move(target_distinct),
|
@@ -236,14 +230,14 @@ void Binder::BindModifierTypes(BoundQueryNode &result, const vector<LogicalType>
|
|
236
230
|
}
|
237
231
|
case ResultModifierType::LIMIT_MODIFIER: {
|
238
232
|
auto &limit = (BoundLimitModifier &)*bound_mod;
|
239
|
-
AssignReturnType(limit.limit, sql_types
|
240
|
-
AssignReturnType(limit.offset, sql_types
|
233
|
+
AssignReturnType(limit.limit, sql_types);
|
234
|
+
AssignReturnType(limit.offset, sql_types);
|
241
235
|
break;
|
242
236
|
}
|
243
237
|
case ResultModifierType::LIMIT_PERCENT_MODIFIER: {
|
244
238
|
auto &limit = (BoundLimitPercentModifier &)*bound_mod;
|
245
|
-
AssignReturnType(limit.limit, sql_types
|
246
|
-
AssignReturnType(limit.offset, sql_types
|
239
|
+
AssignReturnType(limit.limit, sql_types);
|
240
|
+
AssignReturnType(limit.offset, sql_types);
|
247
241
|
break;
|
248
242
|
}
|
249
243
|
case ResultModifierType::ORDER_MODIFIER: {
|
@@ -251,7 +245,7 @@ void Binder::BindModifierTypes(BoundQueryNode &result, const vector<LogicalType>
|
|
251
245
|
for (auto &order_node : order.orders) {
|
252
246
|
auto &expr = order_node.expression;
|
253
247
|
D_ASSERT(expr->type == ExpressionType::BOUND_COLUMN_REF);
|
254
|
-
auto &bound_colref = (
|
248
|
+
auto &bound_colref = expr->Cast<BoundColumnRefExpression>();
|
255
249
|
if (bound_colref.binding.column_index == DConstants::INVALID_INDEX) {
|
256
250
|
throw BinderException("Ambiguous name in ORDER BY!");
|
257
251
|
}
|
@@ -282,14 +276,14 @@ unique_ptr<BoundQueryNode> Binder::BindNode(SelectNode &statement) {
|
|
282
276
|
void Binder::BindWhereStarExpression(unique_ptr<ParsedExpression> &expr) {
|
283
277
|
// expand any expressions in the upper AND recursively
|
284
278
|
if (expr->type == ExpressionType::CONJUNCTION_AND) {
|
285
|
-
auto &conj = (
|
279
|
+
auto &conj = expr->Cast<ConjunctionExpression>();
|
286
280
|
for (auto &child : conj.children) {
|
287
281
|
BindWhereStarExpression(child);
|
288
282
|
}
|
289
283
|
return;
|
290
284
|
}
|
291
285
|
if (expr->type == ExpressionType::STAR) {
|
292
|
-
auto &star = (
|
286
|
+
auto &star = expr->Cast<StarExpression>();
|
293
287
|
if (!star.columns) {
|
294
288
|
throw ParserException("STAR expression is not allowed in the WHERE clause. Use COLUMNS(*) instead.");
|
295
289
|
}
|
@@ -16,7 +16,7 @@ static void GatherAliases(BoundQueryNode &node, case_insensitive_map_t<idx_t> &a
|
|
16
16
|
expression_map_t<idx_t> &expressions, const vector<idx_t> &reorder_idx) {
|
17
17
|
if (node.type == QueryNodeType::SET_OPERATION_NODE) {
|
18
18
|
// setop, recurse
|
19
|
-
auto &setop = (
|
19
|
+
auto &setop = node.Cast<BoundSetOperationNode>();
|
20
20
|
|
21
21
|
// create new reorder index
|
22
22
|
if (setop.setop_type == SetOperationType::UNION_BY_NAME) {
|
@@ -41,7 +41,7 @@ static void GatherAliases(BoundQueryNode &node, case_insensitive_map_t<idx_t> &a
|
|
41
41
|
} else {
|
42
42
|
// query node
|
43
43
|
D_ASSERT(node.type == QueryNodeType::SELECT_NODE);
|
44
|
-
auto &select = (
|
44
|
+
auto &select = node.Cast<BoundSelectNode>();
|
45
45
|
// fill the alias lists
|
46
46
|
for (idx_t i = 0; i < select.names.size(); i++) {
|
47
47
|
auto &name = select.names[i];
|
@@ -41,7 +41,7 @@ unique_ptr<QueryNode> Binder::BindTableMacro(FunctionExpression &function, Table
|
|
41
41
|
// positional parameters
|
42
42
|
for (idx_t i = 0; i < macro_def.parameters.size(); i++) {
|
43
43
|
types.emplace_back(LogicalType::SQLNULL);
|
44
|
-
auto ¶m =
|
44
|
+
auto ¶m = macro_def.parameters[i]->Cast<ColumnRefExpression>();
|
45
45
|
names.push_back(param.GetColumnName());
|
46
46
|
}
|
47
47
|
// default parameters
|
@@ -14,7 +14,7 @@ unique_ptr<LogicalOperator> Binder::VisitQueryNode(BoundQueryNode &node, unique_
|
|
14
14
|
switch (mod->type) {
|
15
15
|
case ResultModifierType::DISTINCT_MODIFIER: {
|
16
16
|
auto &bound = (BoundDistinctModifier &)*mod;
|
17
|
-
auto distinct = make_uniq<LogicalDistinct>(std::move(bound.target_distincts));
|
17
|
+
auto distinct = make_uniq<LogicalDistinct>(std::move(bound.target_distincts), bound.distinct_type);
|
18
18
|
distinct->AddChild(std::move(root));
|
19
19
|
root = std::move(distinct);
|
20
20
|
break;
|
@@ -22,8 +22,8 @@ unique_ptr<LogicalOperator> Binder::VisitQueryNode(BoundQueryNode &node, unique_
|
|
22
22
|
case ResultModifierType::ORDER_MODIFIER: {
|
23
23
|
auto &bound = (BoundOrderModifier &)*mod;
|
24
24
|
if (root->type == LogicalOperatorType::LOGICAL_DISTINCT) {
|
25
|
-
auto &distinct = (
|
26
|
-
if (
|
25
|
+
auto &distinct = root->Cast<LogicalDistinct>();
|
26
|
+
if (distinct.distinct_type == DistinctType::DISTINCT_ON) {
|
27
27
|
auto order_by = make_uniq<BoundOrderModifier>();
|
28
28
|
for (auto &order_node : bound.orders) {
|
29
29
|
order_by->orders.push_back(order_node.Copy());
|
@@ -30,9 +30,8 @@ unique_ptr<LogicalOperator> Binder::CreatePlan(BoundRecursiveCTENode &node) {
|
|
30
30
|
std::move(right_node), LogicalOperatorType::LOGICAL_UNION);
|
31
31
|
return VisitQueryNode(node, std::move(root));
|
32
32
|
}
|
33
|
-
auto root =
|
34
|
-
|
35
|
-
std::move(right_node), LogicalOperatorType::LOGICAL_RECURSIVE_CTE);
|
33
|
+
auto root = make_uniq<LogicalRecursiveCTE>(node.setop_index, node.types.size(), node.union_all,
|
34
|
+
std::move(left_node), std::move(right_node));
|
36
35
|
|
37
36
|
return VisitQueryNode(node, std::move(root));
|
38
37
|
}
|
@@ -3,9 +3,7 @@
|
|
3
3
|
#include "duckdb/planner/expression/bound_reference_expression.hpp"
|
4
4
|
#include "duckdb/planner/operator/list.hpp"
|
5
5
|
#include "duckdb/planner/operator/logical_dummy_scan.hpp"
|
6
|
-
#include "duckdb/planner/operator/logical_expression_get.hpp"
|
7
6
|
#include "duckdb/planner/operator/logical_limit.hpp"
|
8
|
-
#include "duckdb/planner/operator/logical_limit_percent.hpp"
|
9
7
|
#include "duckdb/planner/query_node/bound_select_node.hpp"
|
10
8
|
|
11
9
|
namespace duckdb {
|
@@ -389,7 +389,7 @@ void Binder::PlanSubqueries(unique_ptr<Expression> *expr_ptr, unique_ptr<Logical
|
|
389
389
|
|
390
390
|
// check if this is a subquery node
|
391
391
|
if (expr.expression_class == ExpressionClass::BOUND_SUBQUERY) {
|
392
|
-
auto &subquery = (
|
392
|
+
auto &subquery = expr.Cast<BoundSubqueryExpression>();
|
393
393
|
// subquery node! plan it
|
394
394
|
if (subquery.IsCorrelated() && !plan_subquery) {
|
395
395
|
// detected a nested correlated subquery
|
@@ -13,8 +13,9 @@ BoundStatement Binder::Bind(CallStatement &stmt) {
|
|
13
13
|
ref.function = std::move(stmt.function);
|
14
14
|
|
15
15
|
auto bound_func = Bind(ref);
|
16
|
-
auto &bound_table_func = (
|
17
|
-
|
16
|
+
auto &bound_table_func = bound_func->Cast<BoundTableFunction>();
|
17
|
+
;
|
18
|
+
auto &get = bound_table_func.get->Cast<LogicalGet>();
|
18
19
|
D_ASSERT(get.returned_types.size() > 0);
|
19
20
|
for (idx_t i = 0; i < get.returned_types.size(); i++) {
|
20
21
|
get.column_ids.push_back(i);
|
@@ -173,7 +173,7 @@ BoundStatement Binder::BindCopyFrom(CopyStatement &stmt) {
|
|
173
173
|
auto insert_statement = Bind(insert);
|
174
174
|
D_ASSERT(insert_statement.plan->type == LogicalOperatorType::LOGICAL_INSERT);
|
175
175
|
|
176
|
-
auto &bound_insert =
|
176
|
+
auto &bound_insert = insert_statement.plan->Cast<LogicalInsert>();
|
177
177
|
|
178
178
|
// lookup the format in the catalog
|
179
179
|
auto &catalog = Catalog::GetSystemCatalog(context);
|
@@ -135,7 +135,7 @@ void Binder::BindCreateViewInfo(CreateViewInfo &base) {
|
|
135
135
|
static void QualifyFunctionNames(ClientContext &context, unique_ptr<ParsedExpression> &expr) {
|
136
136
|
switch (expr->GetExpressionClass()) {
|
137
137
|
case ExpressionClass::FUNCTION: {
|
138
|
-
auto &func = (
|
138
|
+
auto &func = expr->Cast<FunctionExpression>();
|
139
139
|
auto function = (StandardEntry *)Catalog::GetEntry(context, CatalogType::SCALAR_FUNCTION_ENTRY, func.catalog,
|
140
140
|
func.schema, func.function_name, true);
|
141
141
|
if (function) {
|
@@ -146,7 +146,7 @@ static void QualifyFunctionNames(ClientContext &context, unique_ptr<ParsedExpres
|
|
146
146
|
}
|
147
147
|
case ExpressionClass::SUBQUERY: {
|
148
148
|
// replacing parameters within a subquery is slightly different
|
149
|
-
auto &sq = ((
|
149
|
+
auto &sq = (expr->Cast<SubqueryExpression>()).subquery;
|
150
150
|
ParsedExpressionIterator::EnumerateQueryNodeChildren(
|
151
151
|
*sq->node, [&](unique_ptr<ParsedExpression> &child) { QualifyFunctionNames(context, child); });
|
152
152
|
break;
|
@@ -172,7 +172,7 @@ SchemaCatalogEntry *Binder::BindCreateFunctionInfo(CreateInfo &info) {
|
|
172
172
|
vector<string> dummy_names;
|
173
173
|
// positional parameters
|
174
174
|
for (idx_t i = 0; i < base.function->parameters.size(); i++) {
|
175
|
-
auto param =
|
175
|
+
auto param = base.function->parameters[i]->Cast<ColumnRefExpression>();
|
176
176
|
if (param.IsQualified()) {
|
177
177
|
throw BinderException("Invalid parameter name '%s': must be unqualified", param.ToString());
|
178
178
|
}
|
@@ -181,7 +181,7 @@ SchemaCatalogEntry *Binder::BindCreateFunctionInfo(CreateInfo &info) {
|
|
181
181
|
}
|
182
182
|
// default parameters
|
183
183
|
for (auto it = base.function->default_parameters.begin(); it != base.function->default_parameters.end(); it++) {
|
184
|
-
auto &val =
|
184
|
+
auto &val = it->second->Cast<ConstantExpression>();
|
185
185
|
dummy_types.push_back(val.value.type());
|
186
186
|
dummy_names.push_back(it->first);
|
187
187
|
}
|
@@ -278,7 +278,7 @@ static void FindMatchingPrimaryKeyColumns(const ColumnList &columns, const vecto
|
|
278
278
|
if (constr->type != ConstraintType::UNIQUE) {
|
279
279
|
continue;
|
280
280
|
}
|
281
|
-
auto &unique = (
|
281
|
+
auto &unique = constr->Cast<UniqueConstraint>();
|
282
282
|
if (find_primary_key && !unique.is_primary_key) {
|
283
283
|
continue;
|
284
284
|
}
|
@@ -364,7 +364,7 @@ void ExpressionContainsGeneratedColumn(const ParsedExpression &expr, const unord
|
|
364
364
|
return;
|
365
365
|
}
|
366
366
|
if (expr.type == ExpressionType::COLUMN_REF) {
|
367
|
-
auto &column_ref = (
|
367
|
+
auto &column_ref = expr.Cast<ColumnRefExpression>();
|
368
368
|
auto &name = column_ref.GetColumnName();
|
369
369
|
if (gcols.count(name)) {
|
370
370
|
contains_gcol = true;
|
@@ -390,7 +390,7 @@ static bool AnyConstraintReferencesGeneratedColumn(CreateTableInfo &table_info)
|
|
390
390
|
for (auto &constr : table_info.constraints) {
|
391
391
|
switch (constr->type) {
|
392
392
|
case ConstraintType::CHECK: {
|
393
|
-
auto &constraint = (
|
393
|
+
auto &constraint = constr->Cast<CheckConstraint>();
|
394
394
|
auto &expr = constraint.expression;
|
395
395
|
bool contains_generated_column = false;
|
396
396
|
ExpressionContainsGeneratedColumn(*expr, generated_columns, contains_generated_column);
|
@@ -400,14 +400,14 @@ static bool AnyConstraintReferencesGeneratedColumn(CreateTableInfo &table_info)
|
|
400
400
|
break;
|
401
401
|
}
|
402
402
|
case ConstraintType::NOT_NULL: {
|
403
|
-
auto &constraint = (
|
403
|
+
auto &constraint = constr->Cast<NotNullConstraint>();
|
404
404
|
if (table_info.columns.GetColumn(constraint.index).Generated()) {
|
405
405
|
return true;
|
406
406
|
}
|
407
407
|
break;
|
408
408
|
}
|
409
409
|
case ConstraintType::UNIQUE: {
|
410
|
-
auto &constraint = (
|
410
|
+
auto &constraint = constr->Cast<UniqueConstraint>();
|
411
411
|
auto index = constraint.index;
|
412
412
|
if (index.index == DConstants::INVALID_INDEX) {
|
413
413
|
for (auto &col : constraint.columns) {
|
@@ -439,7 +439,7 @@ unique_ptr<LogicalOperator> DuckCatalog::BindCreateIndex(Binder &binder, CreateS
|
|
439
439
|
D_ASSERT(plan->type == LogicalOperatorType::LOGICAL_GET);
|
440
440
|
auto &base = (CreateIndexInfo &)*stmt.info;
|
441
441
|
|
442
|
-
auto &get = (
|
442
|
+
auto &get = plan->Cast<LogicalGet>();
|
443
443
|
// bind the index expressions
|
444
444
|
IndexBinder index_binder(binder, binder.context);
|
445
445
|
vector<unique_ptr<Expression>> expressions;
|
@@ -506,7 +506,8 @@ BoundStatement Binder::Bind(CreateStatement &stmt) {
|
|
506
506
|
if (bound_table->type != TableReferenceType::BASE_TABLE) {
|
507
507
|
throw BinderException("Can only create an index over a base table!");
|
508
508
|
}
|
509
|
-
auto &table_binding = (
|
509
|
+
auto &table_binding = bound_table->Cast<BoundBaseTableRef>();
|
510
|
+
;
|
510
511
|
auto table = table_binding.table;
|
511
512
|
if (table->temporary) {
|
512
513
|
stmt.info->temporary = true;
|
@@ -529,7 +530,7 @@ BoundStatement Binder::Bind(CreateStatement &stmt) {
|
|
529
530
|
if (cond->type != ConstraintType::FOREIGN_KEY) {
|
530
531
|
continue;
|
531
532
|
}
|
532
|
-
auto &fk = (
|
533
|
+
auto &fk = cond->Cast<ForeignKeyConstraint>();
|
533
534
|
if (fk.info.type != ForeignKeyType::FK_TYPE_FOREIGN_KEY_TABLE) {
|
534
535
|
continue;
|
535
536
|
}
|
@@ -593,7 +594,7 @@ BoundStatement Binder::Bind(CreateStatement &stmt) {
|
|
593
594
|
result.plan = make_uniq<LogicalCreate>(LogicalOperatorType::LOGICAL_CREATE_TYPE, std::move(stmt.info), schema);
|
594
595
|
if (create_type_info.query) {
|
595
596
|
// CREATE TYPE mood AS ENUM (SELECT 'happy')
|
596
|
-
auto &select_stmt =
|
597
|
+
auto &select_stmt = create_type_info.query->Cast<SelectStatement>();
|
597
598
|
auto &query_node = *select_stmt.node;
|
598
599
|
|
599
600
|
// We always add distinct modifier implicitly
|
@@ -605,15 +606,15 @@ BoundStatement Binder::Bind(CreateStatement &stmt) {
|
|
605
606
|
// When we push into a constant expression
|
606
607
|
// => CREATE TYPE mood AS ENUM (SELECT DISTINCT ON(x, x) x FROM test);
|
607
608
|
auto &distinct_modifier = (DistinctModifier &)*query_node.modifiers[0];
|
608
|
-
distinct_modifier.distinct_on_targets.
|
609
|
-
|
609
|
+
if (distinct_modifier.distinct_on_targets.empty()) {
|
610
|
+
need_to_add = false;
|
611
|
+
}
|
610
612
|
}
|
611
613
|
}
|
612
614
|
|
613
615
|
// Add distinct modifier
|
614
616
|
if (need_to_add) {
|
615
617
|
auto distinct_modifier = make_uniq<DistinctModifier>();
|
616
|
-
distinct_modifier->distinct_on_targets.push_back(make_uniq<ConstantExpression>(Value::INTEGER(1)));
|
617
618
|
query_node.modifiers.emplace(query_node.modifiers.begin(), std::move(distinct_modifier));
|
618
619
|
}
|
619
620
|
|
@@ -40,7 +40,8 @@ static void BindCheckConstraint(Binder &binder, BoundCreateTableInfo &info, cons
|
|
40
40
|
auto bound_constraint = make_uniq<BoundCheckConstraint>();
|
41
41
|
// check constraint: bind the expression
|
42
42
|
CheckBinder check_binder(binder, binder.context, base.table, base.columns, bound_constraint->bound_columns);
|
43
|
-
auto &check = (
|
43
|
+
auto &check = cond->Cast<CheckConstraint>();
|
44
|
+
;
|
44
45
|
// create a copy of the unbound expression because the binding destroys the constraint
|
45
46
|
auto unbound_expression = check.expression->Copy();
|
46
47
|
// now bind the constraint and create a new BoundCheckConstraint
|
@@ -64,14 +65,14 @@ static void BindConstraints(Binder &binder, BoundCreateTableInfo &info) {
|
|
64
65
|
break;
|
65
66
|
}
|
66
67
|
case ConstraintType::NOT_NULL: {
|
67
|
-
auto ¬_null = (
|
68
|
+
auto ¬_null = cond->Cast<NotNullConstraint>();
|
68
69
|
auto &col = base.columns.GetColumn(LogicalIndex(not_null.index));
|
69
70
|
info.bound_constraints.push_back(make_uniq<BoundNotNullConstraint>(PhysicalIndex(col.StorageOid())));
|
70
71
|
not_null_columns.insert(not_null.index);
|
71
72
|
break;
|
72
73
|
}
|
73
74
|
case ConstraintType::UNIQUE: {
|
74
|
-
auto &unique = (
|
75
|
+
auto &unique = cond->Cast<UniqueConstraint>();
|
75
76
|
// have to resolve columns of the unique constraint
|
76
77
|
vector<LogicalIndex> keys;
|
77
78
|
logical_index_set_t key_set;
|
@@ -114,7 +115,7 @@ static void BindConstraints(Binder &binder, BoundCreateTableInfo &info) {
|
|
114
115
|
break;
|
115
116
|
}
|
116
117
|
case ConstraintType::FOREIGN_KEY: {
|
117
|
-
auto &fk = (
|
118
|
+
auto &fk = cond->Cast<ForeignKeyConstraint>();
|
118
119
|
D_ASSERT((fk.info.type == ForeignKeyType::FK_TYPE_FOREIGN_KEY_TABLE && !fk.info.pk_keys.empty()) ||
|
119
120
|
(fk.info.type == ForeignKeyType::FK_TYPE_PRIMARY_KEY_TABLE && !fk.info.pk_keys.empty()) ||
|
120
121
|
fk.info.type == ForeignKeyType::FK_TYPE_SELF_REFERENCE_TABLE);
|
@@ -228,7 +229,7 @@ void Binder::BindDefaultValues(const ColumnList &columns, vector<unique_ptr<Expr
|
|
228
229
|
|
229
230
|
static void ExtractExpressionDependencies(Expression &expr, DependencyList &dependencies) {
|
230
231
|
if (expr.type == ExpressionType::BOUND_FUNCTION) {
|
231
|
-
auto &function = (
|
232
|
+
auto &function = expr.Cast<BoundFunctionExpression>();
|
232
233
|
if (function.function.dependency) {
|
233
234
|
function.function.dependency(function, dependencies);
|
234
235
|
}
|
@@ -245,7 +246,7 @@ static void ExtractDependencies(BoundCreateTableInfo &info) {
|
|
245
246
|
}
|
246
247
|
for (auto &constraint : info.bound_constraints) {
|
247
248
|
if (constraint->type == ConstraintType::CHECK) {
|
248
|
-
auto &bound_check = (
|
249
|
+
auto &bound_check = constraint->Cast<BoundCheckConstraint>();
|
249
250
|
ExtractExpressionDependencies(*bound_check.expression, info.dependencies);
|
250
251
|
}
|
251
252
|
}
|
@@ -20,11 +20,12 @@ BoundStatement Binder::Bind(DeleteStatement &stmt) {
|
|
20
20
|
if (bound_table->type != TableReferenceType::BASE_TABLE) {
|
21
21
|
throw BinderException("Can only delete from base table!");
|
22
22
|
}
|
23
|
-
auto &table_binding = (
|
23
|
+
auto &table_binding = bound_table->Cast<BoundBaseTableRef>();
|
24
|
+
;
|
24
25
|
auto table = table_binding.table;
|
25
26
|
|
26
27
|
auto root = CreatePlan(*bound_table);
|
27
|
-
auto &get = (
|
28
|
+
auto &get = root->Cast<LogicalGet>();
|
28
29
|
D_ASSERT(root->type == LogicalOperatorType::LOGICAL_GET);
|
29
30
|
|
30
31
|
if (!table->temporary) {
|
@@ -59,7 +59,7 @@ void ScanForeignKeyTable(vector<TableCatalogEntry *> &ordered, vector<TableCatal
|
|
59
59
|
for (idx_t j = 0; j < constraints.size(); j++) {
|
60
60
|
auto &cond = constraints[j];
|
61
61
|
if (cond->type == ConstraintType::FOREIGN_KEY) {
|
62
|
-
auto &fk = (
|
62
|
+
auto &fk = cond->Cast<ForeignKeyConstraint>();
|
63
63
|
if ((move_only_pk_table && fk.info.type == ForeignKeyType::FK_TYPE_FOREIGN_KEY_TABLE) ||
|
64
64
|
(!move_only_pk_table && fk.info.type == ForeignKeyType::FK_TYPE_FOREIGN_KEY_TABLE &&
|
65
65
|
IsExistMainKeyTable(fk.info.table, unordered))) {
|
@@ -19,7 +19,7 @@ BoundStatement Binder::Bind(ExtensionStatement &stmt) {
|
|
19
19
|
// create the plan as a scan of the given table function
|
20
20
|
result.plan = BindTableFunction(parse_result.function, std::move(parse_result.parameters));
|
21
21
|
D_ASSERT(result.plan->type == LogicalOperatorType::LOGICAL_GET);
|
22
|
-
auto &get =
|
22
|
+
auto &get = result.plan->Cast<LogicalGet>();
|
23
23
|
result.names = get.names;
|
24
24
|
result.types = get.returned_types;
|
25
25
|
get.column_ids.clear();
|
@@ -54,7 +54,7 @@ void ReplaceDefaultExpression(unique_ptr<ParsedExpression> &expr, const ColumnDe
|
|
54
54
|
void QualifyColumnReferences(unique_ptr<ParsedExpression> &expr, const string &table_name) {
|
55
55
|
// To avoid ambiguity with 'excluded', we explicitly qualify all column references
|
56
56
|
if (expr->type == ExpressionType::COLUMN_REF) {
|
57
|
-
auto &column_ref = (
|
57
|
+
auto &column_ref = expr->Cast<ColumnRefExpression>();
|
58
58
|
if (column_ref.IsQualified()) {
|
59
59
|
return;
|
60
60
|
}
|
@@ -68,7 +68,7 @@ void QualifyColumnReferences(unique_ptr<ParsedExpression> &expr, const string &t
|
|
68
68
|
// Replace binding.table_index with 'dest' if it's 'source'
|
69
69
|
void ReplaceColumnBindings(Expression &expr, idx_t source, idx_t dest) {
|
70
70
|
if (expr.type == ExpressionType::BOUND_COLUMN_REF) {
|
71
|
-
auto &bound_columnref = (
|
71
|
+
auto &bound_columnref = expr.Cast<BoundColumnRefExpression>();
|
72
72
|
if (bound_columnref.binding.table_index == source) {
|
73
73
|
bound_columnref.binding.table_index = dest;
|
74
74
|
}
|
@@ -200,7 +200,7 @@ void Binder::BindOnConflictClause(LogicalInsert &insert, TableCatalogEntry &tabl
|
|
200
200
|
throw BinderException("Can only update base table!");
|
201
201
|
}
|
202
202
|
|
203
|
-
auto &table_ref =
|
203
|
+
auto &table_ref = stmt.table_ref->Cast<BaseTableRef>();
|
204
204
|
const string &table_alias = !table_ref.alias.empty() ? table_ref.alias : table_ref.table_name;
|
205
205
|
|
206
206
|
auto &on_conflict = *stmt.on_conflict_info;
|
@@ -460,7 +460,7 @@ BoundStatement Binder::Bind(InsertStatement &stmt) {
|
|
460
460
|
// special case: check if we are inserting from a VALUES statement
|
461
461
|
auto values_list = stmt.GetValuesList();
|
462
462
|
if (values_list) {
|
463
|
-
auto &expr_list = (
|
463
|
+
auto &expr_list = values_list->Cast<ExpressionListRef>();
|
464
464
|
expr_list.expected_types.resize(expected_columns);
|
465
465
|
expr_list.expected_names.resize(expected_columns);
|
466
466
|
|
@@ -29,11 +29,11 @@ BoundStatement Binder::Bind(ResetVariableStatement &stmt) {
|
|
29
29
|
BoundStatement Binder::Bind(SetStatement &stmt) {
|
30
30
|
switch (stmt.set_type) {
|
31
31
|
case SetType::SET: {
|
32
|
-
auto &set_stmt = (
|
32
|
+
auto &set_stmt = stmt.Cast<SetVariableStatement>();
|
33
33
|
return Bind(set_stmt);
|
34
34
|
}
|
35
35
|
case SetType::RESET: {
|
36
|
-
auto &set_stmt = (
|
36
|
+
auto &set_stmt = stmt.Cast<ResetVariableStatement>();
|
37
37
|
return Bind(set_stmt);
|
38
38
|
}
|
39
39
|
default:
|
@@ -188,7 +188,8 @@ BoundStatement Binder::Bind(UpdateStatement &stmt) {
|
|
188
188
|
if (bound_table->type != TableReferenceType::BASE_TABLE) {
|
189
189
|
throw BinderException("Can only update base table!");
|
190
190
|
}
|
191
|
-
auto &table_binding = (
|
191
|
+
auto &table_binding = bound_table->Cast<BoundBaseTableRef>();
|
192
|
+
;
|
192
193
|
auto table = table_binding.table;
|
193
194
|
|
194
195
|
// Add CTEs as bindable
|
@@ -27,7 +27,7 @@ BoundStatement Binder::Bind(VacuumStatement &stmt) {
|
|
27
27
|
vector<unique_ptr<Expression>> select_list;
|
28
28
|
if (columns.empty()) {
|
29
29
|
// Empty means ALL columns should be vacuumed/analyzed
|
30
|
-
auto &get =
|
30
|
+
auto &get = ref->get->Cast<LogicalGet>();
|
31
31
|
columns.insert(columns.end(), get.names.begin(), get.names.end());
|
32
32
|
}
|
33
33
|
|
@@ -59,7 +59,7 @@ BoundStatement Binder::Bind(VacuumStatement &stmt) {
|
|
59
59
|
auto table_scan = CreatePlan(*ref);
|
60
60
|
D_ASSERT(table_scan->type == LogicalOperatorType::LOGICAL_GET);
|
61
61
|
|
62
|
-
auto &get = (
|
62
|
+
auto &get = table_scan->Cast<LogicalGet>();
|
63
63
|
|
64
64
|
D_ASSERT(select_list.size() == get.column_ids.size());
|
65
65
|
D_ASSERT(stmt.info->columns.size() == get.column_ids.size());
|
@@ -80,11 +80,11 @@ unique_ptr<BoundTableRef> Binder::Bind(BaseTableRef &ref) {
|
|
80
80
|
if (replacement_function) {
|
81
81
|
replacement_function->alias = ref.alias.empty() ? ref.table_name : ref.alias;
|
82
82
|
if (replacement_function->type == TableReferenceType::TABLE_FUNCTION) {
|
83
|
-
auto &table_function = (
|
83
|
+
auto &table_function = replacement_function->Cast<TableFunctionRef>();
|
84
84
|
table_function.column_name_alias = ref.column_name_alias;
|
85
85
|
;
|
86
86
|
} else if (replacement_function->type == TableReferenceType::SUBQUERY) {
|
87
|
-
auto &subquery = (
|
87
|
+
auto &subquery = replacement_function->Cast<SubqueryRef>();
|
88
88
|
subquery.column_name_alias = ref.column_name_alias;
|
89
89
|
} else {
|
90
90
|
throw InternalException("Replacement scan should return either a table function or a subquery");
|
@@ -163,7 +163,8 @@ unique_ptr<BoundTableRef> Binder::Bind(BaseTableRef &ref) {
|
|
163
163
|
|
164
164
|
D_ASSERT(bound_child->type == TableReferenceType::SUBQUERY);
|
165
165
|
// verify that the types and names match up with the expected types and names
|
166
|
-
auto &bound_subquery = (
|
166
|
+
auto &bound_subquery = bound_child->Cast<BoundSubqueryRef>();
|
167
|
+
;
|
167
168
|
if (bound_subquery.subquery->types != view_catalog_entry->types) {
|
168
169
|
throw BinderException("Contents of view were altered: types don't match!");
|
169
170
|
}
|