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
@@ -354,8 +354,8 @@ void PhysicalInsert::OnConflictHandling(TableCatalogEntry *table, ExecutionConte
|
|
354
354
|
|
355
355
|
SinkResultType PhysicalInsert::Sink(ExecutionContext &context, GlobalSinkState &state, LocalSinkState &lstate_p,
|
356
356
|
DataChunk &chunk) const {
|
357
|
-
auto &gstate = (
|
358
|
-
auto &lstate = (
|
357
|
+
auto &gstate = state.Cast<InsertGlobalState>();
|
358
|
+
auto &lstate = lstate_p.Cast<InsertLocalState>();
|
359
359
|
|
360
360
|
auto table = gstate.table;
|
361
361
|
auto &storage = table->GetStorage();
|
@@ -398,8 +398,8 @@ SinkResultType PhysicalInsert::Sink(ExecutionContext &context, GlobalSinkState &
|
|
398
398
|
}
|
399
399
|
|
400
400
|
void PhysicalInsert::Combine(ExecutionContext &context, GlobalSinkState &gstate_p, LocalSinkState &lstate_p) const {
|
401
|
-
auto &gstate = (
|
402
|
-
auto &lstate = (
|
401
|
+
auto &gstate = gstate_p.Cast<InsertGlobalState>();
|
402
|
+
auto &lstate = lstate_p.Cast<InsertLocalState>();
|
403
403
|
auto &client_profiler = QueryProfiler::Get(context.client);
|
404
404
|
context.thread.profiler.Flush(this, &lstate.default_executor, "default_executor", 1);
|
405
405
|
client_profiler.Flush(context.thread.profiler);
|
@@ -443,7 +443,7 @@ void PhysicalInsert::Combine(ExecutionContext &context, GlobalSinkState &gstate_
|
|
443
443
|
|
444
444
|
SinkFinalizeType PhysicalInsert::Finalize(Pipeline &pipeline, Event &event, ClientContext &context,
|
445
445
|
GlobalSinkState &state) const {
|
446
|
-
auto &gstate = (
|
446
|
+
auto &gstate = state.Cast<InsertGlobalState>();
|
447
447
|
if (!parallel && gstate.initialized) {
|
448
448
|
auto table = gstate.table;
|
449
449
|
auto &storage = table->GetStorage();
|
@@ -460,7 +460,7 @@ public:
|
|
460
460
|
explicit InsertSourceState(const PhysicalInsert &op) : finished(false) {
|
461
461
|
if (op.return_chunk) {
|
462
462
|
D_ASSERT(op.sink_state);
|
463
|
-
auto &g =
|
463
|
+
auto &g = op.sink_state->Cast<InsertGlobalState>();
|
464
464
|
g.return_collection.InitializeScan(scan_state);
|
465
465
|
}
|
466
466
|
}
|
@@ -475,8 +475,8 @@ unique_ptr<GlobalSourceState> PhysicalInsert::GetGlobalSourceState(ClientContext
|
|
475
475
|
|
476
476
|
void PhysicalInsert::GetData(ExecutionContext &context, DataChunk &chunk, GlobalSourceState &gstate,
|
477
477
|
LocalSourceState &lstate) const {
|
478
|
-
auto &state = (
|
479
|
-
auto &insert_gstate = (
|
478
|
+
auto &state = gstate.Cast<InsertSourceState>();
|
479
|
+
auto &insert_gstate = sink_state->Cast<InsertGlobalState>();
|
480
480
|
if (state.finished) {
|
481
481
|
return;
|
482
482
|
}
|
@@ -58,8 +58,8 @@ public:
|
|
58
58
|
|
59
59
|
SinkResultType PhysicalUpdate::Sink(ExecutionContext &context, GlobalSinkState &state, LocalSinkState &lstate,
|
60
60
|
DataChunk &chunk) const {
|
61
|
-
auto &gstate = (
|
62
|
-
auto &ustate = (
|
61
|
+
auto &gstate = state.Cast<UpdateGlobalState>();
|
62
|
+
auto &ustate = lstate.Cast<UpdateLocalState>();
|
63
63
|
|
64
64
|
DataChunk &update_chunk = ustate.update_chunk;
|
65
65
|
DataChunk &mock_chunk = ustate.mock_chunk;
|
@@ -80,7 +80,7 @@ SinkResultType PhysicalUpdate::Sink(ExecutionContext &context, GlobalSinkState &
|
|
80
80
|
} else {
|
81
81
|
D_ASSERT(expressions[i]->type == ExpressionType::BOUND_REF);
|
82
82
|
// index into child chunk
|
83
|
-
auto &binding =
|
83
|
+
auto &binding = expressions[i]->Cast<BoundReferenceExpression>();
|
84
84
|
update_chunk.data[i].Reference(chunk.data[binding.index]);
|
85
85
|
}
|
86
86
|
}
|
@@ -141,7 +141,7 @@ unique_ptr<LocalSinkState> PhysicalUpdate::GetLocalSinkState(ExecutionContext &c
|
|
141
141
|
}
|
142
142
|
|
143
143
|
void PhysicalUpdate::Combine(ExecutionContext &context, GlobalSinkState &gstate, LocalSinkState &lstate) const {
|
144
|
-
auto &state = (
|
144
|
+
auto &state = lstate.Cast<UpdateLocalState>();
|
145
145
|
auto &client_profiler = QueryProfiler::Get(context.client);
|
146
146
|
context.thread.profiler.Flush(this, &state.default_executor, "default_executor", 1);
|
147
147
|
client_profiler.Flush(context.thread.profiler);
|
@@ -155,7 +155,7 @@ public:
|
|
155
155
|
explicit UpdateSourceState(const PhysicalUpdate &op) : finished(false) {
|
156
156
|
if (op.return_chunk) {
|
157
157
|
D_ASSERT(op.sink_state);
|
158
|
-
auto &g =
|
158
|
+
auto &g = op.sink_state->Cast<UpdateGlobalState>();
|
159
159
|
g.return_collection.InitializeScan(scan_state);
|
160
160
|
}
|
161
161
|
}
|
@@ -170,8 +170,8 @@ unique_ptr<GlobalSourceState> PhysicalUpdate::GetGlobalSourceState(ClientContext
|
|
170
170
|
|
171
171
|
void PhysicalUpdate::GetData(ExecutionContext &context, DataChunk &chunk, GlobalSourceState &gstate,
|
172
172
|
LocalSourceState &lstate) const {
|
173
|
-
auto &state = (
|
174
|
-
auto &g = (
|
173
|
+
auto &state = gstate.Cast<UpdateSourceState>();
|
174
|
+
auto &g = sink_state->Cast<UpdateGlobalState>();
|
175
175
|
if (state.finished) {
|
176
176
|
return;
|
177
177
|
}
|
@@ -0,0 +1,81 @@
|
|
1
|
+
#include "duckdb/execution/operator/projection/physical_pivot.hpp"
|
2
|
+
#include "duckdb/planner/expression/bound_aggregate_expression.hpp"
|
3
|
+
|
4
|
+
namespace duckdb {
|
5
|
+
|
6
|
+
PhysicalPivot::PhysicalPivot(vector<LogicalType> types_p, unique_ptr<PhysicalOperator> child,
|
7
|
+
BoundPivotInfo bound_pivot_p)
|
8
|
+
: PhysicalOperator(PhysicalOperatorType::PIVOT, std::move(types_p), child->estimated_cardinality),
|
9
|
+
bound_pivot(std::move(bound_pivot_p)) {
|
10
|
+
children.push_back(std::move(child));
|
11
|
+
for (idx_t p = 0; p < bound_pivot.pivot_values.size(); p++) {
|
12
|
+
auto entry = pivot_map.find(bound_pivot.pivot_values[p]);
|
13
|
+
if (entry != pivot_map.end()) {
|
14
|
+
continue;
|
15
|
+
}
|
16
|
+
pivot_map[bound_pivot.pivot_values[p]] = bound_pivot.group_count + p;
|
17
|
+
}
|
18
|
+
// extract the empty aggregate expressions
|
19
|
+
for (auto &aggr_expr : bound_pivot.aggregates) {
|
20
|
+
auto &aggr = (BoundAggregateExpression &)*aggr_expr;
|
21
|
+
// for each aggregate, initialize an empty aggregate state and finalize it immediately
|
22
|
+
auto state = unique_ptr<data_t[]>(new data_t[aggr.function.state_size()]);
|
23
|
+
aggr.function.initialize(state.get());
|
24
|
+
Vector state_vector(Value::POINTER((uintptr_t)state.get()));
|
25
|
+
Vector result_vector(aggr_expr->return_type);
|
26
|
+
AggregateInputData aggr_input_data(aggr.bind_info.get(), Allocator::DefaultAllocator());
|
27
|
+
aggr.function.finalize(state_vector, aggr_input_data, result_vector, 1, 0);
|
28
|
+
empty_aggregates.push_back(result_vector.GetValue(0));
|
29
|
+
}
|
30
|
+
}
|
31
|
+
|
32
|
+
OperatorResultType PhysicalPivot::Execute(ExecutionContext &context, DataChunk &input, DataChunk &chunk,
|
33
|
+
GlobalOperatorState &gstate, OperatorState &state) const {
|
34
|
+
// copy the groups as-is
|
35
|
+
for (idx_t i = 0; i < bound_pivot.group_count; i++) {
|
36
|
+
chunk.data[i].Reference(input.data[i]);
|
37
|
+
}
|
38
|
+
auto pivot_column_lists = FlatVector::GetData<list_entry_t>(input.data.back());
|
39
|
+
auto &pivot_column_values = ListVector::GetEntry(input.data.back());
|
40
|
+
auto pivot_columns = FlatVector::GetData<string_t>(pivot_column_values);
|
41
|
+
|
42
|
+
// initialize all aggregate columns with the empty aggregate value
|
43
|
+
// if there are multiple aggregates the columns are in order of [AGGR1][AGGR2][AGGR1][AGGR2]
|
44
|
+
// so we need to alternate the empty_aggregate that we use
|
45
|
+
idx_t aggregate = 0;
|
46
|
+
for (idx_t c = bound_pivot.group_count; c < chunk.ColumnCount(); c++) {
|
47
|
+
chunk.data[c].Reference(empty_aggregates[aggregate]);
|
48
|
+
chunk.data[c].Flatten(input.size());
|
49
|
+
aggregate++;
|
50
|
+
if (aggregate >= empty_aggregates.size()) {
|
51
|
+
aggregate = 0;
|
52
|
+
}
|
53
|
+
}
|
54
|
+
|
55
|
+
// move the pivots to the given columns
|
56
|
+
for (idx_t r = 0; r < input.size(); r++) {
|
57
|
+
auto list = pivot_column_lists[r];
|
58
|
+
for (idx_t l = 0; l < list.length; l++) {
|
59
|
+
// figure out the column value number of this list
|
60
|
+
auto &column_name = pivot_columns[list.offset + l];
|
61
|
+
auto entry = pivot_map.find(column_name);
|
62
|
+
if (entry == pivot_map.end()) {
|
63
|
+
// column entry not found in map - that means this element is explicitly excluded from the pivot list
|
64
|
+
continue;
|
65
|
+
}
|
66
|
+
auto column_idx = entry->second;
|
67
|
+
for (idx_t aggr = 0; aggr < empty_aggregates.size(); aggr++) {
|
68
|
+
auto pivot_value_lists = FlatVector::GetData<list_entry_t>(input.data[bound_pivot.group_count + aggr]);
|
69
|
+
auto &pivot_value_child = ListVector::GetEntry(input.data[bound_pivot.group_count + aggr]);
|
70
|
+
if (list.offset != pivot_value_lists[r].offset || list.length != pivot_value_lists[r].length) {
|
71
|
+
throw InternalException("Pivot - unaligned lists between values and columns!?");
|
72
|
+
}
|
73
|
+
chunk.data[column_idx + aggr].SetValue(r, pivot_value_child.GetValue(list.offset + l));
|
74
|
+
}
|
75
|
+
}
|
76
|
+
}
|
77
|
+
chunk.SetCardinality(input.size());
|
78
|
+
return OperatorResultType::NEED_MORE_INPUT;
|
79
|
+
}
|
80
|
+
|
81
|
+
} // namespace duckdb
|
@@ -31,7 +31,7 @@ PhysicalTableInOutFunction::PhysicalTableInOutFunction(vector<LogicalType> types
|
|
31
31
|
}
|
32
32
|
|
33
33
|
unique_ptr<OperatorState> PhysicalTableInOutFunction::GetOperatorState(ExecutionContext &context) const {
|
34
|
-
auto &gstate = (
|
34
|
+
auto &gstate = op_state->Cast<TableInOutGlobalState>();
|
35
35
|
auto result = make_uniq<TableInOutLocalState>();
|
36
36
|
if (function.init_local) {
|
37
37
|
TableFunctionInitInput input(bind_data.get(), column_ids, vector<idx_t>(), nullptr);
|
@@ -54,8 +54,8 @@ unique_ptr<GlobalOperatorState> PhysicalTableInOutFunction::GetGlobalOperatorSta
|
|
54
54
|
|
55
55
|
OperatorResultType PhysicalTableInOutFunction::Execute(ExecutionContext &context, DataChunk &input, DataChunk &chunk,
|
56
56
|
GlobalOperatorState &gstate_p, OperatorState &state_p) const {
|
57
|
-
auto &gstate = (
|
58
|
-
auto &state = (
|
57
|
+
auto &gstate = gstate_p.Cast<TableInOutGlobalState>();
|
58
|
+
auto &state = state_p.Cast<TableInOutLocalState>();
|
59
59
|
TableFunctionInput data(bind_data.get(), state.local_state.get(), gstate.global_state.get());
|
60
60
|
if (projected_input.empty()) {
|
61
61
|
// straightforward case - no need to project input
|
@@ -102,8 +102,8 @@ OperatorResultType PhysicalTableInOutFunction::Execute(ExecutionContext &context
|
|
102
102
|
OperatorFinalizeResultType PhysicalTableInOutFunction::FinalExecute(ExecutionContext &context, DataChunk &chunk,
|
103
103
|
GlobalOperatorState &gstate_p,
|
104
104
|
OperatorState &state_p) const {
|
105
|
-
auto &gstate = (
|
106
|
-
auto &state = (
|
105
|
+
auto &gstate = gstate_p.Cast<TableInOutGlobalState>();
|
106
|
+
auto &state = state_p.Cast<TableInOutLocalState>();
|
107
107
|
if (!projected_input.empty()) {
|
108
108
|
throw InternalException("FinalExecute not supported for project_input");
|
109
109
|
}
|
@@ -19,9 +19,9 @@ public:
|
|
19
19
|
vector<LogicalType> list_data_types;
|
20
20
|
for (auto &exp : select_list) {
|
21
21
|
D_ASSERT(exp->type == ExpressionType::BOUND_UNNEST);
|
22
|
-
auto bue =
|
23
|
-
list_data_types.push_back(bue
|
24
|
-
executor.AddExpression(*bue
|
22
|
+
auto &bue = exp->Cast<BoundUnnestExpression>();
|
23
|
+
list_data_types.push_back(bue.child->return_type);
|
24
|
+
executor.AddExpression(*bue.child.get());
|
25
25
|
}
|
26
26
|
|
27
27
|
auto &allocator = Allocator::Get(context);
|
@@ -56,7 +56,6 @@ void UnnestOperatorState::Reset() {
|
|
56
56
|
}
|
57
57
|
|
58
58
|
void UnnestOperatorState::SetLongestListLength() {
|
59
|
-
|
60
59
|
longest_list_length = 0;
|
61
60
|
for (idx_t col_idx = 0; col_idx < list_data.ColumnCount(); col_idx++) {
|
62
61
|
|
@@ -257,7 +256,7 @@ OperatorResultType PhysicalUnnest::ExecuteInternal(ExecutionContext &context, Da
|
|
257
256
|
const vector<unique_ptr<Expression>> &select_list,
|
258
257
|
bool include_input) {
|
259
258
|
|
260
|
-
auto &state = (
|
259
|
+
auto &state = state_p.Cast<UnnestOperatorState>();
|
261
260
|
|
262
261
|
do {
|
263
262
|
// prepare the input data by executing any expressions and getting the
|
@@ -22,7 +22,7 @@ unique_ptr<GlobalSourceState> PhysicalColumnDataScan::GetGlobalSourceState(Clien
|
|
22
22
|
|
23
23
|
void PhysicalColumnDataScan::GetData(ExecutionContext &context, DataChunk &chunk, GlobalSourceState &gstate,
|
24
24
|
LocalSourceState &lstate) const {
|
25
|
-
auto &state = (
|
25
|
+
auto &state = gstate.Cast<PhysicalColumnDataScanState>();
|
26
26
|
D_ASSERT(collection);
|
27
27
|
if (collection->Count() == 0) {
|
28
28
|
return;
|
@@ -139,7 +139,7 @@ public:
|
|
139
139
|
|
140
140
|
unique_ptr<LocalSourceState> PhysicalPositionalScan::GetLocalSourceState(ExecutionContext &context,
|
141
141
|
GlobalSourceState &gstate) const {
|
142
|
-
return make_uniq<PositionalScanLocalSourceState>(context, (
|
142
|
+
return make_uniq<PositionalScanLocalSourceState>(context, gstate.Cast<PositionalScanGlobalSourceState>(), *this);
|
143
143
|
}
|
144
144
|
|
145
145
|
unique_ptr<GlobalSourceState> PhysicalPositionalScan::GetGlobalSourceState(ClientContext &context) const {
|
@@ -148,7 +148,7 @@ unique_ptr<GlobalSourceState> PhysicalPositionalScan::GetGlobalSourceState(Clien
|
|
148
148
|
|
149
149
|
void PhysicalPositionalScan::GetData(ExecutionContext &context, DataChunk &output, GlobalSourceState &gstate_p,
|
150
150
|
LocalSourceState &lstate_p) const {
|
151
|
-
auto &lstate = (
|
151
|
+
auto &lstate = lstate_p.Cast<PositionalScanLocalSourceState>();
|
152
152
|
|
153
153
|
// Find the longest source block
|
154
154
|
idx_t count = 0;
|
@@ -171,7 +171,7 @@ void PhysicalPositionalScan::GetData(ExecutionContext &context, DataChunk &outpu
|
|
171
171
|
}
|
172
172
|
|
173
173
|
double PhysicalPositionalScan::GetProgress(ClientContext &context, GlobalSourceState &gstate_p) const {
|
174
|
-
auto &gstate = (
|
174
|
+
auto &gstate = gstate_p.Cast<PositionalScanGlobalSourceState>();
|
175
175
|
|
176
176
|
double result = child_tables[0]->GetProgress(context, *gstate.global_states[0]);
|
177
177
|
for (size_t t = 1; t < child_tables.size(); ++t) {
|
@@ -186,7 +186,7 @@ bool PhysicalPositionalScan::Equals(const PhysicalOperator &other_p) const {
|
|
186
186
|
return false;
|
187
187
|
}
|
188
188
|
|
189
|
-
auto &other = (
|
189
|
+
auto &other = other_p.Cast<PhysicalPositionalScan>();
|
190
190
|
if (child_tables.size() != other.child_tables.size()) {
|
191
191
|
return false;
|
192
192
|
}
|
@@ -66,7 +66,7 @@ public:
|
|
66
66
|
|
67
67
|
unique_ptr<LocalSourceState> PhysicalTableScan::GetLocalSourceState(ExecutionContext &context,
|
68
68
|
GlobalSourceState &gstate) const {
|
69
|
-
return make_uniq<TableScanLocalSourceState>(context, (
|
69
|
+
return make_uniq<TableScanLocalSourceState>(context, gstate.Cast<TableScanGlobalSourceState>(), *this);
|
70
70
|
}
|
71
71
|
|
72
72
|
unique_ptr<GlobalSourceState> PhysicalTableScan::GetGlobalSourceState(ClientContext &context) const {
|
@@ -76,15 +76,15 @@ unique_ptr<GlobalSourceState> PhysicalTableScan::GetGlobalSourceState(ClientCont
|
|
76
76
|
void PhysicalTableScan::GetData(ExecutionContext &context, DataChunk &chunk, GlobalSourceState &gstate_p,
|
77
77
|
LocalSourceState &lstate) const {
|
78
78
|
D_ASSERT(!column_ids.empty());
|
79
|
-
auto &gstate = (
|
80
|
-
auto &state = (
|
79
|
+
auto &gstate = gstate_p.Cast<TableScanGlobalSourceState>();
|
80
|
+
auto &state = lstate.Cast<TableScanLocalSourceState>();
|
81
81
|
|
82
82
|
TableFunctionInput data(bind_data.get(), state.local_state.get(), gstate.global_state.get());
|
83
83
|
function.function(context.client, data, chunk);
|
84
84
|
}
|
85
85
|
|
86
86
|
double PhysicalTableScan::GetProgress(ClientContext &context, GlobalSourceState &gstate_p) const {
|
87
|
-
auto &gstate = (
|
87
|
+
auto &gstate = gstate_p.Cast<TableScanGlobalSourceState>();
|
88
88
|
if (function.table_scan_progress) {
|
89
89
|
return function.table_scan_progress(context, bind_data.get(), gstate.global_state.get());
|
90
90
|
}
|
@@ -96,8 +96,8 @@ idx_t PhysicalTableScan::GetBatchIndex(ExecutionContext &context, DataChunk &chu
|
|
96
96
|
LocalSourceState &lstate) const {
|
97
97
|
D_ASSERT(SupportsBatchIndex());
|
98
98
|
D_ASSERT(function.get_batch_index);
|
99
|
-
auto &gstate = (
|
100
|
-
auto &state = (
|
99
|
+
auto &gstate = gstate_p.Cast<TableScanGlobalSourceState>();
|
100
|
+
auto &state = lstate.Cast<TableScanLocalSourceState>();
|
101
101
|
return function.get_batch_index(context.client, bind_data.get(), state.local_state.get(),
|
102
102
|
gstate.global_state.get());
|
103
103
|
}
|
@@ -156,7 +156,7 @@ bool PhysicalTableScan::Equals(const PhysicalOperator &other_p) const {
|
|
156
156
|
if (type != other_p.type) {
|
157
157
|
return false;
|
158
158
|
}
|
159
|
-
auto &other = (
|
159
|
+
auto &other = other_p.Cast<PhysicalTableScan>();
|
160
160
|
if (function.function != other.function.function) {
|
161
161
|
return false;
|
162
162
|
}
|
@@ -21,7 +21,7 @@ unique_ptr<GlobalSourceState> PhysicalAlter::GetGlobalSourceState(ClientContext
|
|
21
21
|
|
22
22
|
void PhysicalAlter::GetData(ExecutionContext &context, DataChunk &chunk, GlobalSourceState &gstate,
|
23
23
|
LocalSourceState &lstate) const {
|
24
|
-
auto &state = (
|
24
|
+
auto &state = gstate.Cast<AlterSourceState>();
|
25
25
|
if (state.finished) {
|
26
26
|
return;
|
27
27
|
}
|
@@ -26,7 +26,7 @@ unique_ptr<GlobalSourceState> PhysicalAttach::GetGlobalSourceState(ClientContext
|
|
26
26
|
|
27
27
|
void PhysicalAttach::GetData(ExecutionContext &context, DataChunk &chunk, GlobalSourceState &gstate,
|
28
28
|
LocalSourceState &lstate) const {
|
29
|
-
auto &state = (
|
29
|
+
auto &state = gstate.Cast<AttachSourceState>();
|
30
30
|
if (state.finished) {
|
31
31
|
return;
|
32
32
|
}
|
@@ -22,7 +22,7 @@ unique_ptr<GlobalSourceState> PhysicalCreateFunction::GetGlobalSourceState(Clien
|
|
22
22
|
|
23
23
|
void PhysicalCreateFunction::GetData(ExecutionContext &context, DataChunk &chunk, GlobalSourceState &gstate,
|
24
24
|
LocalSourceState &lstate) const {
|
25
|
-
auto &state = (
|
25
|
+
auto &state = gstate.Cast<CreateFunctionSourceState>();
|
26
26
|
if (state.finished) {
|
27
27
|
return;
|
28
28
|
}
|
@@ -14,7 +14,8 @@ PhysicalCreateIndex::PhysicalCreateIndex(LogicalOperator &op, TableCatalogEntry
|
|
14
14
|
vector<unique_ptr<Expression>> unbound_expressions,
|
15
15
|
idx_t estimated_cardinality)
|
16
16
|
: PhysicalOperator(PhysicalOperatorType::CREATE_INDEX, op.types, estimated_cardinality),
|
17
|
-
table((
|
17
|
+
table(table_p.Cast<DuckTableEntry>()), info(std::move(info)),
|
18
|
+
unbound_expressions(std::move(unbound_expressions)) {
|
18
19
|
D_ASSERT(table_p.IsDuckTable());
|
19
20
|
// convert virtual column ids to storage column ids
|
20
21
|
for (auto &column_id : column_ids) {
|
@@ -87,7 +88,7 @@ SinkResultType PhysicalCreateIndex::Sink(ExecutionContext &context, GlobalSinkSt
|
|
87
88
|
DataChunk &input) const {
|
88
89
|
|
89
90
|
D_ASSERT(input.ColumnCount() >= 2);
|
90
|
-
auto &lstate = (
|
91
|
+
auto &lstate = lstate_p.Cast<CreateIndexLocalSinkState>();
|
91
92
|
auto &row_identifiers = input.data[input.ColumnCount() - 1];
|
92
93
|
|
93
94
|
// generate the keys for the given input
|
@@ -104,7 +105,7 @@ SinkResultType PhysicalCreateIndex::Sink(ExecutionContext &context, GlobalSinkSt
|
|
104
105
|
}
|
105
106
|
|
106
107
|
// merge into the local ART
|
107
|
-
if (!lstate.local_index->MergeIndexes(art
|
108
|
+
if (!lstate.local_index->MergeIndexes(*art)) {
|
108
109
|
throw ConstraintException("Data contains duplicates on indexed column(s)");
|
109
110
|
}
|
110
111
|
return SinkResultType::NEED_MORE_INPUT;
|
@@ -113,11 +114,11 @@ SinkResultType PhysicalCreateIndex::Sink(ExecutionContext &context, GlobalSinkSt
|
|
113
114
|
void PhysicalCreateIndex::Combine(ExecutionContext &context, GlobalSinkState &gstate_p,
|
114
115
|
LocalSinkState &lstate_p) const {
|
115
116
|
|
116
|
-
auto &gstate = (
|
117
|
-
auto &lstate = (
|
117
|
+
auto &gstate = gstate_p.Cast<CreateIndexGlobalSinkState>();
|
118
|
+
auto &lstate = lstate_p.Cast<CreateIndexLocalSinkState>();
|
118
119
|
|
119
120
|
// merge the local index into the global index
|
120
|
-
if (!gstate.global_index->MergeIndexes(lstate.local_index
|
121
|
+
if (!gstate.global_index->MergeIndexes(*lstate.local_index)) {
|
121
122
|
throw ConstraintException("Data contains duplicates on indexed column(s)");
|
122
123
|
}
|
123
124
|
}
|
@@ -127,7 +128,7 @@ SinkFinalizeType PhysicalCreateIndex::Finalize(Pipeline &pipeline, Event &event,
|
|
127
128
|
|
128
129
|
// here, we just set the resulting global index as the newly created index of the table
|
129
130
|
|
130
|
-
auto &state = (
|
131
|
+
auto &state = gstate_p.Cast<CreateIndexGlobalSinkState>();
|
131
132
|
auto &storage = table.GetStorage();
|
132
133
|
if (!storage.IsRoot()) {
|
133
134
|
throw TransactionException("Transaction conflict: cannot add an index to a table that has been altered!");
|
@@ -20,7 +20,7 @@ unique_ptr<GlobalSourceState> PhysicalCreateSchema::GetGlobalSourceState(ClientC
|
|
20
20
|
|
21
21
|
void PhysicalCreateSchema::GetData(ExecutionContext &context, DataChunk &chunk, GlobalSourceState &gstate,
|
22
22
|
LocalSourceState &lstate) const {
|
23
|
-
auto &state = (
|
23
|
+
auto &state = gstate.Cast<CreateSchemaSourceState>();
|
24
24
|
if (state.finished) {
|
25
25
|
return;
|
26
26
|
}
|
@@ -20,7 +20,7 @@ unique_ptr<GlobalSourceState> PhysicalCreateSequence::GetGlobalSourceState(Clien
|
|
20
20
|
|
21
21
|
void PhysicalCreateSequence::GetData(ExecutionContext &context, DataChunk &chunk, GlobalSourceState &gstate,
|
22
22
|
LocalSourceState &lstate) const {
|
23
|
-
auto &state = (
|
23
|
+
auto &state = gstate.Cast<CreateSequenceSourceState>();
|
24
24
|
if (state.finished) {
|
25
25
|
return;
|
26
26
|
}
|
@@ -30,7 +30,7 @@ unique_ptr<GlobalSourceState> PhysicalCreateTable::GetGlobalSourceState(ClientCo
|
|
30
30
|
|
31
31
|
void PhysicalCreateTable::GetData(ExecutionContext &context, DataChunk &chunk, GlobalSourceState &gstate,
|
32
32
|
LocalSourceState &lstate) const {
|
33
|
-
auto &state = (
|
33
|
+
auto &state = gstate.Cast<CreateTableSourceState>();
|
34
34
|
if (state.finished) {
|
35
35
|
return;
|
36
36
|
}
|
@@ -28,7 +28,7 @@ unique_ptr<GlobalSinkState> PhysicalCreateType::GetGlobalSinkState(ClientContext
|
|
28
28
|
|
29
29
|
SinkResultType PhysicalCreateType::Sink(ExecutionContext &context, GlobalSinkState &gstate_p, LocalSinkState &lstate_p,
|
30
30
|
DataChunk &input) const {
|
31
|
-
auto &gstate = (
|
31
|
+
auto &gstate = gstate_p.Cast<CreateTypeGlobalState>();
|
32
32
|
idx_t total_row_count = gstate.size + input.size();
|
33
33
|
if (total_row_count > NumericLimits<uint32_t>::Maximum()) {
|
34
34
|
throw InvalidInputException("Attempted to create ENUM of size %llu, which exceeds the maximum size of %llu",
|
@@ -74,14 +74,14 @@ unique_ptr<GlobalSourceState> PhysicalCreateType::GetGlobalSourceState(ClientCon
|
|
74
74
|
|
75
75
|
void PhysicalCreateType::GetData(ExecutionContext &context, DataChunk &chunk, GlobalSourceState &gstate,
|
76
76
|
LocalSourceState &lstate) const {
|
77
|
-
auto &state = (
|
77
|
+
auto &state = gstate.Cast<CreateTypeSourceState>();
|
78
78
|
if (state.finished) {
|
79
79
|
return;
|
80
80
|
}
|
81
81
|
|
82
82
|
if (IsSink()) {
|
83
83
|
D_ASSERT(info->type == LogicalType::INVALID);
|
84
|
-
auto &g_sink_state = (
|
84
|
+
auto &g_sink_state = sink_state->Cast<CreateTypeGlobalState>();
|
85
85
|
info->type = LogicalType::ENUM(info->name, g_sink_state.result, g_sink_state.size);
|
86
86
|
}
|
87
87
|
|
@@ -20,7 +20,7 @@ unique_ptr<GlobalSourceState> PhysicalCreateView::GetGlobalSourceState(ClientCon
|
|
20
20
|
|
21
21
|
void PhysicalCreateView::GetData(ExecutionContext &context, DataChunk &chunk, GlobalSourceState &gstate,
|
22
22
|
LocalSourceState &lstate) const {
|
23
|
-
auto &state = (
|
23
|
+
auto &state = gstate.Cast<CreateViewSourceState>();
|
24
24
|
if (state.finished) {
|
25
25
|
return;
|
26
26
|
}
|
@@ -25,7 +25,7 @@ unique_ptr<GlobalSourceState> PhysicalDetach::GetGlobalSourceState(ClientContext
|
|
25
25
|
|
26
26
|
void PhysicalDetach::GetData(ExecutionContext &context, DataChunk &chunk, GlobalSourceState &gstate,
|
27
27
|
LocalSourceState &lstate) const {
|
28
|
-
auto &state = (
|
28
|
+
auto &state = gstate.Cast<DetachSourceState>();
|
29
29
|
if (state.finished) {
|
30
30
|
return;
|
31
31
|
}
|
@@ -25,7 +25,7 @@ unique_ptr<GlobalSourceState> PhysicalDrop::GetGlobalSourceState(ClientContext &
|
|
25
25
|
|
26
26
|
void PhysicalDrop::GetData(ExecutionContext &context, DataChunk &chunk, GlobalSourceState &gstate,
|
27
27
|
LocalSourceState &lstate) const {
|
28
|
-
auto &state = (
|
28
|
+
auto &state = gstate.Cast<DropSourceState>();
|
29
29
|
if (state.finished) {
|
30
30
|
return;
|
31
31
|
}
|
@@ -63,7 +63,7 @@ idx_t PhysicalRecursiveCTE::ProbeHT(DataChunk &chunk, RecursiveCTEState &state)
|
|
63
63
|
|
64
64
|
SinkResultType PhysicalRecursiveCTE::Sink(ExecutionContext &context, GlobalSinkState &state, LocalSinkState &lstate,
|
65
65
|
DataChunk &input) const {
|
66
|
-
auto &gstate = (
|
66
|
+
auto &gstate = state.Cast<RecursiveCTEState>();
|
67
67
|
if (!union_all) {
|
68
68
|
idx_t match_count = ProbeHT(input, gstate);
|
69
69
|
if (match_count > 0) {
|
@@ -80,7 +80,7 @@ SinkResultType PhysicalRecursiveCTE::Sink(ExecutionContext &context, GlobalSinkS
|
|
80
80
|
//===--------------------------------------------------------------------===//
|
81
81
|
void PhysicalRecursiveCTE::GetData(ExecutionContext &context, DataChunk &chunk, GlobalSourceState &gstate_p,
|
82
82
|
LocalSourceState &lstate) const {
|
83
|
-
auto &gstate = (
|
83
|
+
auto &gstate = sink_state->Cast<RecursiveCTEState>();
|
84
84
|
if (!gstate.initialized) {
|
85
85
|
gstate.intermediate_table.InitializeScan(gstate.scan_state);
|
86
86
|
gstate.finished_scan = false;
|
@@ -243,7 +243,7 @@ CachingPhysicalOperator::CachingPhysicalOperator(PhysicalOperatorType type, vect
|
|
243
243
|
|
244
244
|
OperatorResultType CachingPhysicalOperator::Execute(ExecutionContext &context, DataChunk &input, DataChunk &chunk,
|
245
245
|
GlobalOperatorState &gstate, OperatorState &state_p) const {
|
246
|
-
auto &state = (
|
246
|
+
auto &state = state_p.Cast<CachingOperatorState>();
|
247
247
|
|
248
248
|
// Execute child operator
|
249
249
|
auto child_result = ExecuteInternal(context, input, chunk, gstate, state);
|
@@ -297,7 +297,7 @@ OperatorResultType CachingPhysicalOperator::Execute(ExecutionContext &context, D
|
|
297
297
|
OperatorFinalizeResultType CachingPhysicalOperator::FinalExecute(ExecutionContext &context, DataChunk &chunk,
|
298
298
|
GlobalOperatorState &gstate,
|
299
299
|
OperatorState &state_p) const {
|
300
|
-
auto &state = (
|
300
|
+
auto &state = state_p.Cast<CachingOperatorState>();
|
301
301
|
if (state.cached_chunk) {
|
302
302
|
chunk.Move(*state.cached_chunk);
|
303
303
|
state.cached_chunk.reset();
|
@@ -107,7 +107,7 @@ static bool CanUsePerfectHashAggregate(ClientContext &context, LogicalAggregate
|
|
107
107
|
}
|
108
108
|
}
|
109
109
|
for (auto &expression : op.expressions) {
|
110
|
-
auto &aggregate = (
|
110
|
+
auto &aggregate = expression->Cast<BoundAggregateExpression>();
|
111
111
|
if (aggregate.IsDistinct() || !aggregate.function.combine) {
|
112
112
|
// distinct aggregates are not supported in perfect hash aggregates
|
113
113
|
return false;
|
@@ -129,7 +129,7 @@ unique_ptr<PhysicalOperator> PhysicalPlanGenerator::CreatePlan(LogicalAggregate
|
|
129
129
|
// special case: aggregate entire columns together
|
130
130
|
bool use_simple_aggregation = true;
|
131
131
|
for (auto &expression : op.expressions) {
|
132
|
-
auto &aggregate = (
|
132
|
+
auto &aggregate = expression->Cast<BoundAggregateExpression>();
|
133
133
|
if (!aggregate.function.simple_update) {
|
134
134
|
// unsupported aggregate for simple aggregation: use hash aggregation
|
135
135
|
use_simple_aggregation = false;
|
@@ -170,7 +170,7 @@ PhysicalPlanGenerator::ExtractAggregateExpressions(unique_ptr<PhysicalOperator>
|
|
170
170
|
|
171
171
|
// bind sorted aggregates
|
172
172
|
for (auto &aggr : aggregates) {
|
173
|
-
auto &bound_aggr = (
|
173
|
+
auto &bound_aggr = aggr->Cast<BoundAggregateExpression>();
|
174
174
|
if (bound_aggr.order_bys) {
|
175
175
|
// sorted aggregate!
|
176
176
|
FunctionBinder::BindSortedAggregate(context, bound_aggr, groups);
|
@@ -183,7 +183,7 @@ PhysicalPlanGenerator::ExtractAggregateExpressions(unique_ptr<PhysicalOperator>
|
|
183
183
|
group = std::move(ref);
|
184
184
|
}
|
185
185
|
for (auto &aggr : aggregates) {
|
186
|
-
auto &bound_aggr = (
|
186
|
+
auto &bound_aggr = aggr->Cast<BoundAggregateExpression>();
|
187
187
|
for (auto &child : bound_aggr.children) {
|
188
188
|
auto ref = make_uniq<BoundReferenceExpression>(child->return_type, expressions.size());
|
189
189
|
types.push_back(child->return_type);
|
@@ -168,7 +168,7 @@ Index *CheckIndexJoin(ClientContext &context, LogicalComparisonJoin &op, Physica
|
|
168
168
|
if (plan.type != PhysicalOperatorType::TABLE_SCAN) {
|
169
169
|
return nullptr;
|
170
170
|
}
|
171
|
-
auto &tbl_scan = (
|
171
|
+
auto &tbl_scan = plan.Cast<PhysicalTableScan>();
|
172
172
|
auto tbl = dynamic_cast<TableScanBindData *>(tbl_scan.bind_data.get());
|
173
173
|
Index *result = nullptr;
|
174
174
|
if (CanPlanIndexJoin(context, tbl, tbl_scan)) {
|
@@ -230,7 +230,7 @@ static bool PlanIndexJoin(ClientContext &context, LogicalComparisonJoin &op, uni
|
|
230
230
|
|
231
231
|
static void RewriteJoinCondition(Expression &expr, idx_t offset) {
|
232
232
|
if (expr.type == ExpressionType::BOUND_REF) {
|
233
|
-
auto &ref = (
|
233
|
+
auto &ref = expr.Cast<BoundReferenceExpression>();
|
234
234
|
ref.index += offset;
|
235
235
|
}
|
236
236
|
ExpressionIterator::EnumerateChildren(expr, [&](Expression &child) { RewriteJoinCondition(child, offset); });
|
@@ -36,7 +36,7 @@ unique_ptr<PhysicalOperator> PhysicalPlanGenerator::CreatePlan(LogicalCreateInde
|
|
36
36
|
unique_ptr<TableFilterSet> table_filters;
|
37
37
|
op.info->column_ids.emplace_back(COLUMN_IDENTIFIER_ROW_ID);
|
38
38
|
|
39
|
-
auto &bind_data =
|
39
|
+
auto &bind_data = op.bind_data->Cast<TableScanBindData>();
|
40
40
|
bind_data.is_create_index = true;
|
41
41
|
|
42
42
|
auto table_scan =
|
@@ -10,7 +10,7 @@ namespace duckdb {
|
|
10
10
|
unique_ptr<PhysicalOperator> DuckCatalog::PlanDelete(ClientContext &context, LogicalDelete &op,
|
11
11
|
unique_ptr<PhysicalOperator> plan) {
|
12
12
|
// get the index of the row_id column
|
13
|
-
auto &bound_ref =
|
13
|
+
auto &bound_ref = op.expressions[0]->Cast<BoundReferenceExpression>();
|
14
14
|
|
15
15
|
auto del = make_uniq<PhysicalDelete>(op.types, *op.table, op.table->GetStorage(), bound_ref.index,
|
16
16
|
op.estimated_cardinality, op.return_chunk);
|
@@ -22,7 +22,7 @@ static void GatherDelimScans(PhysicalOperator *op, vector<PhysicalOperator *> &d
|
|
22
22
|
|
23
23
|
unique_ptr<PhysicalOperator> PhysicalPlanGenerator::CreatePlan(LogicalDelimJoin &op) {
|
24
24
|
// first create the underlying join
|
25
|
-
auto plan = CreatePlan((
|
25
|
+
auto plan = CreatePlan(op.Cast<LogicalComparisonJoin>());
|
26
26
|
// this should create a join, not a cross product
|
27
27
|
D_ASSERT(plan && plan->type != PhysicalOperatorType::CROSS_PRODUCT);
|
28
28
|
// duplicate eliminated join
|
@@ -39,7 +39,7 @@ unique_ptr<PhysicalOperator> PhysicalPlanGenerator::CreatePlan(LogicalDelimJoin
|
|
39
39
|
vector<unique_ptr<Expression>> distinct_groups, distinct_expressions;
|
40
40
|
for (auto &delim_expr : op.duplicate_eliminated_columns) {
|
41
41
|
D_ASSERT(delim_expr->type == ExpressionType::BOUND_REF);
|
42
|
-
auto &bound_ref = (
|
42
|
+
auto &bound_ref = delim_expr->Cast<BoundReferenceExpression>();
|
43
43
|
delim_types.push_back(bound_ref.return_type);
|
44
44
|
distinct_groups.push_back(make_uniq<BoundReferenceExpression>(bound_ref.return_type, bound_ref.index));
|
45
45
|
}
|