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
@@ -4,6 +4,7 @@
|
|
4
4
|
#include "duckdb/planner/expression/bound_columnref_expression.hpp"
|
5
5
|
#include "duckdb/planner/expression/bound_comparison_expression.hpp"
|
6
6
|
#include "duckdb/planner/expression/bound_constant_expression.hpp"
|
7
|
+
#include "duckdb/planner/expression/bound_function_expression.hpp"
|
7
8
|
#include "duckdb/planner/operator/logical_filter.hpp"
|
8
9
|
#include "duckdb/storage/statistics/base_statistics.hpp"
|
9
10
|
|
@@ -17,7 +18,7 @@ bool StatisticsPropagator::ExpressionIsConstant(Expression &expr, const Value &v
|
|
17
18
|
if (expr.GetExpressionClass() != ExpressionClass::BOUND_CONSTANT) {
|
18
19
|
return false;
|
19
20
|
}
|
20
|
-
auto &bound_constant = (
|
21
|
+
auto &bound_constant = expr.Cast<BoundConstantExpression>();
|
21
22
|
D_ASSERT(bound_constant.value.type() == val.type());
|
22
23
|
return Value::NotDistinctFrom(bound_constant.value, val);
|
23
24
|
}
|
@@ -26,7 +27,7 @@ bool StatisticsPropagator::ExpressionIsConstantOrNull(Expression &expr, const Va
|
|
26
27
|
if (expr.GetExpressionClass() != ExpressionClass::BOUND_FUNCTION) {
|
27
28
|
return false;
|
28
29
|
}
|
29
|
-
auto &bound_function = (
|
30
|
+
auto &bound_function = expr.Cast<BoundFunctionExpression>();
|
30
31
|
return ConstantOrNull::IsConstantOrNull(bound_function, val);
|
31
32
|
}
|
32
33
|
|
@@ -154,10 +155,10 @@ void StatisticsPropagator::UpdateFilterStatistics(Expression &left, Expression &
|
|
154
155
|
// any column ref involved in a comparison will not be null after the comparison
|
155
156
|
bool compare_distinct = IsCompareDistinct(comparison_type);
|
156
157
|
if (!compare_distinct && left.type == ExpressionType::BOUND_COLUMN_REF) {
|
157
|
-
SetStatisticsNotNull(((
|
158
|
+
SetStatisticsNotNull((left.Cast<BoundColumnRefExpression>()).binding);
|
158
159
|
}
|
159
160
|
if (!compare_distinct && right.type == ExpressionType::BOUND_COLUMN_REF) {
|
160
|
-
SetStatisticsNotNull(((
|
161
|
+
SetStatisticsNotNull((right.Cast<BoundColumnRefExpression>()).binding);
|
161
162
|
}
|
162
163
|
// check if this is a comparison between a constant and a column ref
|
163
164
|
BoundConstantExpression *constant = nullptr;
|
@@ -171,8 +172,8 @@ void StatisticsPropagator::UpdateFilterStatistics(Expression &left, Expression &
|
|
171
172
|
constant = (BoundConstantExpression *)&right;
|
172
173
|
} else if (left.type == ExpressionType::BOUND_COLUMN_REF && right.type == ExpressionType::BOUND_COLUMN_REF) {
|
173
174
|
// comparison between two column refs
|
174
|
-
auto &left_column_ref = (
|
175
|
-
auto &right_column_ref = (
|
175
|
+
auto &left_column_ref = left.Cast<BoundColumnRefExpression>();
|
176
|
+
auto &right_column_ref = right.Cast<BoundColumnRefExpression>();
|
176
177
|
auto lentry = statistics_map.find(left_column_ref.binding);
|
177
178
|
auto rentry = statistics_map.find(right_column_ref.binding);
|
178
179
|
if (lentry == statistics_map.end() || rentry == statistics_map.end()) {
|
@@ -198,13 +199,13 @@ void StatisticsPropagator::UpdateFilterStatistics(Expression &condition) {
|
|
198
199
|
// if we find a comparison in the form of e.g. "i=3", we can update our statistics for that column
|
199
200
|
switch (condition.GetExpressionClass()) {
|
200
201
|
case ExpressionClass::BOUND_BETWEEN: {
|
201
|
-
auto &between = (
|
202
|
+
auto &between = condition.Cast<BoundBetweenExpression>();
|
202
203
|
UpdateFilterStatistics(*between.input, *between.lower, between.LowerComparisonType());
|
203
204
|
UpdateFilterStatistics(*between.input, *between.upper, between.UpperComparisonType());
|
204
205
|
break;
|
205
206
|
}
|
206
207
|
case ExpressionClass::BOUND_COMPARISON: {
|
207
|
-
auto &comparison = (
|
208
|
+
auto &comparison = condition.Cast<BoundComparisonExpression>();
|
208
209
|
UpdateFilterStatistics(*comparison.left, *comparison.right, comparison.type);
|
209
210
|
break;
|
210
211
|
}
|
@@ -196,10 +196,10 @@ unique_ptr<NodeStatistics> StatisticsPropagator::PropagateStatistics(LogicalJoin
|
|
196
196
|
case LogicalOperatorType::LOGICAL_COMPARISON_JOIN:
|
197
197
|
case LogicalOperatorType::LOGICAL_DELIM_JOIN:
|
198
198
|
case LogicalOperatorType::LOGICAL_ASOF_JOIN:
|
199
|
-
PropagateStatistics((
|
199
|
+
PropagateStatistics(join.Cast<LogicalComparisonJoin>(), node_ptr);
|
200
200
|
break;
|
201
201
|
case LogicalOperatorType::LOGICAL_ANY_JOIN:
|
202
|
-
PropagateStatistics((
|
202
|
+
PropagateStatistics(join.Cast<LogicalAnyJoin>(), node_ptr);
|
203
203
|
break;
|
204
204
|
default:
|
205
205
|
break;
|
@@ -3,7 +3,18 @@
|
|
3
3
|
#include "duckdb/main/client_context.hpp"
|
4
4
|
#include "duckdb/planner/expression_iterator.hpp"
|
5
5
|
#include "duckdb/planner/logical_operator.hpp"
|
6
|
+
#include "duckdb/planner/operator/logical_aggregate.hpp"
|
6
7
|
#include "duckdb/planner/operator/logical_empty_result.hpp"
|
8
|
+
#include "duckdb/planner/operator/logical_cross_product.hpp"
|
9
|
+
#include "duckdb/planner/operator/logical_filter.hpp"
|
10
|
+
#include "duckdb/planner/operator/logical_get.hpp"
|
11
|
+
#include "duckdb/planner/operator/logical_join.hpp"
|
12
|
+
#include "duckdb/planner/operator/logical_projection.hpp"
|
13
|
+
#include "duckdb/planner/operator/logical_positional_join.hpp"
|
14
|
+
#include "duckdb/planner/operator/logical_set_operation.hpp"
|
15
|
+
#include "duckdb/planner/operator/logical_order.hpp"
|
16
|
+
#include "duckdb/planner/operator/logical_window.hpp"
|
17
|
+
#include "duckdb/planner/expression/list.hpp"
|
7
18
|
|
8
19
|
namespace duckdb {
|
9
20
|
|
@@ -26,31 +37,31 @@ unique_ptr<NodeStatistics> StatisticsPropagator::PropagateStatistics(LogicalOper
|
|
26
37
|
unique_ptr<LogicalOperator> *node_ptr) {
|
27
38
|
switch (node.type) {
|
28
39
|
case LogicalOperatorType::LOGICAL_AGGREGATE_AND_GROUP_BY:
|
29
|
-
return PropagateStatistics((
|
40
|
+
return PropagateStatistics(node.Cast<LogicalAggregate>(), node_ptr);
|
30
41
|
case LogicalOperatorType::LOGICAL_CROSS_PRODUCT:
|
31
|
-
return PropagateStatistics((
|
42
|
+
return PropagateStatistics(node.Cast<LogicalCrossProduct>(), node_ptr);
|
32
43
|
case LogicalOperatorType::LOGICAL_FILTER:
|
33
|
-
return PropagateStatistics((
|
44
|
+
return PropagateStatistics(node.Cast<LogicalFilter>(), node_ptr);
|
34
45
|
case LogicalOperatorType::LOGICAL_GET:
|
35
|
-
return PropagateStatistics((
|
46
|
+
return PropagateStatistics(node.Cast<LogicalGet>(), node_ptr);
|
36
47
|
case LogicalOperatorType::LOGICAL_PROJECTION:
|
37
|
-
return PropagateStatistics((
|
48
|
+
return PropagateStatistics(node.Cast<LogicalProjection>(), node_ptr);
|
38
49
|
case LogicalOperatorType::LOGICAL_ANY_JOIN:
|
39
50
|
case LogicalOperatorType::LOGICAL_ASOF_JOIN:
|
40
51
|
case LogicalOperatorType::LOGICAL_COMPARISON_JOIN:
|
41
52
|
case LogicalOperatorType::LOGICAL_JOIN:
|
42
53
|
case LogicalOperatorType::LOGICAL_DELIM_JOIN:
|
43
|
-
return PropagateStatistics((
|
54
|
+
return PropagateStatistics(node.Cast<LogicalJoin>(), node_ptr);
|
44
55
|
case LogicalOperatorType::LOGICAL_POSITIONAL_JOIN:
|
45
|
-
return PropagateStatistics((
|
56
|
+
return PropagateStatistics(node.Cast<LogicalPositionalJoin>(), node_ptr);
|
46
57
|
case LogicalOperatorType::LOGICAL_UNION:
|
47
58
|
case LogicalOperatorType::LOGICAL_EXCEPT:
|
48
59
|
case LogicalOperatorType::LOGICAL_INTERSECT:
|
49
|
-
return PropagateStatistics((
|
60
|
+
return PropagateStatistics(node.Cast<LogicalSetOperation>(), node_ptr);
|
50
61
|
case LogicalOperatorType::LOGICAL_ORDER_BY:
|
51
|
-
return PropagateStatistics((
|
62
|
+
return PropagateStatistics(node.Cast<LogicalOrder>(), node_ptr);
|
52
63
|
case LogicalOperatorType::LOGICAL_WINDOW:
|
53
|
-
return PropagateStatistics((
|
64
|
+
return PropagateStatistics(node.Cast<LogicalWindow>(), node_ptr);
|
54
65
|
default:
|
55
66
|
return PropagateChildren(node, node_ptr);
|
56
67
|
}
|
@@ -64,25 +75,25 @@ unique_ptr<BaseStatistics> StatisticsPropagator::PropagateExpression(Expression
|
|
64
75
|
unique_ptr<Expression> *expr_ptr) {
|
65
76
|
switch (expr.GetExpressionClass()) {
|
66
77
|
case ExpressionClass::BOUND_AGGREGATE:
|
67
|
-
return PropagateExpression((
|
78
|
+
return PropagateExpression(expr.Cast<BoundAggregateExpression>(), expr_ptr);
|
68
79
|
case ExpressionClass::BOUND_BETWEEN:
|
69
|
-
return PropagateExpression((
|
80
|
+
return PropagateExpression(expr.Cast<BoundBetweenExpression>(), expr_ptr);
|
70
81
|
case ExpressionClass::BOUND_CASE:
|
71
|
-
return PropagateExpression((
|
82
|
+
return PropagateExpression(expr.Cast<BoundCaseExpression>(), expr_ptr);
|
72
83
|
case ExpressionClass::BOUND_CONJUNCTION:
|
73
|
-
return PropagateExpression((
|
84
|
+
return PropagateExpression(expr.Cast<BoundConjunctionExpression>(), expr_ptr);
|
74
85
|
case ExpressionClass::BOUND_FUNCTION:
|
75
|
-
return PropagateExpression((
|
86
|
+
return PropagateExpression(expr.Cast<BoundFunctionExpression>(), expr_ptr);
|
76
87
|
case ExpressionClass::BOUND_CAST:
|
77
|
-
return PropagateExpression((
|
88
|
+
return PropagateExpression(expr.Cast<BoundCastExpression>(), expr_ptr);
|
78
89
|
case ExpressionClass::BOUND_COMPARISON:
|
79
|
-
return PropagateExpression((
|
90
|
+
return PropagateExpression(expr.Cast<BoundComparisonExpression>(), expr_ptr);
|
80
91
|
case ExpressionClass::BOUND_CONSTANT:
|
81
|
-
return PropagateExpression((
|
92
|
+
return PropagateExpression(expr.Cast<BoundConstantExpression>(), expr_ptr);
|
82
93
|
case ExpressionClass::BOUND_COLUMN_REF:
|
83
|
-
return PropagateExpression((
|
94
|
+
return PropagateExpression(expr.Cast<BoundColumnRefExpression>(), expr_ptr);
|
84
95
|
case ExpressionClass::BOUND_OPERATOR:
|
85
|
-
return PropagateExpression((
|
96
|
+
return PropagateExpression(expr.Cast<BoundOperatorExpression>(), expr_ptr);
|
86
97
|
default:
|
87
98
|
break;
|
88
99
|
}
|
@@ -9,8 +9,8 @@ namespace duckdb {
|
|
9
9
|
unique_ptr<LogicalOperator> TopN::Optimize(unique_ptr<LogicalOperator> op) {
|
10
10
|
if (op->type == LogicalOperatorType::LOGICAL_LIMIT &&
|
11
11
|
op->children[0]->type == LogicalOperatorType::LOGICAL_ORDER_BY) {
|
12
|
-
auto &limit = (
|
13
|
-
auto &order_by = (
|
12
|
+
auto &limit = op->Cast<LogicalLimit>();
|
13
|
+
auto &order_by = (op->children[0])->Cast<LogicalOrder>();
|
14
14
|
|
15
15
|
// This optimization doesn't apply when OFFSET is present without LIMIT
|
16
16
|
// Or if offset is not constant
|
@@ -22,7 +22,7 @@ void UnnestRewriterPlanUpdater::VisitExpression(unique_ptr<Expression> *expressi
|
|
22
22
|
|
23
23
|
if (expr->expression_class == ExpressionClass::BOUND_COLUMN_REF) {
|
24
24
|
|
25
|
-
auto &bound_column_ref = (
|
25
|
+
auto &bound_column_ref = expr->Cast<BoundColumnRefExpression>();
|
26
26
|
for (idx_t i = 0; i < replace_bindings.size(); i++) {
|
27
27
|
if (bound_column_ref.binding == replace_bindings[i].old_binding) {
|
28
28
|
bound_column_ref.binding = replace_bindings[i].new_binding;
|
@@ -79,7 +79,7 @@ void UnnestRewriter::FindCandidates(unique_ptr<LogicalOperator> *op_ptr,
|
|
79
79
|
}
|
80
80
|
|
81
81
|
// found a delim join
|
82
|
-
auto &delim_join =
|
82
|
+
auto &delim_join = op->children[0]->Cast<LogicalDelimJoin>();
|
83
83
|
// only support INNER delim joins
|
84
84
|
if (delim_join.join_type != JoinType::INNER) {
|
85
85
|
return;
|
@@ -144,9 +144,9 @@ bool UnnestRewriter::RewriteCandidate(unique_ptr<LogicalOperator> *candidate) {
|
|
144
144
|
// store the table index of the child of the LOGICAL_UNNEST
|
145
145
|
// then update the plan by making the lhs_proj the child of the LOGICAL_UNNEST
|
146
146
|
D_ASSERT(curr_op->get()->type == LogicalOperatorType::LOGICAL_UNNEST);
|
147
|
-
auto &unnest =
|
147
|
+
auto &unnest = curr_op->get()->Cast<LogicalUnnest>();
|
148
148
|
D_ASSERT(unnest.children[0]->type == LogicalOperatorType::LOGICAL_DELIM_GET);
|
149
|
-
overwritten_tbl_idx =
|
149
|
+
overwritten_tbl_idx = unnest.children[0]->Cast<LogicalDelimGet>().table_index;
|
150
150
|
unnest.children[0] = std::move(lhs_op);
|
151
151
|
|
152
152
|
// replace the LOGICAL_DELIM_JOIN with its RHS child operator
|
@@ -166,7 +166,7 @@ void UnnestRewriter::UpdateRHSBindings(unique_ptr<LogicalOperator> *plan_ptr, un
|
|
166
166
|
|
167
167
|
path_to_unnest.push_back(curr_op);
|
168
168
|
D_ASSERT(curr_op->get()->type == LogicalOperatorType::LOGICAL_PROJECTION);
|
169
|
-
auto &proj =
|
169
|
+
auto &proj = curr_op->get()->Cast<LogicalProjection>();
|
170
170
|
|
171
171
|
// pop the two last expressions from all projections (delim_idx and UNNEST column)
|
172
172
|
D_ASSERT(proj.expressions.size() > 2);
|
@@ -189,7 +189,7 @@ void UnnestRewriter::UpdateRHSBindings(unique_ptr<LogicalOperator> *plan_ptr, un
|
|
189
189
|
|
190
190
|
// update all bindings coming from the LHS to RHS bindings
|
191
191
|
D_ASSERT(topmost_op.children[0]->type == LogicalOperatorType::LOGICAL_PROJECTION);
|
192
|
-
auto &top_proj =
|
192
|
+
auto &top_proj = topmost_op.children[0]->Cast<LogicalProjection>();
|
193
193
|
for (idx_t i = 0; i < lhs_bindings.size(); i++) {
|
194
194
|
ReplaceBinding replace_binding(lhs_bindings[i].binding, ColumnBinding(top_proj.table_index, i));
|
195
195
|
updater.replace_bindings.push_back(replace_binding);
|
@@ -197,7 +197,7 @@ void UnnestRewriter::UpdateRHSBindings(unique_ptr<LogicalOperator> *plan_ptr, un
|
|
197
197
|
|
198
198
|
// temporarily remove the BOUND_UNNEST and the child of the LOGICAL_UNNEST from the plan
|
199
199
|
D_ASSERT(curr_op->get()->type == LogicalOperatorType::LOGICAL_UNNEST);
|
200
|
-
auto &unnest =
|
200
|
+
auto &unnest = curr_op->get()->Cast<LogicalUnnest>();
|
201
201
|
auto temp_bound_unnest = std::move(unnest.expressions[0]);
|
202
202
|
auto temp_unnest_child = std::move(unnest.children[0]);
|
203
203
|
unnest.expressions.clear();
|
@@ -213,7 +213,7 @@ void UnnestRewriter::UpdateRHSBindings(unique_ptr<LogicalOperator> *plan_ptr, un
|
|
213
213
|
for (idx_t i = path_to_unnest.size(); i > 0; i--) {
|
214
214
|
|
215
215
|
D_ASSERT(path_to_unnest[i - 1]->get()->type == LogicalOperatorType::LOGICAL_PROJECTION);
|
216
|
-
auto &proj =
|
216
|
+
auto &proj = path_to_unnest[i - 1]->get()->Cast<LogicalProjection>();
|
217
217
|
|
218
218
|
// temporarily store the existing expressions
|
219
219
|
vector<unique_ptr<Expression>> existing_expressions;
|
@@ -254,7 +254,7 @@ void UnnestRewriter::UpdateBoundUnnestBindings(UnnestRewriterPlanUpdater &update
|
|
254
254
|
|
255
255
|
// found the LOGICAL_UNNEST
|
256
256
|
D_ASSERT(curr_op->get()->type == LogicalOperatorType::LOGICAL_UNNEST);
|
257
|
-
auto &unnest =
|
257
|
+
auto &unnest = curr_op->get()->Cast<LogicalUnnest>();
|
258
258
|
|
259
259
|
auto unnest_child_cols = unnest.children[0]->GetColumnBindings();
|
260
260
|
for (idx_t delim_col_idx = 0; delim_col_idx < delim_columns.size(); delim_col_idx++) {
|
@@ -276,11 +276,11 @@ void UnnestRewriter::UpdateBoundUnnestBindings(UnnestRewriterPlanUpdater &update
|
|
276
276
|
void UnnestRewriter::GetDelimColumns(LogicalOperator &op) {
|
277
277
|
|
278
278
|
D_ASSERT(op.type == LogicalOperatorType::LOGICAL_DELIM_JOIN);
|
279
|
-
auto &delim_join = (
|
279
|
+
auto &delim_join = op.Cast<LogicalDelimJoin>();
|
280
280
|
for (idx_t i = 0; i < delim_join.duplicate_eliminated_columns.size(); i++) {
|
281
281
|
auto &expr = *delim_join.duplicate_eliminated_columns[i];
|
282
282
|
D_ASSERT(expr.type == ExpressionType::BOUND_COLUMN_REF);
|
283
|
-
auto &bound_colref_expr = (
|
283
|
+
auto &bound_colref_expr = expr.Cast<BoundColumnRefExpression>();
|
284
284
|
delim_columns.push_back(bound_colref_expr.binding);
|
285
285
|
}
|
286
286
|
}
|
@@ -294,7 +294,7 @@ void UnnestRewriter::GetLHSExpressions(LogicalOperator &op) {
|
|
294
294
|
bool set_alias = false;
|
295
295
|
// we can easily extract the alias for LOGICAL_PROJECTION(s)
|
296
296
|
if (op.type == LogicalOperatorType::LOGICAL_PROJECTION) {
|
297
|
-
auto &proj = (
|
297
|
+
auto &proj = op.Cast<LogicalProjection>();
|
298
298
|
if (proj.expressions.size() == op.types.size()) {
|
299
299
|
set_alias = true;
|
300
300
|
}
|
@@ -303,7 +303,7 @@ void UnnestRewriter::GetLHSExpressions(LogicalOperator &op) {
|
|
303
303
|
for (idx_t i = 0; i < op.types.size(); i++) {
|
304
304
|
lhs_bindings.emplace_back(col_bindings[i], op.types[i]);
|
305
305
|
if (set_alias) {
|
306
|
-
auto &proj = (
|
306
|
+
auto &proj = op.Cast<LogicalProjection>();
|
307
307
|
lhs_bindings.back().alias = proj.expressions[i]->alias;
|
308
308
|
}
|
309
309
|
}
|
@@ -145,7 +145,7 @@ bool ColumnDefinition::Generated() const {
|
|
145
145
|
|
146
146
|
static void VerifyColumnRefs(ParsedExpression &expr) {
|
147
147
|
if (expr.type == ExpressionType::COLUMN_REF) {
|
148
|
-
auto &column_ref = (
|
148
|
+
auto &column_ref = expr.Cast<ColumnRefExpression>();
|
149
149
|
if (column_ref.IsQualified()) {
|
150
150
|
throw ParserException(
|
151
151
|
"Qualified (tbl.name) column references are not allowed inside of generated column expressions");
|
@@ -157,7 +157,7 @@ static void VerifyColumnRefs(ParsedExpression &expr) {
|
|
157
157
|
|
158
158
|
static void InnerGetListOfDependencies(ParsedExpression &expr, vector<string> &dependencies) {
|
159
159
|
if (expr.type == ExpressionType::COLUMN_REF) {
|
160
|
-
auto columnref = (
|
160
|
+
auto columnref = expr.Cast<ColumnRefExpression>();
|
161
161
|
auto &name = columnref.GetColumnName();
|
162
162
|
dependencies.push_back(name);
|
163
163
|
}
|
@@ -206,7 +206,7 @@ void ColumnDefinition::ChangeGeneratedExpressionType(const LogicalType &type) {
|
|
206
206
|
generated_expression = make_uniq_base<ParsedExpression, CastExpression>(type, std::move(generated_expression));
|
207
207
|
// Every generated expression should be wrapped in a cast on creation
|
208
208
|
// D_ASSERT(generated_expression->type == ExpressionType::OPERATOR_CAST);
|
209
|
-
// auto &cast_expr = (
|
209
|
+
// auto &cast_expr = generated_expression->Cast<CastExpression>();
|
210
210
|
// auto base_expr = std::move(cast_expr.child);
|
211
211
|
// generated_expression = make_uniq_base<ParsedExpression, CastExpression>(type, std::move(base_expr));
|
212
212
|
}
|
@@ -69,9 +69,7 @@ bool ColumnRefExpression::Equal(const ColumnRefExpression *a, const ColumnRefExp
|
|
69
69
|
return false;
|
70
70
|
}
|
71
71
|
for (idx_t i = 0; i < a->column_names.size(); i++) {
|
72
|
-
|
73
|
-
auto lcase_b = StringUtil::Lower(b->column_names[i]);
|
74
|
-
if (lcase_a != lcase_b) {
|
72
|
+
if (!StringUtil::CIEquals(a->column_names[i], b->column_names[i])) {
|
75
73
|
return false;
|
76
74
|
}
|
77
75
|
}
|
@@ -81,8 +79,7 @@ bool ColumnRefExpression::Equal(const ColumnRefExpression *a, const ColumnRefExp
|
|
81
79
|
hash_t ColumnRefExpression::Hash() const {
|
82
80
|
hash_t result = ParsedExpression::Hash();
|
83
81
|
for (auto &column_name : column_names) {
|
84
|
-
|
85
|
-
result = CombineHash(result, duckdb::Hash<const char *>(lcase.c_str()));
|
82
|
+
result = CombineHash(result, StringUtil::CIHash(column_name));
|
86
83
|
}
|
87
84
|
return result;
|
88
85
|
}
|
@@ -29,7 +29,7 @@ ConjunctionExpression::ConjunctionExpression(ExpressionType type, unique_ptr<Par
|
|
29
29
|
void ConjunctionExpression::AddExpression(unique_ptr<ParsedExpression> expr) {
|
30
30
|
if (expr->type == type) {
|
31
31
|
// expr is a conjunction of the same type: merge the expression lists together
|
32
|
-
auto &other = (
|
32
|
+
auto &other = expr->Cast<ConjunctionExpression>();
|
33
33
|
for (auto &child : other.children) {
|
34
34
|
children.push_back(std::move(child));
|
35
35
|
}
|
@@ -23,7 +23,7 @@ bool ConstantExpression::Equal(const ConstantExpression *a, const ConstantExpres
|
|
23
23
|
}
|
24
24
|
|
25
25
|
hash_t ConstantExpression::Hash() const {
|
26
|
-
return
|
26
|
+
return value.Hash();
|
27
27
|
}
|
28
28
|
|
29
29
|
unique_ptr<ParsedExpression> ConstantExpression::Copy() const {
|
@@ -85,7 +85,7 @@ unique_ptr<CreateViewInfo> CreateViewInfo::FromCreateView(ClientContext &context
|
|
85
85
|
"Failed to create view from SQL string - \"%s\" - statement did not contain a single CREATE VIEW statement",
|
86
86
|
sql);
|
87
87
|
}
|
88
|
-
auto &create_statement =
|
88
|
+
auto &create_statement = parser.statements[0]->Cast<CreateStatement>();
|
89
89
|
if (create_statement.info->type != CatalogType::VIEW_ENTRY) {
|
90
90
|
throw BinderException(
|
91
91
|
"Failed to create view from SQL string - \"%s\" - view did not contain a CREATE VIEW statement", sql);
|
@@ -29,14 +29,14 @@ void ParsedExpressionIterator::EnumerateChildren(
|
|
29
29
|
ParsedExpression &expr, const std::function<void(unique_ptr<ParsedExpression> &child)> &callback) {
|
30
30
|
switch (expr.expression_class) {
|
31
31
|
case ExpressionClass::BETWEEN: {
|
32
|
-
auto &cast_expr = (
|
32
|
+
auto &cast_expr = expr.Cast<BetweenExpression>();
|
33
33
|
callback(cast_expr.input);
|
34
34
|
callback(cast_expr.lower);
|
35
35
|
callback(cast_expr.upper);
|
36
36
|
break;
|
37
37
|
}
|
38
38
|
case ExpressionClass::CASE: {
|
39
|
-
auto &case_expr = (
|
39
|
+
auto &case_expr = expr.Cast<CaseExpression>();
|
40
40
|
for (auto &check : case_expr.case_checks) {
|
41
41
|
callback(check.when_expr);
|
42
42
|
callback(check.then_expr);
|
@@ -45,23 +45,23 @@ void ParsedExpressionIterator::EnumerateChildren(
|
|
45
45
|
break;
|
46
46
|
}
|
47
47
|
case ExpressionClass::CAST: {
|
48
|
-
auto &cast_expr = (
|
48
|
+
auto &cast_expr = expr.Cast<CastExpression>();
|
49
49
|
callback(cast_expr.child);
|
50
50
|
break;
|
51
51
|
}
|
52
52
|
case ExpressionClass::COLLATE: {
|
53
|
-
auto &cast_expr = (
|
53
|
+
auto &cast_expr = expr.Cast<CollateExpression>();
|
54
54
|
callback(cast_expr.child);
|
55
55
|
break;
|
56
56
|
}
|
57
57
|
case ExpressionClass::COMPARISON: {
|
58
|
-
auto &comp_expr = (
|
58
|
+
auto &comp_expr = expr.Cast<ComparisonExpression>();
|
59
59
|
callback(comp_expr.left);
|
60
60
|
callback(comp_expr.right);
|
61
61
|
break;
|
62
62
|
}
|
63
63
|
case ExpressionClass::CONJUNCTION: {
|
64
|
-
auto &conj_expr = (
|
64
|
+
auto &conj_expr = expr.Cast<ConjunctionExpression>();
|
65
65
|
for (auto &child : conj_expr.children) {
|
66
66
|
callback(child);
|
67
67
|
}
|
@@ -69,7 +69,7 @@ void ParsedExpressionIterator::EnumerateChildren(
|
|
69
69
|
}
|
70
70
|
|
71
71
|
case ExpressionClass::FUNCTION: {
|
72
|
-
auto &func_expr = (
|
72
|
+
auto &func_expr = expr.Cast<FunctionExpression>();
|
73
73
|
for (auto &child : func_expr.children) {
|
74
74
|
callback(child);
|
75
75
|
}
|
@@ -84,34 +84,34 @@ void ParsedExpressionIterator::EnumerateChildren(
|
|
84
84
|
break;
|
85
85
|
}
|
86
86
|
case ExpressionClass::LAMBDA: {
|
87
|
-
auto &lambda_expr = (
|
87
|
+
auto &lambda_expr = expr.Cast<LambdaExpression>();
|
88
88
|
callback(lambda_expr.lhs);
|
89
89
|
callback(lambda_expr.expr);
|
90
90
|
break;
|
91
91
|
}
|
92
92
|
case ExpressionClass::OPERATOR: {
|
93
|
-
auto &op_expr = (
|
93
|
+
auto &op_expr = expr.Cast<OperatorExpression>();
|
94
94
|
for (auto &child : op_expr.children) {
|
95
95
|
callback(child);
|
96
96
|
}
|
97
97
|
break;
|
98
98
|
}
|
99
99
|
case ExpressionClass::STAR: {
|
100
|
-
auto &star_expr = (
|
100
|
+
auto &star_expr = expr.Cast<StarExpression>();
|
101
101
|
if (star_expr.expr) {
|
102
102
|
callback(star_expr.expr);
|
103
103
|
}
|
104
104
|
break;
|
105
105
|
}
|
106
106
|
case ExpressionClass::SUBQUERY: {
|
107
|
-
auto &subquery_expr = (
|
107
|
+
auto &subquery_expr = expr.Cast<SubqueryExpression>();
|
108
108
|
if (subquery_expr.child) {
|
109
109
|
callback(subquery_expr.child);
|
110
110
|
}
|
111
111
|
break;
|
112
112
|
}
|
113
113
|
case ExpressionClass::WINDOW: {
|
114
|
-
auto &window_expr = (
|
114
|
+
auto &window_expr = expr.Cast<WindowExpression>();
|
115
115
|
for (auto &partition : window_expr.partitions) {
|
116
116
|
callback(partition);
|
117
117
|
}
|
@@ -202,7 +202,7 @@ void ParsedExpressionIterator::EnumerateTableRefChildren(
|
|
202
202
|
TableRef &ref, const std::function<void(unique_ptr<ParsedExpression> &child)> &callback) {
|
203
203
|
switch (ref.type) {
|
204
204
|
case TableReferenceType::EXPRESSION_LIST: {
|
205
|
-
auto &el_ref = (
|
205
|
+
auto &el_ref = ref.Cast<ExpressionListRef>();
|
206
206
|
for (idx_t i = 0; i < el_ref.values.size(); i++) {
|
207
207
|
for (idx_t j = 0; j < el_ref.values[i].size(); j++) {
|
208
208
|
callback(el_ref.values[i][j]);
|
@@ -211,7 +211,7 @@ void ParsedExpressionIterator::EnumerateTableRefChildren(
|
|
211
211
|
break;
|
212
212
|
}
|
213
213
|
case TableReferenceType::JOIN: {
|
214
|
-
auto &j_ref = (
|
214
|
+
auto &j_ref = ref.Cast<JoinRef>();
|
215
215
|
EnumerateTableRefChildren(*j_ref.left, callback);
|
216
216
|
EnumerateTableRefChildren(*j_ref.right, callback);
|
217
217
|
if (j_ref.condition) {
|
@@ -220,7 +220,7 @@ void ParsedExpressionIterator::EnumerateTableRefChildren(
|
|
220
220
|
break;
|
221
221
|
}
|
222
222
|
case TableReferenceType::PIVOT: {
|
223
|
-
auto &p_ref = (
|
223
|
+
auto &p_ref = ref.Cast<PivotRef>();
|
224
224
|
EnumerateTableRefChildren(*p_ref.source, callback);
|
225
225
|
for (auto &aggr : p_ref.aggregates) {
|
226
226
|
callback(aggr);
|
@@ -228,12 +228,12 @@ void ParsedExpressionIterator::EnumerateTableRefChildren(
|
|
228
228
|
break;
|
229
229
|
}
|
230
230
|
case TableReferenceType::SUBQUERY: {
|
231
|
-
auto &sq_ref = (
|
231
|
+
auto &sq_ref = ref.Cast<SubqueryRef>();
|
232
232
|
EnumerateQueryNodeChildren(*sq_ref.subquery->node, callback);
|
233
233
|
break;
|
234
234
|
}
|
235
235
|
case TableReferenceType::TABLE_FUNCTION: {
|
236
|
-
auto &tf_ref = (
|
236
|
+
auto &tf_ref = ref.Cast<TableFunctionRef>();
|
237
237
|
callback(tf_ref.function);
|
238
238
|
break;
|
239
239
|
}
|
@@ -251,13 +251,13 @@ void ParsedExpressionIterator::EnumerateQueryNodeChildren(
|
|
251
251
|
QueryNode &node, const std::function<void(unique_ptr<ParsedExpression> &child)> &callback) {
|
252
252
|
switch (node.type) {
|
253
253
|
case QueryNodeType::RECURSIVE_CTE_NODE: {
|
254
|
-
auto &rcte_node = (
|
254
|
+
auto &rcte_node = node.Cast<RecursiveCTENode>();
|
255
255
|
EnumerateQueryNodeChildren(*rcte_node.left, callback);
|
256
256
|
EnumerateQueryNodeChildren(*rcte_node.right, callback);
|
257
257
|
break;
|
258
258
|
}
|
259
259
|
case QueryNodeType::SELECT_NODE: {
|
260
|
-
auto &sel_node = (
|
260
|
+
auto &sel_node = node.Cast<SelectNode>();
|
261
261
|
for (idx_t i = 0; i < sel_node.select_list.size(); i++) {
|
262
262
|
callback(sel_node.select_list[i]);
|
263
263
|
}
|
@@ -278,7 +278,7 @@ void ParsedExpressionIterator::EnumerateQueryNodeChildren(
|
|
278
278
|
break;
|
279
279
|
}
|
280
280
|
case QueryNodeType::SET_OPERATION_NODE: {
|
281
|
-
auto &setop_node = (
|
281
|
+
auto &setop_node = node.Cast<SetOperationNode>();
|
282
282
|
EnumerateQueryNodeChildren(*setop_node.left, callback);
|
283
283
|
EnumerateQueryNodeChildren(*setop_node.right, callback);
|
284
284
|
break;
|
@@ -178,7 +178,7 @@ void Parser::ParseQuery(const string &query) {
|
|
178
178
|
for (auto &statement : statements) {
|
179
179
|
statement->query = query;
|
180
180
|
if (statement->type == StatementType::CREATE_STATEMENT) {
|
181
|
-
auto &create = (
|
181
|
+
auto &create = statement->Cast<CreateStatement>();
|
182
182
|
create.info->sql = query.substr(statement->stmt_location, statement->stmt_length);
|
183
183
|
}
|
184
184
|
}
|
@@ -261,11 +261,11 @@ vector<unique_ptr<ParsedExpression>> Parser::ParseExpressionList(const string &s
|
|
261
261
|
if (parser.statements.size() != 1 || parser.statements[0]->type != StatementType::SELECT_STATEMENT) {
|
262
262
|
throw ParserException("Expected a single SELECT statement");
|
263
263
|
}
|
264
|
-
auto &select =
|
264
|
+
auto &select = parser.statements[0]->Cast<SelectStatement>();
|
265
265
|
if (select.node->type != QueryNodeType::SELECT_NODE) {
|
266
266
|
throw ParserException("Expected a single SELECT node");
|
267
267
|
}
|
268
|
-
auto &select_node =
|
268
|
+
auto &select_node = select.node->Cast<SelectNode>();
|
269
269
|
return std::move(select_node.select_list);
|
270
270
|
}
|
271
271
|
|
@@ -279,11 +279,11 @@ vector<OrderByNode> Parser::ParseOrderList(const string &select_list, ParserOpti
|
|
279
279
|
if (parser.statements.size() != 1 || parser.statements[0]->type != StatementType::SELECT_STATEMENT) {
|
280
280
|
throw ParserException("Expected a single SELECT statement");
|
281
281
|
}
|
282
|
-
auto &select =
|
282
|
+
auto &select = parser.statements[0]->Cast<SelectStatement>();
|
283
283
|
if (select.node->type != QueryNodeType::SELECT_NODE) {
|
284
284
|
throw ParserException("Expected a single SELECT node");
|
285
285
|
}
|
286
|
-
auto &select_node =
|
286
|
+
auto &select_node = select.node->Cast<SelectNode>();
|
287
287
|
if (select_node.modifiers.empty() || select_node.modifiers[0]->type != ResultModifierType::ORDER_MODIFIER ||
|
288
288
|
select_node.modifiers.size() != 1) {
|
289
289
|
throw ParserException("Expected a single ORDER clause");
|
@@ -303,7 +303,7 @@ void Parser::ParseUpdateList(const string &update_list, vector<string> &update_c
|
|
303
303
|
if (parser.statements.size() != 1 || parser.statements[0]->type != StatementType::UPDATE_STATEMENT) {
|
304
304
|
throw ParserException("Expected a single UPDATE statement");
|
305
305
|
}
|
306
|
-
auto &update =
|
306
|
+
auto &update = parser.statements[0]->Cast<UpdateStatement>();
|
307
307
|
update_columns = std::move(update.set_info->columns);
|
308
308
|
expressions = std::move(update.set_info->expressions);
|
309
309
|
}
|
@@ -318,15 +318,15 @@ vector<vector<unique_ptr<ParsedExpression>>> Parser::ParseValuesList(const strin
|
|
318
318
|
if (parser.statements.size() != 1 || parser.statements[0]->type != StatementType::SELECT_STATEMENT) {
|
319
319
|
throw ParserException("Expected a single SELECT statement");
|
320
320
|
}
|
321
|
-
auto &select =
|
321
|
+
auto &select = parser.statements[0]->Cast<SelectStatement>();
|
322
322
|
if (select.node->type != QueryNodeType::SELECT_NODE) {
|
323
323
|
throw ParserException("Expected a single SELECT node");
|
324
324
|
}
|
325
|
-
auto &select_node =
|
325
|
+
auto &select_node = select.node->Cast<SelectNode>();
|
326
326
|
if (!select_node.from_table || select_node.from_table->type != TableReferenceType::EXPRESSION_LIST) {
|
327
327
|
throw ParserException("Expected a single VALUES statement");
|
328
328
|
}
|
329
|
-
auto &values_list =
|
329
|
+
auto &values_list = select_node.from_table->Cast<ExpressionListRef>();
|
330
330
|
return std::move(values_list.values);
|
331
331
|
}
|
332
332
|
|
@@ -337,7 +337,7 @@ ColumnList Parser::ParseColumnList(const string &column_list, ParserOptions opti
|
|
337
337
|
if (parser.statements.size() != 1 || parser.statements[0]->type != StatementType::CREATE_STATEMENT) {
|
338
338
|
throw ParserException("Expected a single CREATE statement");
|
339
339
|
}
|
340
|
-
auto &create =
|
340
|
+
auto &create = parser.statements[0]->Cast<CreateStatement>();
|
341
341
|
if (create.info->type != CatalogType::TABLE_ENTRY) {
|
342
342
|
throw InternalException("Expected a single CREATE TABLE statement");
|
343
343
|
}
|
@@ -23,15 +23,15 @@ bool RecursiveCTENode::Equals(const QueryNode *other_p) const {
|
|
23
23
|
if (this == other_p) {
|
24
24
|
return true;
|
25
25
|
}
|
26
|
-
auto other = (
|
26
|
+
auto &other = other_p->Cast<RecursiveCTENode>();
|
27
27
|
|
28
|
-
if (other
|
28
|
+
if (other.union_all != union_all) {
|
29
29
|
return false;
|
30
30
|
}
|
31
|
-
if (!left->Equals(other
|
31
|
+
if (!left->Equals(other.left.get())) {
|
32
32
|
return false;
|
33
33
|
}
|
34
|
-
if (!right->Equals(other
|
34
|
+
if (!right->Equals(other.right.get())) {
|
35
35
|
return false;
|
36
36
|
}
|
37
37
|
return true;
|