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
@@ -39,7 +39,7 @@ void ColumnLifetimeAnalyzer::StandardVisitOperator(LogicalOperator &op) {
|
|
39
39
|
LogicalOperatorVisitor::VisitOperatorExpressions(op);
|
40
40
|
if (op.type == LogicalOperatorType::LOGICAL_DELIM_JOIN) {
|
41
41
|
// visit the duplicate eliminated columns on the LHS, if any
|
42
|
-
auto &delim_join = (
|
42
|
+
auto &delim_join = op.Cast<LogicalDelimJoin>();
|
43
43
|
for (auto &expr : delim_join.duplicate_eliminated_columns) {
|
44
44
|
VisitExpression(&expr);
|
45
45
|
}
|
@@ -63,7 +63,7 @@ void ColumnLifetimeAnalyzer::VisitOperator(LogicalOperator &op) {
|
|
63
63
|
if (everything_referenced) {
|
64
64
|
break;
|
65
65
|
}
|
66
|
-
auto &comp_join = (
|
66
|
+
auto &comp_join = op.Cast<LogicalComparisonJoin>();
|
67
67
|
if (comp_join.join_type == JoinType::MARK || comp_join.join_type == JoinType::SEMI ||
|
68
68
|
comp_join.join_type == JoinType::ANTI) {
|
69
69
|
break;
|
@@ -116,7 +116,7 @@ void ColumnLifetimeAnalyzer::VisitOperator(LogicalOperator &op) {
|
|
116
116
|
break;
|
117
117
|
}
|
118
118
|
case LogicalOperatorType::LOGICAL_FILTER: {
|
119
|
-
auto &filter = (
|
119
|
+
auto &filter = op.Cast<LogicalFilter>();
|
120
120
|
if (everything_referenced) {
|
121
121
|
break;
|
122
122
|
}
|
@@ -11,7 +11,7 @@ void CommonAggregateOptimizer::VisitOperator(LogicalOperator &op) {
|
|
11
11
|
LogicalOperatorVisitor::VisitOperator(op);
|
12
12
|
switch (op.type) {
|
13
13
|
case LogicalOperatorType::LOGICAL_AGGREGATE_AND_GROUP_BY:
|
14
|
-
ExtractCommonAggregates((
|
14
|
+
ExtractCommonAggregates(op.Cast<LogicalAggregate>());
|
15
15
|
break;
|
16
16
|
default:
|
17
17
|
break;
|
@@ -76,7 +76,7 @@ void CommonSubExpressionOptimizer::CountExpressions(Expression &expr, CSEReplace
|
|
76
76
|
void CommonSubExpressionOptimizer::PerformCSEReplacement(unique_ptr<Expression> *expr_ptr, CSEReplacementState &state) {
|
77
77
|
Expression &expr = **expr_ptr;
|
78
78
|
if (expr.expression_class == ExpressionClass::BOUND_COLUMN_REF) {
|
79
|
-
auto &bound_column_ref = (
|
79
|
+
auto &bound_column_ref = expr.Cast<BoundColumnRefExpression>();
|
80
80
|
// bound column ref, check if this one has already been recorded in the expression list
|
81
81
|
auto column_entry = state.column_map.find(bound_column_ref.binding);
|
82
82
|
if (column_entry == state.column_map.end()) {
|
@@ -66,7 +66,7 @@ void DeliminatorPlanUpdater::VisitOperator(LogicalOperator &op) {
|
|
66
66
|
VisitOperatorChildren(op);
|
67
67
|
VisitOperatorExpressions(op);
|
68
68
|
if (op.type == LogicalOperatorType::LOGICAL_DELIM_JOIN && DelimGetCount(op) == 0) {
|
69
|
-
auto &delim_join = (
|
69
|
+
auto &delim_join = op.Cast<LogicalDelimJoin>();
|
70
70
|
auto decs = &delim_join.duplicate_eliminated_columns;
|
71
71
|
for (auto &cond : delim_join.conditions) {
|
72
72
|
if (!IsEqualityJoinCondition(cond)) {
|
@@ -74,13 +74,13 @@ void DeliminatorPlanUpdater::VisitOperator(LogicalOperator &op) {
|
|
74
74
|
}
|
75
75
|
auto rhs = cond.right.get();
|
76
76
|
while (rhs->type == ExpressionType::OPERATOR_CAST) {
|
77
|
-
auto &cast = (
|
77
|
+
auto &cast = rhs->Cast<BoundCastExpression>();
|
78
78
|
rhs = cast.child.get();
|
79
79
|
}
|
80
80
|
if (rhs->type != ExpressionType::BOUND_COLUMN_REF) {
|
81
81
|
throw InternalException("Error in Deliminator: expected a bound column reference");
|
82
82
|
}
|
83
|
-
auto &colref = (
|
83
|
+
auto &colref = rhs->Cast<BoundColumnRefExpression>();
|
84
84
|
if (projection_map.find(colref.binding) != projection_map.end()) {
|
85
85
|
// value on the right is a projection of removed DelimGet
|
86
86
|
for (idx_t i = 0; i < decs->size(); i++) {
|
@@ -187,7 +187,7 @@ static bool ChildJoinTypeCanBeDeliminated(JoinType &join_type) {
|
|
187
187
|
bool Deliminator::RemoveCandidate(unique_ptr<LogicalOperator> *plan, unique_ptr<LogicalOperator> *candidate,
|
188
188
|
DeliminatorPlanUpdater &updater) {
|
189
189
|
auto &proj_or_agg = **candidate;
|
190
|
-
auto &join =
|
190
|
+
auto &join = proj_or_agg.children[0]->Cast<LogicalComparisonJoin>();
|
191
191
|
if (!ChildJoinTypeCanBeDeliminated(join.join_type)) {
|
192
192
|
return false;
|
193
193
|
}
|
@@ -200,7 +200,7 @@ bool Deliminator::RemoveCandidate(unique_ptr<LogicalOperator> *plan, unique_ptr<
|
|
200
200
|
if (join.children[delim_idx]->type == LogicalOperatorType::LOGICAL_FILTER) {
|
201
201
|
filter = (LogicalFilter *)join.children[delim_idx].get();
|
202
202
|
}
|
203
|
-
auto &delim_get = (
|
203
|
+
auto &delim_get = (filter ? filter->children[0] : join.children[delim_idx])->Cast<LogicalDelimGet>();
|
204
204
|
if (join.conditions.size() != delim_get.chunk_types.size()) {
|
205
205
|
// joining with DelimGet adds new information
|
206
206
|
return false;
|
@@ -236,7 +236,7 @@ bool Deliminator::RemoveCandidate(unique_ptr<LogicalOperator> *plan, unique_ptr<
|
|
236
236
|
}
|
237
237
|
}
|
238
238
|
} else {
|
239
|
-
auto &agg = (
|
239
|
+
auto &agg = proj_or_agg.Cast<LogicalAggregate>();
|
240
240
|
|
241
241
|
// Create a vector of all exprs in the agg
|
242
242
|
vector<Expression *> all_agg_exprs;
|
@@ -345,7 +345,7 @@ bool Deliminator::RemoveInequalityCandidate(unique_ptr<LogicalOperator> *plan, u
|
|
345
345
|
}
|
346
346
|
|
347
347
|
// we can only remove inequality join with a DelimGet if the parent DelimJoin has one of these join types
|
348
|
-
auto &delim_join = (
|
348
|
+
auto &delim_join = dj->Cast<LogicalDelimJoin>();
|
349
349
|
if (!InequalityDelimJoinCanBeEliminated(delim_join.join_type)) {
|
350
350
|
continue;
|
351
351
|
}
|
@@ -359,8 +359,8 @@ bool Deliminator::RemoveInequalityCandidate(unique_ptr<LogicalOperator> *plan, u
|
|
359
359
|
|
360
360
|
// we found the parent delim join, and we may be able to remove the child DelimGet join
|
361
361
|
// but we need to make sure that their conditions refer to exactly the same columns
|
362
|
-
auto &parent_delim_join = (
|
363
|
-
auto &join =
|
362
|
+
auto &parent_delim_join = parent->Cast<LogicalDelimJoin>();
|
363
|
+
auto &join = proj_or_agg.children[0]->Cast<LogicalComparisonJoin>();
|
364
364
|
if (parent_delim_join.conditions.size() != join.conditions.size()) {
|
365
365
|
// different number of conditions, can't replace
|
366
366
|
return false;
|
@@ -376,7 +376,7 @@ bool Deliminator::RemoveInequalityCandidate(unique_ptr<LogicalOperator> *plan, u
|
|
376
376
|
// can only deal with colrefs
|
377
377
|
return false;
|
378
378
|
}
|
379
|
-
auto &parent_colref = (
|
379
|
+
auto &parent_colref = parent_expr->Cast<BoundColumnRefExpression>();
|
380
380
|
auto it = updater.reverse_proj_or_agg_map.find(parent_colref.binding);
|
381
381
|
if (it == updater.reverse_proj_or_agg_map.end()) {
|
382
382
|
// refers to a column that was not in the child DelimGet join
|
@@ -414,7 +414,7 @@ bool Deliminator::RemoveInequalityCandidate(unique_ptr<LogicalOperator> *plan, u
|
|
414
414
|
// this time without checks because we already did them, and replace the expressions
|
415
415
|
for (auto &parent_cond : parent_delim_join.conditions) {
|
416
416
|
auto &parent_expr = parent_delim_get_side == 0 ? parent_cond.left : parent_cond.right;
|
417
|
-
auto &parent_colref = (
|
417
|
+
auto &parent_colref = parent_expr->Cast<BoundColumnRefExpression>();
|
418
418
|
auto it = updater.reverse_proj_or_agg_map.find(parent_colref.binding);
|
419
419
|
auto child_expr = it->second;
|
420
420
|
for (auto &child_cond : join.conditions) {
|
@@ -152,47 +152,47 @@ idx_t ExpressionHeuristics::ExpressionCost(PhysicalType return_type, idx_t multi
|
|
152
152
|
idx_t ExpressionHeuristics::Cost(Expression &expr) {
|
153
153
|
switch (expr.expression_class) {
|
154
154
|
case ExpressionClass::BOUND_CASE: {
|
155
|
-
auto &case_expr = (
|
155
|
+
auto &case_expr = expr.Cast<BoundCaseExpression>();
|
156
156
|
return ExpressionCost(case_expr);
|
157
157
|
}
|
158
158
|
case ExpressionClass::BOUND_BETWEEN: {
|
159
|
-
auto &between_expr = (
|
159
|
+
auto &between_expr = expr.Cast<BoundBetweenExpression>();
|
160
160
|
return ExpressionCost(between_expr);
|
161
161
|
}
|
162
162
|
case ExpressionClass::BOUND_CAST: {
|
163
|
-
auto &cast_expr = (
|
163
|
+
auto &cast_expr = expr.Cast<BoundCastExpression>();
|
164
164
|
return ExpressionCost(cast_expr);
|
165
165
|
}
|
166
166
|
case ExpressionClass::BOUND_COMPARISON: {
|
167
|
-
auto &comp_expr = (
|
167
|
+
auto &comp_expr = expr.Cast<BoundComparisonExpression>();
|
168
168
|
return ExpressionCost(comp_expr);
|
169
169
|
}
|
170
170
|
case ExpressionClass::BOUND_CONJUNCTION: {
|
171
|
-
auto &conj_expr = (
|
171
|
+
auto &conj_expr = expr.Cast<BoundConjunctionExpression>();
|
172
172
|
return ExpressionCost(conj_expr);
|
173
173
|
}
|
174
174
|
case ExpressionClass::BOUND_FUNCTION: {
|
175
|
-
auto &func_expr = (
|
175
|
+
auto &func_expr = expr.Cast<BoundFunctionExpression>();
|
176
176
|
return ExpressionCost(func_expr);
|
177
177
|
}
|
178
178
|
case ExpressionClass::BOUND_OPERATOR: {
|
179
|
-
auto &op_expr = (
|
179
|
+
auto &op_expr = expr.Cast<BoundOperatorExpression>();
|
180
180
|
return ExpressionCost(op_expr, expr.type);
|
181
181
|
}
|
182
182
|
case ExpressionClass::BOUND_COLUMN_REF: {
|
183
|
-
auto &col_expr = (
|
183
|
+
auto &col_expr = expr.Cast<BoundColumnRefExpression>();
|
184
184
|
return ExpressionCost(col_expr.return_type.InternalType(), 8);
|
185
185
|
}
|
186
186
|
case ExpressionClass::BOUND_CONSTANT: {
|
187
|
-
auto &const_expr = (
|
187
|
+
auto &const_expr = expr.Cast<BoundConstantExpression>();
|
188
188
|
return ExpressionCost(const_expr.return_type.InternalType(), 1);
|
189
189
|
}
|
190
190
|
case ExpressionClass::BOUND_PARAMETER: {
|
191
|
-
auto &const_expr = (
|
191
|
+
auto &const_expr = expr.Cast<BoundParameterExpression>();
|
192
192
|
return ExpressionCost(const_expr.return_type.InternalType(), 1);
|
193
193
|
}
|
194
194
|
case ExpressionClass::BOUND_REF: {
|
195
|
-
auto &col_expr = (
|
195
|
+
auto &col_expr = expr.Cast<BoundColumnRefExpression>();
|
196
196
|
return ExpressionCost(col_expr.return_type.InternalType(), 8);
|
197
197
|
}
|
198
198
|
default: {
|
@@ -74,7 +74,7 @@ void ExpressionRewriter::VisitOperator(LogicalOperator &op) {
|
|
74
74
|
|
75
75
|
// if it is a LogicalFilter, we split up filter conjunctions again
|
76
76
|
if (op.type == LogicalOperatorType::LOGICAL_FILTER) {
|
77
|
-
auto &filter = (
|
77
|
+
auto &filter = op.Cast<LogicalFilter>();
|
78
78
|
filter.SplitPredicates();
|
79
79
|
}
|
80
80
|
}
|
@@ -251,7 +251,7 @@ bool FilterCombiner::HasFilters() {
|
|
251
251
|
// { unordered_map<idx_t, std::pair<Value *, Value *>> checks; switch (filter->type) { case
|
252
252
|
// ExpressionType::CONJUNCTION_OR: {
|
253
253
|
// //! For a filter to
|
254
|
-
// auto &or_exp = (
|
254
|
+
// auto &or_exp = filter->Cast<BoundConjunctionExpression>();
|
255
255
|
// checks = FindZonemapChecks(column_ids, not_constants, or_exp.children[0].get());
|
256
256
|
// for (size_t i = 1; i < or_exp.children.size(); ++i) {
|
257
257
|
// auto child_check = FindZonemapChecks(column_ids, not_constants, or_exp.children[i].get());
|
@@ -260,7 +260,7 @@ bool FilterCombiner::HasFilters() {
|
|
260
260
|
// return checks;
|
261
261
|
// }
|
262
262
|
// case ExpressionType::CONJUNCTION_AND: {
|
263
|
-
// auto &and_exp = (
|
263
|
+
// auto &and_exp = filter->Cast<BoundConjunctionExpression>();
|
264
264
|
// checks = FindZonemapChecks(column_ids, not_constants, and_exp.children[0].get());
|
265
265
|
// for (size_t i = 1; i < and_exp.children.size(); ++i) {
|
266
266
|
// auto child_check = FindZonemapChecks(column_ids, not_constants, and_exp.children[i].get());
|
@@ -269,17 +269,17 @@ bool FilterCombiner::HasFilters() {
|
|
269
269
|
// return checks;
|
270
270
|
// }
|
271
271
|
// case ExpressionType::COMPARE_IN: {
|
272
|
-
// auto &comp_in_exp = (
|
272
|
+
// auto &comp_in_exp = filter->Cast<BoundOperatorExpression>();
|
273
273
|
// if (comp_in_exp.children[0]->type == ExpressionType::BOUND_COLUMN_REF) {
|
274
274
|
// Value *min = nullptr, *max = nullptr;
|
275
|
-
// auto &column_ref =
|
275
|
+
// auto &column_ref = comp_in_exp.children[0]->Cast<BoundColumnRefExpression>();
|
276
276
|
// for (size_t i {1}; i < comp_in_exp.children.size(); i++) {
|
277
277
|
// if (comp_in_exp.children[i]->type != ExpressionType::VALUE_CONSTANT) {
|
278
278
|
// //! This indicates the column has a comparison that is not with a constant
|
279
279
|
// not_constants.insert(column_ids[column_ref.binding.column_index]);
|
280
280
|
// break;
|
281
281
|
// } else {
|
282
|
-
// auto &const_value_expr =
|
282
|
+
// auto &const_value_expr = comp_in_exp.children[i]->Cast<BoundConstantExpression>();
|
283
283
|
// if (const_value_expr.value.IsNull()) {
|
284
284
|
// return checks;
|
285
285
|
// }
|
@@ -301,18 +301,18 @@ bool FilterCombiner::HasFilters() {
|
|
301
301
|
// return checks;
|
302
302
|
// }
|
303
303
|
// case ExpressionType::COMPARE_EQUAL: {
|
304
|
-
// auto &comp_exp = (
|
304
|
+
// auto &comp_exp = filter->Cast<BoundComparisonExpression>();
|
305
305
|
// if ((comp_exp.left->expression_class == ExpressionClass::BOUND_COLUMN_REF &&
|
306
306
|
// comp_exp.right->expression_class == ExpressionClass::BOUND_CONSTANT)) {
|
307
|
-
// auto &column_ref =
|
308
|
-
// auto &constant_value_expr =
|
307
|
+
// auto &column_ref = comp_exp.left->Cast<BoundColumnRefExpression>();
|
308
|
+
// auto &constant_value_expr = comp_exp.right->Cast<BoundConstantExpression>();
|
309
309
|
// checks[column_ids[column_ref.binding.column_index]] = {&constant_value_expr.value,
|
310
310
|
// &constant_value_expr.value};
|
311
311
|
// }
|
312
312
|
// if ((comp_exp.left->expression_class == ExpressionClass::BOUND_CONSTANT &&
|
313
313
|
// comp_exp.right->expression_class == ExpressionClass::BOUND_COLUMN_REF)) {
|
314
|
-
// auto &column_ref =
|
315
|
-
// auto &constant_value_expr =
|
314
|
+
// auto &column_ref = comp_exp.right->Cast<BoundColumnRefExpression>();
|
315
|
+
// auto &constant_value_expr = comp_exp.left->Cast<BoundConstantExpression>();
|
316
316
|
// checks[column_ids[column_ref.binding.column_index]] = {&constant_value_expr.value,
|
317
317
|
// &constant_value_expr.value};
|
318
318
|
// }
|
@@ -320,34 +320,34 @@ bool FilterCombiner::HasFilters() {
|
|
320
320
|
// }
|
321
321
|
// case ExpressionType::COMPARE_LESSTHAN:
|
322
322
|
// case ExpressionType::COMPARE_LESSTHANOREQUALTO: {
|
323
|
-
// auto &comp_exp = (
|
323
|
+
// auto &comp_exp = filter->Cast<BoundComparisonExpression>();
|
324
324
|
// if ((comp_exp.left->expression_class == ExpressionClass::BOUND_COLUMN_REF &&
|
325
325
|
// comp_exp.right->expression_class == ExpressionClass::BOUND_CONSTANT)) {
|
326
|
-
// auto &column_ref =
|
327
|
-
// auto &constant_value_expr =
|
326
|
+
// auto &column_ref = comp_exp.left->Cast<BoundColumnRefExpression>();
|
327
|
+
// auto &constant_value_expr = comp_exp.right->Cast<BoundConstantExpression>();
|
328
328
|
// checks[column_ids[column_ref.binding.column_index]] = {nullptr, &constant_value_expr.value};
|
329
329
|
// }
|
330
330
|
// if ((comp_exp.left->expression_class == ExpressionClass::BOUND_CONSTANT &&
|
331
331
|
// comp_exp.right->expression_class == ExpressionClass::BOUND_COLUMN_REF)) {
|
332
|
-
// auto &column_ref =
|
333
|
-
// auto &constant_value_expr =
|
332
|
+
// auto &column_ref = comp_exp.right->Cast<BoundColumnRefExpression>();
|
333
|
+
// auto &constant_value_expr = comp_exp.left->Cast<BoundConstantExpression>();
|
334
334
|
// checks[column_ids[column_ref.binding.column_index]] = {&constant_value_expr.value, nullptr};
|
335
335
|
// }
|
336
336
|
// return checks;
|
337
337
|
// }
|
338
338
|
// case ExpressionType::COMPARE_GREATERTHANOREQUALTO:
|
339
339
|
// case ExpressionType::COMPARE_GREATERTHAN: {
|
340
|
-
// auto &comp_exp = (
|
340
|
+
// auto &comp_exp = filter->Cast<BoundComparisonExpression>();
|
341
341
|
// if ((comp_exp.left->expression_class == ExpressionClass::BOUND_COLUMN_REF &&
|
342
342
|
// comp_exp.right->expression_class == ExpressionClass::BOUND_CONSTANT)) {
|
343
|
-
// auto &column_ref =
|
344
|
-
// auto &constant_value_expr =
|
343
|
+
// auto &column_ref = comp_exp.left->Cast<BoundColumnRefExpression>();
|
344
|
+
// auto &constant_value_expr = comp_exp.right->Cast<BoundConstantExpression>();
|
345
345
|
// checks[column_ids[column_ref.binding.column_index]] = {&constant_value_expr.value, nullptr};
|
346
346
|
// }
|
347
347
|
// if ((comp_exp.left->expression_class == ExpressionClass::BOUND_CONSTANT &&
|
348
348
|
// comp_exp.right->expression_class == ExpressionClass::BOUND_COLUMN_REF)) {
|
349
|
-
// auto &column_ref =
|
350
|
-
// auto &constant_value_expr =
|
349
|
+
// auto &column_ref = comp_exp.right->Cast<BoundColumnRefExpression>();
|
350
|
+
// auto &constant_value_expr = comp_exp.left->Cast<BoundConstantExpression>();
|
351
351
|
// checks[column_ids[column_ref.binding.column_index]] = {nullptr, &constant_value_expr.value};
|
352
352
|
// }
|
353
353
|
// return checks;
|
@@ -435,13 +435,13 @@ TableFilterSet FilterCombiner::GenerateTableScanFilters(vector<idx_t> &column_id
|
|
435
435
|
for (idx_t rem_fil_idx = 0; rem_fil_idx < remaining_filters.size(); rem_fil_idx++) {
|
436
436
|
auto &remaining_filter = remaining_filters[rem_fil_idx];
|
437
437
|
if (remaining_filter->expression_class == ExpressionClass::BOUND_FUNCTION) {
|
438
|
-
auto &func = (
|
438
|
+
auto &func = remaining_filter->Cast<BoundFunctionExpression>();
|
439
439
|
if (func.function.name == "prefix" &&
|
440
440
|
func.children[0]->expression_class == ExpressionClass::BOUND_COLUMN_REF &&
|
441
441
|
func.children[1]->type == ExpressionType::VALUE_CONSTANT) {
|
442
442
|
//! This is a like function.
|
443
|
-
auto &column_ref =
|
444
|
-
auto &constant_value_expr =
|
443
|
+
auto &column_ref = func.children[0]->Cast<BoundColumnRefExpression>();
|
444
|
+
auto &constant_value_expr = func.children[1]->Cast<BoundConstantExpression>();
|
445
445
|
auto like_string = StringValue::Get(constant_value_expr.value);
|
446
446
|
if (like_string.empty()) {
|
447
447
|
continue;
|
@@ -459,8 +459,8 @@ TableFilterSet FilterCombiner::GenerateTableScanFilters(vector<idx_t> &column_id
|
|
459
459
|
if (func.function.name == "~~" && func.children[0]->expression_class == ExpressionClass::BOUND_COLUMN_REF &&
|
460
460
|
func.children[1]->type == ExpressionType::VALUE_CONSTANT) {
|
461
461
|
//! This is a like function.
|
462
|
-
auto &column_ref =
|
463
|
-
auto &constant_value_expr =
|
462
|
+
auto &column_ref = func.children[0]->Cast<BoundColumnRefExpression>();
|
463
|
+
auto &constant_value_expr = func.children[1]->Cast<BoundConstantExpression>();
|
464
464
|
auto &like_string = StringValue::Get(constant_value_expr.value);
|
465
465
|
if (like_string[0] == '%' || like_string[0] == '_') {
|
466
466
|
//! We have no prefix so nothing to pushdown
|
@@ -493,13 +493,13 @@ TableFilterSet FilterCombiner::GenerateTableScanFilters(vector<idx_t> &column_id
|
|
493
493
|
}
|
494
494
|
}
|
495
495
|
} else if (remaining_filter->type == ExpressionType::COMPARE_IN) {
|
496
|
-
auto &func = (
|
496
|
+
auto &func = remaining_filter->Cast<BoundOperatorExpression>();
|
497
497
|
vector<hugeint_t> in_values;
|
498
498
|
D_ASSERT(func.children.size() > 1);
|
499
499
|
if (func.children[0]->expression_class != ExpressionClass::BOUND_COLUMN_REF) {
|
500
500
|
continue;
|
501
501
|
}
|
502
|
-
auto &column_ref =
|
502
|
+
auto &column_ref = func.children[0]->Cast<BoundColumnRefExpression>();
|
503
503
|
auto column_index = column_ids[column_ref.binding.column_index];
|
504
504
|
if (column_index == COLUMN_IDENTIFIER_ROW_ID) {
|
505
505
|
break;
|
@@ -514,7 +514,7 @@ TableFilterSet FilterCombiner::GenerateTableScanFilters(vector<idx_t> &column_id
|
|
514
514
|
if (!children_constant) {
|
515
515
|
continue;
|
516
516
|
}
|
517
|
-
auto &fst_const_value_expr =
|
517
|
+
auto &fst_const_value_expr = func.children[1]->Cast<BoundConstantExpression>();
|
518
518
|
auto &type = fst_const_value_expr.value.type();
|
519
519
|
|
520
520
|
//! Check if values are consecutive, if yes transform them to >= <= (only for integers)
|
@@ -525,7 +525,7 @@ TableFilterSet FilterCombiner::GenerateTableScanFilters(vector<idx_t> &column_id
|
|
525
525
|
|
526
526
|
bool can_simplify_in_clause = true;
|
527
527
|
for (idx_t i = 1; i < func.children.size(); i++) {
|
528
|
-
auto &const_value_expr =
|
528
|
+
auto &const_value_expr = func.children[i]->Cast<BoundConstantExpression>();
|
529
529
|
if (const_value_expr.value.IsNull()) {
|
530
530
|
can_simplify_in_clause = false;
|
531
531
|
break;
|
@@ -573,7 +573,7 @@ static bool IsLessThan(ExpressionType type) {
|
|
573
573
|
}
|
574
574
|
|
575
575
|
FilterResult FilterCombiner::AddBoundComparisonFilter(Expression *expr) {
|
576
|
-
auto &comparison = (
|
576
|
+
auto &comparison = expr->Cast<BoundComparisonExpression>();
|
577
577
|
if (comparison.type != ExpressionType::COMPARE_LESSTHAN &&
|
578
578
|
comparison.type != ExpressionType::COMPARE_LESSTHANOREQUALTO &&
|
579
579
|
comparison.type != ExpressionType::COMPARE_GREATERTHAN &&
|
@@ -615,7 +615,8 @@ FilterResult FilterCombiner::AddBoundComparisonFilter(Expression *expr) {
|
|
615
615
|
auto transitive_filter = FindTransitiveFilter(non_scalar);
|
616
616
|
if (transitive_filter != nullptr) {
|
617
617
|
// try to add transitive filters
|
618
|
-
if (AddTransitiveFilters((
|
618
|
+
if (AddTransitiveFilters(transitive_filter->Cast<BoundComparisonExpression>()) ==
|
619
|
+
FilterResult::UNSUPPORTED) {
|
619
620
|
// in case of unsuccessful re-add filter into remaining ones
|
620
621
|
remaining_filters.push_back(std::move(transitive_filter));
|
621
622
|
}
|
@@ -691,7 +692,7 @@ FilterResult FilterCombiner::AddFilter(Expression *expr) {
|
|
691
692
|
}
|
692
693
|
D_ASSERT(!expr->IsFoldable());
|
693
694
|
if (expr->GetExpressionClass() == ExpressionClass::BOUND_BETWEEN) {
|
694
|
-
auto &comparison = (
|
695
|
+
auto &comparison = expr->Cast<BoundBetweenExpression>();
|
695
696
|
//! check if one of the sides is a scalar value
|
696
697
|
bool lower_is_scalar = comparison.lower->IsFoldable();
|
697
698
|
bool upper_is_scalar = comparison.upper->IsFoldable();
|
@@ -787,12 +788,12 @@ FilterResult FilterCombiner::AddTransitiveFilters(BoundComparisonExpression &com
|
|
787
788
|
Expression *right_node = GetNode(comparison.right.get());
|
788
789
|
// In case with filters like CAST(i) = j and i = 5 we replace the COLUMN_REF i with the constant 5
|
789
790
|
if (right_node->type == ExpressionType::OPERATOR_CAST) {
|
790
|
-
auto &bound_cast_expr = (
|
791
|
+
auto &bound_cast_expr = right_node->Cast<BoundCastExpression>();
|
791
792
|
if (bound_cast_expr.child->type == ExpressionType::BOUND_COLUMN_REF) {
|
792
|
-
auto &col_ref =
|
793
|
+
auto &col_ref = bound_cast_expr.child->Cast<BoundColumnRefExpression>();
|
793
794
|
for (auto &stored_exp : stored_expressions) {
|
794
795
|
if (stored_exp.first->type == ExpressionType::BOUND_COLUMN_REF) {
|
795
|
-
auto &st_col_ref =
|
796
|
+
auto &st_col_ref = stored_exp.second->Cast<BoundColumnRefExpression>();
|
796
797
|
if (st_col_ref.binding == col_ref.binding &&
|
797
798
|
bound_cast_expr.return_type == stored_exp.second->return_type) {
|
798
799
|
bound_cast_expr.child = stored_exp.second->Copy();
|
@@ -876,7 +877,8 @@ FilterResult FilterCombiner::AddTransitiveFilters(BoundComparisonExpression &com
|
|
876
877
|
auto transitive_filter = FindTransitiveFilter(comparison.left.get());
|
877
878
|
if (transitive_filter != nullptr) {
|
878
879
|
// try to add transitive filters
|
879
|
-
if (AddTransitiveFilters((
|
880
|
+
if (AddTransitiveFilters(transitive_filter->Cast<BoundComparisonExpression>()) ==
|
881
|
+
FilterResult::UNSUPPORTED) {
|
880
882
|
// in case of unsuccessful re-add filter into remaining ones
|
881
883
|
remaining_filters.push_back(std::move(transitive_filter));
|
882
884
|
}
|
@@ -897,8 +899,8 @@ unique_ptr<Expression> FilterCombiner::FindTransitiveFilter(Expression *expr) {
|
|
897
899
|
if (expr->type == ExpressionType::BOUND_COLUMN_REF) {
|
898
900
|
for (idx_t i = 0; i < remaining_filters.size(); i++) {
|
899
901
|
if (remaining_filters[i]->GetExpressionClass() == ExpressionClass::BOUND_COMPARISON) {
|
900
|
-
auto comparison =
|
901
|
-
if (expr->Equals(comparison
|
902
|
+
auto &comparison = remaining_filters[i]->Cast<BoundComparisonExpression>();
|
903
|
+
if (expr->Equals(comparison.right.get()) && comparison.type != ExpressionType::COMPARE_NOTEQUAL) {
|
902
904
|
auto filter = std::move(remaining_filters[i]);
|
903
905
|
remaining_filters.erase(remaining_filters.begin() + i);
|
904
906
|
return filter;
|
@@ -34,7 +34,7 @@ unique_ptr<LogicalOperator> FilterPullup::PullupJoin(unique_ptr<LogicalOperator>
|
|
34
34
|
D_ASSERT(op->type == LogicalOperatorType::LOGICAL_COMPARISON_JOIN ||
|
35
35
|
op->type == LogicalOperatorType::LOGICAL_ASOF_JOIN || op->type == LogicalOperatorType::LOGICAL_ANY_JOIN ||
|
36
36
|
op->type == LogicalOperatorType::LOGICAL_DELIM_JOIN);
|
37
|
-
auto &join = (
|
37
|
+
auto &join = op->Cast<LogicalJoin>();
|
38
38
|
|
39
39
|
switch (join.join_type) {
|
40
40
|
case JoinType::INNER:
|
@@ -51,7 +51,7 @@ unique_ptr<LogicalOperator> FilterPullup::PullupJoin(unique_ptr<LogicalOperator>
|
|
51
51
|
}
|
52
52
|
|
53
53
|
unique_ptr<LogicalOperator> FilterPullup::PullupInnerJoin(unique_ptr<LogicalOperator> op) {
|
54
|
-
D_ASSERT((
|
54
|
+
D_ASSERT(op->Cast<LogicalJoin>().join_type == JoinType::INNER);
|
55
55
|
if (op->type == LogicalOperatorType::LOGICAL_DELIM_JOIN) {
|
56
56
|
return op;
|
57
57
|
}
|
@@ -51,7 +51,7 @@ unique_ptr<LogicalOperator> FilterPushdown::PushdownJoin(unique_ptr<LogicalOpera
|
|
51
51
|
D_ASSERT(op->type == LogicalOperatorType::LOGICAL_COMPARISON_JOIN ||
|
52
52
|
op->type == LogicalOperatorType::LOGICAL_ASOF_JOIN || op->type == LogicalOperatorType::LOGICAL_ANY_JOIN ||
|
53
53
|
op->type == LogicalOperatorType::LOGICAL_DELIM_JOIN);
|
54
|
-
auto &join = (
|
54
|
+
auto &join = op->Cast<LogicalJoin>();
|
55
55
|
unordered_set<idx_t> left_bindings, right_bindings;
|
56
56
|
LogicalJoin::GetTableReferences(*op->children[0], left_bindings);
|
57
57
|
LogicalJoin::GetTableReferences(*op->children[1], right_bindings);
|
@@ -17,8 +17,8 @@ static TableCatalogEntry *GetCatalogTableEntry(LogicalOperator *op) {
|
|
17
17
|
return nullptr;
|
18
18
|
}
|
19
19
|
D_ASSERT(op->type == LogicalOperatorType::LOGICAL_GET);
|
20
|
-
auto get = (
|
21
|
-
TableCatalogEntry *entry = get
|
20
|
+
auto &get = op->Cast<LogicalGet>();
|
21
|
+
TableCatalogEntry *entry = get.GetTable();
|
22
22
|
return entry;
|
23
23
|
}
|
24
24
|
|
@@ -313,19 +313,19 @@ static LogicalGet *GetLogicalGet(LogicalOperator *op, idx_t table_index = DConst
|
|
313
313
|
break;
|
314
314
|
case LogicalOperatorType::LOGICAL_ASOF_JOIN:
|
315
315
|
case LogicalOperatorType::LOGICAL_COMPARISON_JOIN: {
|
316
|
-
LogicalComparisonJoin
|
316
|
+
LogicalComparisonJoin &join = op->Cast<LogicalComparisonJoin>();
|
317
317
|
// We should never be calling GetLogicalGet without a valid table_index.
|
318
318
|
// We are attempting to get the catalog table for a relation (for statistics/cardinality estimation)
|
319
319
|
// A logical join means there is a non-reorderable relation in the join plan. This means we need
|
320
320
|
// to know the exact table index to return.
|
321
321
|
D_ASSERT(table_index != DConstants::INVALID_INDEX);
|
322
|
-
if (join
|
323
|
-
auto child = join
|
322
|
+
if (join.join_type == JoinType::MARK || join.join_type == JoinType::LEFT) {
|
323
|
+
auto child = join.children.at(0).get();
|
324
324
|
get = GetLogicalGet(child, table_index);
|
325
325
|
if (get && get->table_index == table_index) {
|
326
326
|
return get;
|
327
327
|
}
|
328
|
-
child = join
|
328
|
+
child = join.children.at(1).get();
|
329
329
|
get = GetLogicalGet(child, table_index);
|
330
330
|
if (get && get->table_index == table_index) {
|
331
331
|
return get;
|
@@ -377,7 +377,7 @@ void CardinalityEstimator::InitCardinalityEstimatorProps(vector<NodeOp> *node_op
|
|
377
377
|
auto op = (*node_ops)[i].op;
|
378
378
|
join_node->SetBaseTableCardinality(op->EstimateCardinality(context));
|
379
379
|
if (op->type == LogicalOperatorType::LOGICAL_COMPARISON_JOIN) {
|
380
|
-
auto &join = (
|
380
|
+
auto &join = op->Cast<LogicalComparisonJoin>();
|
381
381
|
if (join.join_type == JoinType::LEFT) {
|
382
382
|
// If a base op is a Logical Comparison join it is probably a left join,
|
383
383
|
// so the cost of the larger table is a fine estimate.
|
@@ -559,7 +559,7 @@ idx_t CardinalityEstimator::InspectTableFilters(idx_t cardinality, LogicalOperat
|
|
559
559
|
for (auto &it : table_filters->filters) {
|
560
560
|
column_statistics = nullptr;
|
561
561
|
if (get->bind_data && get->function.name.compare("seq_scan") == 0) {
|
562
|
-
auto &table_scan_bind_data =
|
562
|
+
auto &table_scan_bind_data = get->bind_data->Cast<TableScanBindData>();
|
563
563
|
column_statistics = get->function.statistics(context, &table_scan_bind_data, it.first);
|
564
564
|
}
|
565
565
|
if (it.second->filter_type == TableFilterType::CONJUNCTION_AND) {
|