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
@@ -113,43 +113,43 @@ bool SelectNode::Equals(const QueryNode *other_p) const {
|
|
113
113
|
if (this == other_p) {
|
114
114
|
return true;
|
115
115
|
}
|
116
|
-
auto other = (
|
116
|
+
auto &other = other_p->Cast<SelectNode>();
|
117
117
|
|
118
118
|
// SELECT
|
119
|
-
if (!ExpressionUtil::ListEquals(select_list, other
|
119
|
+
if (!ExpressionUtil::ListEquals(select_list, other.select_list)) {
|
120
120
|
return false;
|
121
121
|
}
|
122
122
|
// FROM
|
123
123
|
if (from_table) {
|
124
124
|
// we have a FROM clause, compare to the other one
|
125
|
-
if (!from_table->Equals(other
|
125
|
+
if (!from_table->Equals(other.from_table.get())) {
|
126
126
|
return false;
|
127
127
|
}
|
128
|
-
} else if (other
|
128
|
+
} else if (other.from_table) {
|
129
129
|
// we don't have a FROM clause, if the other statement has one they are
|
130
130
|
// not equal
|
131
131
|
return false;
|
132
132
|
}
|
133
133
|
// WHERE
|
134
|
-
if (!BaseExpression::Equals(where_clause.get(), other
|
134
|
+
if (!BaseExpression::Equals(where_clause.get(), other.where_clause.get())) {
|
135
135
|
return false;
|
136
136
|
}
|
137
137
|
// GROUP BY
|
138
|
-
if (!ExpressionUtil::ListEquals(groups.group_expressions, other
|
138
|
+
if (!ExpressionUtil::ListEquals(groups.group_expressions, other.groups.group_expressions)) {
|
139
139
|
return false;
|
140
140
|
}
|
141
|
-
if (groups.grouping_sets != other
|
141
|
+
if (groups.grouping_sets != other.groups.grouping_sets) {
|
142
142
|
return false;
|
143
143
|
}
|
144
|
-
if (!SampleOptions::Equals(sample.get(), other
|
144
|
+
if (!SampleOptions::Equals(sample.get(), other.sample.get())) {
|
145
145
|
return false;
|
146
146
|
}
|
147
147
|
// HAVING
|
148
|
-
if (!BaseExpression::Equals(having.get(), other
|
148
|
+
if (!BaseExpression::Equals(having.get(), other.having.get())) {
|
149
149
|
return false;
|
150
150
|
}
|
151
151
|
// QUALIFY
|
152
|
-
if (!BaseExpression::Equals(qualify.get(), other
|
152
|
+
if (!BaseExpression::Equals(qualify.get(), other.qualify.get())) {
|
153
153
|
return false;
|
154
154
|
}
|
155
155
|
return true;
|
@@ -47,14 +47,14 @@ bool SetOperationNode::Equals(const QueryNode *other_p) const {
|
|
47
47
|
if (this == other_p) {
|
48
48
|
return true;
|
49
49
|
}
|
50
|
-
auto other = (
|
51
|
-
if (setop_type != other
|
50
|
+
auto &other = other_p->Cast<SetOperationNode>();
|
51
|
+
if (setop_type != other.setop_type) {
|
52
52
|
return false;
|
53
53
|
}
|
54
|
-
if (!left->Equals(other
|
54
|
+
if (!left->Equals(other.left.get())) {
|
55
55
|
return false;
|
56
56
|
}
|
57
|
-
if (!right->Equals(other
|
57
|
+
if (!right->Equals(other.right.get())) {
|
58
58
|
return false;
|
59
59
|
}
|
60
60
|
return true;
|
@@ -159,7 +159,7 @@ ExpressionListRef *InsertStatement::GetValuesList() const {
|
|
159
159
|
if (select_statement->node->type != QueryNodeType::SELECT_NODE) {
|
160
160
|
return nullptr;
|
161
161
|
}
|
162
|
-
auto &node =
|
162
|
+
auto &node = select_statement->node->Cast<SelectNode>();
|
163
163
|
if (node.where_clause || node.qualify || node.having) {
|
164
164
|
return nullptr;
|
165
165
|
}
|
@@ -37,8 +37,8 @@ bool SelectStatement::Equals(const SQLStatement *other_p) const {
|
|
37
37
|
if (type != other_p->type) {
|
38
38
|
return false;
|
39
39
|
}
|
40
|
-
auto other = (
|
41
|
-
return node->Equals(other
|
40
|
+
auto &other = other_p->Cast<SelectStatement>();
|
41
|
+
return node->Equals(other.node.get());
|
42
42
|
}
|
43
43
|
|
44
44
|
string SelectStatement::ToString() const {
|
@@ -55,7 +55,7 @@ unique_ptr<ParsedExpression> Transformer::TransformArrayAccess(duckdb_libpgquery
|
|
55
55
|
if (function->type != ExpressionType::FUNCTION) {
|
56
56
|
throw ParserException("%s.%s() call must be a function", result->ToString(), function->ToString());
|
57
57
|
}
|
58
|
-
auto &f = (
|
58
|
+
auto &f = function->Cast<FunctionExpression>();
|
59
59
|
f.children.insert(f.children.begin(), std::move(result));
|
60
60
|
result = std::move(function);
|
61
61
|
break;
|
@@ -44,9 +44,9 @@ unique_ptr<ParsedExpression> Transformer::TransformStarExpression(duckdb_libpgqu
|
|
44
44
|
D_ASSERT(result->replace_list.empty());
|
45
45
|
result->expr = TransformExpression(star->expr);
|
46
46
|
if (result->expr->type == ExpressionType::STAR) {
|
47
|
-
auto child_star =
|
48
|
-
result->exclude_list = std::move(child_star
|
49
|
-
result->replace_list = std::move(child_star
|
47
|
+
auto &child_star = result->expr->Cast<StarExpression>();
|
48
|
+
result->exclude_list = std::move(child_star.exclude_list);
|
49
|
+
result->replace_list = std::move(child_star.replace_list);
|
50
50
|
result->expr.reset();
|
51
51
|
} else if (result->expr->type == ExpressionType::LAMBDA) {
|
52
52
|
vector<unique_ptr<ParsedExpression>> children;
|
@@ -72,7 +72,7 @@ bool Transformer::ExpressionIsEmptyStar(ParsedExpression &expr) {
|
|
72
72
|
if (expr.expression_class != ExpressionClass::STAR) {
|
73
73
|
return false;
|
74
74
|
}
|
75
|
-
auto &star = (
|
75
|
+
auto &star = expr.Cast<StarExpression>();
|
76
76
|
if (!star.columns && star.exclude_list.empty() && star.replace_list.empty()) {
|
77
77
|
return true;
|
78
78
|
}
|
@@ -316,48 +316,8 @@ unique_ptr<ParsedExpression> Transformer::TransformFuncCall(duckdb_libpgquery::P
|
|
316
316
|
return std::move(function);
|
317
317
|
}
|
318
318
|
|
319
|
-
static string SQLValueOpToString(duckdb_libpgquery::PGSQLValueFunctionOp op) {
|
320
|
-
switch (op) {
|
321
|
-
case duckdb_libpgquery::PG_SVFOP_CURRENT_DATE:
|
322
|
-
return "current_date";
|
323
|
-
case duckdb_libpgquery::PG_SVFOP_CURRENT_TIME:
|
324
|
-
return "get_current_time";
|
325
|
-
case duckdb_libpgquery::PG_SVFOP_CURRENT_TIME_N:
|
326
|
-
return "current_time_n";
|
327
|
-
case duckdb_libpgquery::PG_SVFOP_CURRENT_TIMESTAMP:
|
328
|
-
return "get_current_timestamp";
|
329
|
-
case duckdb_libpgquery::PG_SVFOP_CURRENT_TIMESTAMP_N:
|
330
|
-
return "current_timestamp_n";
|
331
|
-
case duckdb_libpgquery::PG_SVFOP_LOCALTIME:
|
332
|
-
return "current_localtime";
|
333
|
-
case duckdb_libpgquery::PG_SVFOP_LOCALTIME_N:
|
334
|
-
return "current_localtime_n";
|
335
|
-
case duckdb_libpgquery::PG_SVFOP_LOCALTIMESTAMP:
|
336
|
-
return "current_localtimestamp";
|
337
|
-
case duckdb_libpgquery::PG_SVFOP_LOCALTIMESTAMP_N:
|
338
|
-
return "current_localtimestamp_n";
|
339
|
-
case duckdb_libpgquery::PG_SVFOP_CURRENT_ROLE:
|
340
|
-
return "current_role";
|
341
|
-
case duckdb_libpgquery::PG_SVFOP_CURRENT_USER:
|
342
|
-
return "current_user";
|
343
|
-
case duckdb_libpgquery::PG_SVFOP_USER:
|
344
|
-
return "user";
|
345
|
-
case duckdb_libpgquery::PG_SVFOP_SESSION_USER:
|
346
|
-
return "session_user";
|
347
|
-
case duckdb_libpgquery::PG_SVFOP_CURRENT_CATALOG:
|
348
|
-
return "current_catalog";
|
349
|
-
case duckdb_libpgquery::PG_SVFOP_CURRENT_SCHEMA:
|
350
|
-
return "current_schema";
|
351
|
-
default:
|
352
|
-
throw InternalException("Could not find named SQL value function specification " + to_string((int)op));
|
353
|
-
}
|
354
|
-
}
|
355
|
-
|
356
319
|
unique_ptr<ParsedExpression> Transformer::TransformSQLValueFunction(duckdb_libpgquery::PGSQLValueFunction *node) {
|
357
|
-
|
358
|
-
vector<unique_ptr<ParsedExpression>> children;
|
359
|
-
auto fname = SQLValueOpToString(node->op);
|
360
|
-
return make_uniq<FunctionExpression>(fname, std::move(children));
|
320
|
+
throw InternalException("SQL value functions should not be emitted by the parser");
|
361
321
|
}
|
362
322
|
|
363
323
|
} // namespace duckdb
|
@@ -149,7 +149,7 @@ unique_ptr<ParsedExpression> Transformer::TransformAExprInternal(duckdb_libpgque
|
|
149
149
|
if (similar_func.children[1]->type != ExpressionType::VALUE_CONSTANT) {
|
150
150
|
throw NotImplementedException("Custom escape in SIMILAR TO");
|
151
151
|
}
|
152
|
-
auto &constant =
|
152
|
+
auto &constant = similar_func.children[1]->Cast<ConstantExpression>();
|
153
153
|
if (!constant.value.IsNull()) {
|
154
154
|
throw NotImplementedException("Custom escape in SIMILAR TO");
|
155
155
|
}
|
@@ -41,7 +41,7 @@ static void MergeGroupingSet(GroupingSet &result, GroupingSet &other) {
|
|
41
41
|
void Transformer::AddGroupByExpression(unique_ptr<ParsedExpression> expression, GroupingExpressionMap &map,
|
42
42
|
GroupByNode &result, vector<idx_t> &result_set) {
|
43
43
|
if (expression->type == ExpressionType::FUNCTION) {
|
44
|
-
auto &func = (
|
44
|
+
auto &func = expression->Cast<FunctionExpression>();
|
45
45
|
if (func.function_name == "row") {
|
46
46
|
for (auto &child : func.children) {
|
47
47
|
AddGroupByExpression(std::move(child), map, result, result_set);
|
@@ -64,7 +64,6 @@ unique_ptr<CreateStatement> Transformer::TransformCreateType(duckdb_libpgquery::
|
|
64
64
|
|
65
65
|
case duckdb_libpgquery::PG_NEWTYPE_ALIAS: {
|
66
66
|
LogicalType target_type = TransformTypeName(stmt->ofType);
|
67
|
-
target_type.SetAlias(info->name);
|
68
67
|
info->type = target_type;
|
69
68
|
} break;
|
70
69
|
|
@@ -10,6 +10,7 @@
|
|
10
10
|
#include "duckdb/parser/statement/drop_statement.hpp"
|
11
11
|
#include "duckdb/parser/parsed_data/drop_info.hpp"
|
12
12
|
#include "duckdb/parser/expression/cast_expression.hpp"
|
13
|
+
#include "duckdb/parser/expression/constant_expression.hpp"
|
13
14
|
#include "duckdb/parser/expression/operator_expression.hpp"
|
14
15
|
#include "duckdb/parser/expression/function_expression.hpp"
|
15
16
|
#include "duckdb/parser/result_modifier.hpp"
|
@@ -58,15 +59,17 @@ unique_ptr<SQLStatement> Transformer::GenerateCreateEnumStmt(unique_ptr<CreatePi
|
|
58
59
|
// generate the query that will result in the enum creation
|
59
60
|
auto select_node = std::move(entry->base);
|
60
61
|
auto columnref = entry->column->Copy();
|
61
|
-
auto cast = make_uniq<CastExpression>(LogicalType::VARCHAR, columnref
|
62
|
+
auto cast = make_uniq<CastExpression>(LogicalType::VARCHAR, std::move(columnref));
|
62
63
|
select_node->select_list.push_back(std::move(cast));
|
63
64
|
|
64
65
|
auto is_not_null = make_uniq<OperatorExpression>(ExpressionType::OPERATOR_IS_NOT_NULL, std::move(entry->column));
|
65
66
|
select_node->where_clause = std::move(is_not_null);
|
66
67
|
|
67
68
|
// order by the column
|
69
|
+
select_node->modifiers.push_back(make_uniq<DistinctModifier>());
|
68
70
|
auto modifier = make_uniq<OrderModifier>();
|
69
|
-
modifier->orders.emplace_back(OrderType::ASCENDING, OrderByNullType::ORDER_DEFAULT,
|
71
|
+
modifier->orders.emplace_back(OrderType::ASCENDING, OrderByNullType::ORDER_DEFAULT,
|
72
|
+
make_uniq<ConstantExpression>(Value::INTEGER(1)));
|
70
73
|
select_node->modifiers.push_back(std::move(modifier));
|
71
74
|
|
72
75
|
auto select = make_uniq<SelectStatement>();
|
@@ -23,21 +23,21 @@ unique_ptr<SQLStatement> Transformer::TransformPragma(duckdb_libpgquery::PGNode
|
|
23
23
|
auto expr = TransformExpression(node);
|
24
24
|
|
25
25
|
if (expr->type == ExpressionType::COMPARE_EQUAL) {
|
26
|
-
auto &comp = (
|
26
|
+
auto &comp = expr->Cast<ComparisonExpression>();
|
27
27
|
if (comp.right->type != ExpressionType::VALUE_CONSTANT) {
|
28
28
|
throw ParserException("Named parameter requires a constant on the RHS");
|
29
29
|
}
|
30
30
|
if (comp.left->type != ExpressionType::COLUMN_REF) {
|
31
31
|
throw ParserException("Named parameter requires a column reference on the LHS");
|
32
32
|
}
|
33
|
-
auto &columnref =
|
34
|
-
auto &constant =
|
33
|
+
auto &columnref = comp.left->Cast<ColumnRefExpression>();
|
34
|
+
auto &constant = comp.right->Cast<ConstantExpression>();
|
35
35
|
info.named_parameters[columnref.GetName()] = constant.value;
|
36
36
|
} else if (node->type == duckdb_libpgquery::T_PGAConst) {
|
37
37
|
auto constant = TransformConstant((duckdb_libpgquery::PGAConst *)node);
|
38
|
-
info.parameters.push_back(((
|
38
|
+
info.parameters.push_back((constant->Cast<ConstantExpression>()).value);
|
39
39
|
} else if (expr->type == ExpressionType::COLUMN_REF) {
|
40
|
-
auto &colref = (
|
40
|
+
auto &colref = expr->Cast<ColumnRefExpression>();
|
41
41
|
if (!colref.IsQualified()) {
|
42
42
|
info.parameters.emplace_back(colref.GetColumnName());
|
43
43
|
} else {
|
@@ -17,7 +17,7 @@ unique_ptr<QueryNode> Transformer::TransformSelectInternal(duckdb_libpgquery::PG
|
|
17
17
|
switch (stmt->op) {
|
18
18
|
case duckdb_libpgquery::PG_SETOP_NONE: {
|
19
19
|
node = make_uniq<SelectNode>();
|
20
|
-
auto result =
|
20
|
+
auto &result = node->Cast<SelectNode>();
|
21
21
|
if (stmt->withClause) {
|
22
22
|
TransformCTE(reinterpret_cast<duckdb_libpgquery::PGWithClause *>(stmt->withClause), node->cte_map);
|
23
23
|
}
|
@@ -44,34 +44,34 @@ unique_ptr<QueryNode> Transformer::TransformSelectInternal(duckdb_libpgquery::PG
|
|
44
44
|
// add the columns defined in the ON clause to the select list
|
45
45
|
TransformExpressionList(*stmt->distinctClause, modifier->distinct_on_targets);
|
46
46
|
}
|
47
|
-
result
|
47
|
+
result.modifiers.push_back(std::move(modifier));
|
48
48
|
}
|
49
49
|
|
50
50
|
// do this early so the value lists also have a `FROM`
|
51
51
|
if (stmt->valuesLists) {
|
52
52
|
// VALUES list, create an ExpressionList
|
53
53
|
D_ASSERT(!stmt->fromClause);
|
54
|
-
result
|
55
|
-
result
|
54
|
+
result.from_table = TransformValuesList(stmt->valuesLists);
|
55
|
+
result.select_list.push_back(make_uniq<StarExpression>());
|
56
56
|
} else {
|
57
57
|
if (!stmt->targetList) {
|
58
58
|
throw ParserException("SELECT clause without selection list");
|
59
59
|
}
|
60
60
|
// select list
|
61
|
-
TransformExpressionList(*stmt->targetList, result
|
62
|
-
result
|
61
|
+
TransformExpressionList(*stmt->targetList, result.select_list);
|
62
|
+
result.from_table = TransformFrom(stmt->fromClause);
|
63
63
|
}
|
64
64
|
|
65
65
|
// where
|
66
|
-
result
|
66
|
+
result.where_clause = TransformExpression(stmt->whereClause);
|
67
67
|
// group by
|
68
|
-
TransformGroupBy(stmt->groupClause,
|
68
|
+
TransformGroupBy(stmt->groupClause, result);
|
69
69
|
// having
|
70
|
-
result
|
70
|
+
result.having = TransformExpression(stmt->havingClause);
|
71
71
|
// qualify
|
72
|
-
result
|
72
|
+
result.qualify = TransformExpression(stmt->qualifyClause);
|
73
73
|
// sample
|
74
|
-
result
|
74
|
+
result.sample = TransformSampleOptions(stmt->sampleOptions);
|
75
75
|
break;
|
76
76
|
}
|
77
77
|
case duckdb_libpgquery::PG_SETOP_UNION:
|
@@ -79,13 +79,13 @@ unique_ptr<QueryNode> Transformer::TransformSelectInternal(duckdb_libpgquery::PG
|
|
79
79
|
case duckdb_libpgquery::PG_SETOP_INTERSECT:
|
80
80
|
case duckdb_libpgquery::PG_SETOP_UNION_BY_NAME: {
|
81
81
|
node = make_uniq<SetOperationNode>();
|
82
|
-
auto result =
|
82
|
+
auto &result = node->Cast<SetOperationNode>();
|
83
83
|
if (stmt->withClause) {
|
84
84
|
TransformCTE(reinterpret_cast<duckdb_libpgquery::PGWithClause *>(stmt->withClause), node->cte_map);
|
85
85
|
}
|
86
|
-
result
|
87
|
-
result
|
88
|
-
if (!result
|
86
|
+
result.left = TransformSelectNode(stmt->larg);
|
87
|
+
result.right = TransformSelectNode(stmt->rarg);
|
88
|
+
if (!result.left || !result.right) {
|
89
89
|
throw Exception("Failed to transform setop children.");
|
90
90
|
}
|
91
91
|
|
@@ -93,23 +93,23 @@ unique_ptr<QueryNode> Transformer::TransformSelectInternal(duckdb_libpgquery::PG
|
|
93
93
|
switch (stmt->op) {
|
94
94
|
case duckdb_libpgquery::PG_SETOP_UNION:
|
95
95
|
select_distinct = !stmt->all;
|
96
|
-
result
|
96
|
+
result.setop_type = SetOperationType::UNION;
|
97
97
|
break;
|
98
98
|
case duckdb_libpgquery::PG_SETOP_EXCEPT:
|
99
|
-
result
|
99
|
+
result.setop_type = SetOperationType::EXCEPT;
|
100
100
|
break;
|
101
101
|
case duckdb_libpgquery::PG_SETOP_INTERSECT:
|
102
|
-
result
|
102
|
+
result.setop_type = SetOperationType::INTERSECT;
|
103
103
|
break;
|
104
104
|
case duckdb_libpgquery::PG_SETOP_UNION_BY_NAME:
|
105
105
|
select_distinct = !stmt->all;
|
106
|
-
result
|
106
|
+
result.setop_type = SetOperationType::UNION_BY_NAME;
|
107
107
|
break;
|
108
108
|
default:
|
109
109
|
throw Exception("Unexpected setop type");
|
110
110
|
}
|
111
111
|
if (select_distinct) {
|
112
|
-
result
|
112
|
+
result.modifiers.push_back(make_uniq<DistinctModifier>());
|
113
113
|
}
|
114
114
|
if (stmt->sampleOptions) {
|
115
115
|
throw ParserException("SAMPLE clause is only allowed in regular SELECT statements");
|
@@ -9,16 +9,16 @@ namespace duckdb {
|
|
9
9
|
|
10
10
|
static void TransformPivotInList(unique_ptr<ParsedExpression> &expr, PivotColumnEntry &entry, bool root_entry = true) {
|
11
11
|
if (expr->type == ExpressionType::COLUMN_REF) {
|
12
|
-
auto &colref = (
|
12
|
+
auto &colref = expr->Cast<ColumnRefExpression>();
|
13
13
|
if (colref.IsQualified()) {
|
14
14
|
throw ParserException("PIVOT IN list cannot contain qualified column references");
|
15
15
|
}
|
16
16
|
entry.values.emplace_back(colref.GetColumnName());
|
17
17
|
} else if (expr->type == ExpressionType::VALUE_CONSTANT) {
|
18
|
-
auto &constant_expr = (
|
18
|
+
auto &constant_expr = expr->Cast<ConstantExpression>();
|
19
19
|
entry.values.push_back(std::move(constant_expr.value));
|
20
20
|
} else if (root_entry && expr->type == ExpressionType::FUNCTION) {
|
21
|
-
auto &function = (
|
21
|
+
auto &function = expr->Cast<FunctionExpression>();
|
22
22
|
if (function.function_name != "row") {
|
23
23
|
throw ParserException("PIVOT IN list must contain columns or lists of columns");
|
24
24
|
}
|
@@ -421,6 +421,17 @@ void BindContext::GenerateAllColumnExpressions(StarExpression &expr,
|
|
421
421
|
}
|
422
422
|
}
|
423
423
|
|
424
|
+
void BindContext::GetTypesAndNames(vector<string> &result_names, vector<LogicalType> &result_types) {
|
425
|
+
for (auto &binding_entry : bindings_list) {
|
426
|
+
auto &binding = *binding_entry.second;
|
427
|
+
D_ASSERT(binding.names.size() == binding.types.size());
|
428
|
+
for (idx_t i = 0; i < binding.names.size(); i++) {
|
429
|
+
result_names.push_back(binding.names[i]);
|
430
|
+
result_types.push_back(binding.types[i]);
|
431
|
+
}
|
432
|
+
}
|
433
|
+
}
|
434
|
+
|
424
435
|
void BindContext::AddBinding(const string &alias, unique_ptr<Binding> binding) {
|
425
436
|
if (bindings.find(alias) != bindings.end()) {
|
426
437
|
throw BinderException("Duplicate alias \"%s\" in query!", alias);
|
@@ -17,6 +17,44 @@
|
|
17
17
|
|
18
18
|
namespace duckdb {
|
19
19
|
|
20
|
+
string GetSQLValueFunctionName(const string &column_name) {
|
21
|
+
auto lcase = StringUtil::Lower(column_name);
|
22
|
+
if (lcase == "current_catalog") {
|
23
|
+
return "current_catalog";
|
24
|
+
} else if (lcase == "current_date") {
|
25
|
+
return "current_date";
|
26
|
+
} else if (lcase == "current_schema") {
|
27
|
+
return "current_schema";
|
28
|
+
} else if (lcase == "current_role") {
|
29
|
+
return "current_role";
|
30
|
+
} else if (lcase == "current_time") {
|
31
|
+
return "get_current_time";
|
32
|
+
} else if (lcase == "current_timestamp") {
|
33
|
+
return "get_current_timestamp";
|
34
|
+
} else if (lcase == "current_user") {
|
35
|
+
return "current_user";
|
36
|
+
} else if (lcase == "localtime") {
|
37
|
+
return "current_localtime";
|
38
|
+
} else if (lcase == "localtimestamp") {
|
39
|
+
return "current_localtimestamp";
|
40
|
+
} else if (lcase == "session_user") {
|
41
|
+
return "session_user";
|
42
|
+
} else if (lcase == "user") {
|
43
|
+
return "user";
|
44
|
+
}
|
45
|
+
return string();
|
46
|
+
}
|
47
|
+
|
48
|
+
unique_ptr<ParsedExpression> ExpressionBinder::GetSQLValueFunction(const string &column_name) {
|
49
|
+
auto value_function = GetSQLValueFunctionName(column_name);
|
50
|
+
if (value_function.empty()) {
|
51
|
+
return nullptr;
|
52
|
+
}
|
53
|
+
|
54
|
+
vector<unique_ptr<ParsedExpression>> children;
|
55
|
+
return make_uniq<FunctionExpression>(value_function, std::move(children));
|
56
|
+
}
|
57
|
+
|
20
58
|
unique_ptr<ParsedExpression> ExpressionBinder::QualifyColumnName(const string &column_name, string &error_message) {
|
21
59
|
auto using_binding = binder.bind_context.GetUsingBinding(column_name);
|
22
60
|
if (using_binding) {
|
@@ -70,6 +108,11 @@ unique_ptr<ParsedExpression> ExpressionBinder::QualifyColumnName(const string &c
|
|
70
108
|
}
|
71
109
|
// see if it's a column
|
72
110
|
if (table_name.empty()) {
|
111
|
+
// column was not found - check if it is a SQL value function
|
112
|
+
auto value_function = GetSQLValueFunction(column_name);
|
113
|
+
if (value_function) {
|
114
|
+
return value_function;
|
115
|
+
}
|
73
116
|
// it's not, find candidates and error
|
74
117
|
auto similar_bindings = binder.bind_context.GetSimilarBindings(column_name);
|
75
118
|
string candidate_str = StringUtil::CandidatesMessage(similar_bindings, "Candidate bindings");
|
@@ -83,7 +126,7 @@ unique_ptr<ParsedExpression> ExpressionBinder::QualifyColumnName(const string &c
|
|
83
126
|
void ExpressionBinder::QualifyColumnNames(unique_ptr<ParsedExpression> &expr) {
|
84
127
|
switch (expr->type) {
|
85
128
|
case ExpressionType::COLUMN_REF: {
|
86
|
-
auto &colref = (
|
129
|
+
auto &colref = expr->Cast<ColumnRefExpression>();
|
87
130
|
string error_message;
|
88
131
|
auto new_expr = QualifyColumnName(colref, error_message);
|
89
132
|
if (new_expr) {
|
@@ -96,7 +139,7 @@ void ExpressionBinder::QualifyColumnNames(unique_ptr<ParsedExpression> &expr) {
|
|
96
139
|
break;
|
97
140
|
}
|
98
141
|
case ExpressionType::POSITIONAL_REFERENCE: {
|
99
|
-
auto &ref = (
|
142
|
+
auto &ref = expr->Cast<PositionalReferenceExpression>();
|
100
143
|
if (ref.alias.empty()) {
|
101
144
|
string table_name, column_name;
|
102
145
|
auto error = binder.bind_context.BindColumn(ref, table_name, column_name);
|
@@ -124,7 +167,7 @@ unique_ptr<ParsedExpression> ExpressionBinder::CreateStructExtract(unique_ptr<Pa
|
|
124
167
|
// we need to transform the struct extract if it is inside a lambda expression
|
125
168
|
// because we cannot bind to an existing table, so we remove the dummy table also
|
126
169
|
if (lambda_bindings && base->type == ExpressionType::COLUMN_REF) {
|
127
|
-
auto &lambda_column_ref = (
|
170
|
+
auto &lambda_column_ref = base->Cast<ColumnRefExpression>();
|
128
171
|
D_ASSERT(!lambda_column_ref.column_names.empty());
|
129
172
|
|
130
173
|
if (lambda_column_ref.column_names[0].find(DummyBinding::DUMMY_NAME) != string::npos) {
|
@@ -304,7 +347,7 @@ BindResult ExpressionBinder::BindExpression(ColumnRefExpression &colref_p, idx_t
|
|
304
347
|
return result;
|
305
348
|
}
|
306
349
|
|
307
|
-
auto &colref = (
|
350
|
+
auto &colref = expr->Cast<ColumnRefExpression>();
|
308
351
|
D_ASSERT(colref.IsQualified());
|
309
352
|
auto &table_name = colref.GetTableName();
|
310
353
|
|
@@ -155,7 +155,7 @@ BindResult ExpressionBinder::BindLambdaFunction(FunctionExpression &function, Sc
|
|
155
155
|
}
|
156
156
|
|
157
157
|
// bind the lambda parameter
|
158
|
-
auto &lambda_expr =
|
158
|
+
auto &lambda_expr = function.children[1]->Cast<LambdaExpression>();
|
159
159
|
BindResult bind_lambda_result = BindExpression(lambda_expr, depth, true, list_child_type);
|
160
160
|
|
161
161
|
if (bind_lambda_result.HasError()) {
|
@@ -164,11 +164,10 @@ BindResult ExpressionBinder::BindLambdaFunction(FunctionExpression &function, Sc
|
|
164
164
|
// successfully bound: replace the node with a BoundExpression
|
165
165
|
auto alias = function.children[1]->alias;
|
166
166
|
function.children[1] = make_uniq<BoundExpression>(std::move(bind_lambda_result.expression));
|
167
|
-
auto be =
|
168
|
-
|
169
|
-
be->alias = alias;
|
167
|
+
auto &be = function.children[1]->Cast<BoundExpression>();
|
168
|
+
be.alias = alias;
|
170
169
|
if (!alias.empty()) {
|
171
|
-
be
|
170
|
+
be.expr->alias = alias;
|
172
171
|
}
|
173
172
|
}
|
174
173
|
|
@@ -199,7 +198,7 @@ BindResult ExpressionBinder::BindLambdaFunction(FunctionExpression &function, Sc
|
|
199
198
|
throw BinderException(binder.FormatError(function, error));
|
200
199
|
}
|
201
200
|
|
202
|
-
auto &bound_function_expr = (
|
201
|
+
auto &bound_function_expr = result->Cast<BoundFunctionExpression>();
|
203
202
|
D_ASSERT(bound_function_expr.children.size() == 2);
|
204
203
|
|
205
204
|
// remove the lambda expression from the children
|
@@ -34,7 +34,7 @@ BindResult ExpressionBinder::BindExpression(LambdaExpression &expr, idx_t depth,
|
|
34
34
|
if (expr.lhs->expression_class == ExpressionClass::COLUMN_REF) {
|
35
35
|
expr.params.push_back(std::move(expr.lhs));
|
36
36
|
} else {
|
37
|
-
auto &func_expr =
|
37
|
+
auto &func_expr = expr.lhs->Cast<FunctionExpression>();
|
38
38
|
for (idx_t i = 0; i < func_expr.children.size(); i++) {
|
39
39
|
expr.params.push_back(std::move(func_expr.children[i]));
|
40
40
|
}
|
@@ -52,7 +52,7 @@ BindResult ExpressionBinder::BindExpression(LambdaExpression &expr, idx_t depth,
|
|
52
52
|
throw BinderException("Parameter must be a column name.");
|
53
53
|
}
|
54
54
|
|
55
|
-
auto column_ref =
|
55
|
+
auto column_ref = expr.params[i]->Cast<ColumnRefExpression>();
|
56
56
|
if (column_ref.IsQualified()) {
|
57
57
|
throw BinderException("Invalid parameter name '%s': must be unqualified", column_ref.ToString());
|
58
58
|
}
|
@@ -13,7 +13,7 @@ void ExpressionBinder::ReplaceMacroParametersRecursive(unique_ptr<ParsedExpressi
|
|
13
13
|
switch (expr->GetExpressionClass()) {
|
14
14
|
case ExpressionClass::COLUMN_REF: {
|
15
15
|
// if expr is a parameter, replace it with its argument
|
16
|
-
auto &colref = (
|
16
|
+
auto &colref = expr->Cast<ColumnRefExpression>();
|
17
17
|
bool bind_macro_parameter = false;
|
18
18
|
if (colref.IsQualified()) {
|
19
19
|
bind_macro_parameter = false;
|
@@ -31,7 +31,7 @@ void ExpressionBinder::ReplaceMacroParametersRecursive(unique_ptr<ParsedExpressi
|
|
31
31
|
}
|
32
32
|
case ExpressionClass::SUBQUERY: {
|
33
33
|
// replacing parameters within a subquery is slightly different
|
34
|
-
auto &sq = ((
|
34
|
+
auto &sq = (expr->Cast<SubqueryExpression>()).subquery;
|
35
35
|
ParsedExpressionIterator::EnumerateQueryNodeChildren(
|
36
36
|
*sq->node, [&](unique_ptr<ParsedExpression> &child) { ReplaceMacroParametersRecursive(child); });
|
37
37
|
break;
|
@@ -65,7 +65,7 @@ BindResult ExpressionBinder::BindMacro(FunctionExpression &function, ScalarMacro
|
|
65
65
|
// positional parameters
|
66
66
|
for (idx_t i = 0; i < macro_def.parameters.size(); i++) {
|
67
67
|
types.emplace_back(LogicalType::SQLNULL);
|
68
|
-
auto ¶m =
|
68
|
+
auto ¶m = macro_def.parameters[i]->Cast<ColumnRefExpression>();
|
69
69
|
names.push_back(param.GetColumnName());
|
70
70
|
}
|
71
71
|
// default parameters
|
@@ -12,10 +12,10 @@ bool Binder::FindStarExpression(unique_ptr<ParsedExpression> &expr, StarExpressi
|
|
12
12
|
bool in_columns) {
|
13
13
|
bool has_star = false;
|
14
14
|
if (expr->GetExpressionClass() == ExpressionClass::STAR) {
|
15
|
-
auto current_star =
|
16
|
-
if (!current_star
|
15
|
+
auto ¤t_star = expr->Cast<StarExpression>();
|
16
|
+
if (!current_star.columns) {
|
17
17
|
if (is_root) {
|
18
|
-
*star = current_star;
|
18
|
+
*star = ¤t_star;
|
19
19
|
return true;
|
20
20
|
}
|
21
21
|
if (!in_columns) {
|
@@ -23,12 +23,12 @@ bool Binder::FindStarExpression(unique_ptr<ParsedExpression> &expr, StarExpressi
|
|
23
23
|
"STAR expression is only allowed as the root element of an expression. Use COLUMNS(*) instead.");
|
24
24
|
}
|
25
25
|
// star expression inside a COLUMNS - convert to a constant list
|
26
|
-
if (!current_star
|
26
|
+
if (!current_star.replace_list.empty()) {
|
27
27
|
throw BinderException(
|
28
28
|
"STAR expression with REPLACE list is only allowed as the root element of COLUMNS");
|
29
29
|
}
|
30
30
|
vector<unique_ptr<ParsedExpression>> star_list;
|
31
|
-
bind_context.GenerateAllColumnExpressions(
|
31
|
+
bind_context.GenerateAllColumnExpressions(current_star, star_list);
|
32
32
|
|
33
33
|
vector<Value> values;
|
34
34
|
values.reserve(star_list.size());
|
@@ -46,13 +46,13 @@ bool Binder::FindStarExpression(unique_ptr<ParsedExpression> &expr, StarExpressi
|
|
46
46
|
in_columns = true;
|
47
47
|
if (*star) {
|
48
48
|
// we can have multiple
|
49
|
-
if (!StarExpression::Equal(*star, current_star)) {
|
49
|
+
if (!StarExpression::Equal(*star, ¤t_star)) {
|
50
50
|
throw BinderException(
|
51
51
|
FormatError(*expr, "Multiple different STAR/COLUMNS in the same expression are not supported"));
|
52
52
|
}
|
53
53
|
return true;
|
54
54
|
}
|
55
|
-
*star = current_star;
|
55
|
+
*star = ¤t_star;
|
56
56
|
has_star = true;
|
57
57
|
}
|
58
58
|
ParsedExpressionIterator::EnumerateChildren(*expr, [&](unique_ptr<ParsedExpression> &child_expr) {
|
@@ -118,7 +118,7 @@ void Binder::ExpandStarExpression(unique_ptr<ParsedExpression> expr,
|
|
118
118
|
}
|
119
119
|
vector<unique_ptr<ParsedExpression>> new_list;
|
120
120
|
for (idx_t i = 0; i < star_list.size(); i++) {
|
121
|
-
auto &colref =
|
121
|
+
auto &colref = star_list[i]->Cast<ColumnRefExpression>();
|
122
122
|
if (!RE2::PartialMatch(colref.GetColumnName(), regex)) {
|
123
123
|
continue;
|
124
124
|
}
|