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
@@ -36,22 +36,22 @@
|
|
36
36
|
|
37
37
|
namespace duckdb {
|
38
38
|
|
39
|
-
void FindForeignKeyInformation(CatalogEntry
|
39
|
+
void FindForeignKeyInformation(CatalogEntry &entry, AlterForeignKeyType alter_fk_type,
|
40
40
|
vector<unique_ptr<AlterForeignKeyInfo>> &fk_arrays) {
|
41
|
-
if (entry
|
41
|
+
if (entry.type != CatalogType::TABLE_ENTRY) {
|
42
42
|
return;
|
43
43
|
}
|
44
|
-
auto
|
45
|
-
auto &constraints = table_entry
|
44
|
+
auto &table_entry = entry.Cast<TableCatalogEntry>();
|
45
|
+
auto &constraints = table_entry.GetConstraints();
|
46
46
|
for (idx_t i = 0; i < constraints.size(); i++) {
|
47
47
|
auto &cond = constraints[i];
|
48
48
|
if (cond->type != ConstraintType::FOREIGN_KEY) {
|
49
49
|
continue;
|
50
50
|
}
|
51
|
-
auto &fk = (
|
51
|
+
auto &fk = cond->Cast<ForeignKeyConstraint>();
|
52
52
|
if (fk.info.type == ForeignKeyType::FK_TYPE_FOREIGN_KEY_TABLE) {
|
53
|
-
AlterEntryData alter_data(entry
|
54
|
-
fk_arrays.push_back(make_uniq<AlterForeignKeyInfo>(std::move(alter_data), entry
|
53
|
+
AlterEntryData alter_data(entry.catalog->GetName(), fk.info.schema, fk.info.table, false);
|
54
|
+
fk_arrays.push_back(make_uniq<AlterForeignKeyInfo>(std::move(alter_data), entry.name, fk.pk_columns,
|
55
55
|
fk.fk_columns, fk.info.pk_keys, fk.info.fk_keys,
|
56
56
|
alter_fk_type));
|
57
57
|
} else if (fk.info.type == ForeignKeyType::FK_TYPE_PRIMARY_KEY_TABLE &&
|
@@ -114,7 +114,7 @@ CatalogEntry *DuckSchemaEntry::CreateTable(CatalogTransaction transaction, Bound
|
|
114
114
|
|
115
115
|
// add a foreign key constraint in main key table if there is a foreign key constraint
|
116
116
|
vector<unique_ptr<AlterForeignKeyInfo>> fk_arrays;
|
117
|
-
FindForeignKeyInformation(entry, AlterForeignKeyType::AFT_ADD, fk_arrays);
|
117
|
+
FindForeignKeyInformation(*entry, AlterForeignKeyType::AFT_ADD, fk_arrays);
|
118
118
|
for (idx_t i = 0; i < fk_arrays.size(); i++) {
|
119
119
|
// alter primary key table
|
120
120
|
AlterForeignKeyInfo *fk_info = fk_arrays[i].get();
|
@@ -266,7 +266,7 @@ void DuckSchemaEntry::DropEntry(ClientContext &context, DropInfo *info) {
|
|
266
266
|
|
267
267
|
// if there is a foreign key constraint, get that information
|
268
268
|
vector<unique_ptr<AlterForeignKeyInfo>> fk_arrays;
|
269
|
-
FindForeignKeyInformation(existing_entry, AlterForeignKeyType::AFT_DELETE, fk_arrays);
|
269
|
+
FindForeignKeyInformation(*existing_entry, AlterForeignKeyType::AFT_DELETE, fk_arrays);
|
270
270
|
|
271
271
|
if (!set.DropEntry(transaction, info->name, info->cascade, info->allow_drop_internal)) {
|
272
272
|
throw InternalException("Could not drop element because of an internal error");
|
@@ -81,7 +81,7 @@ DuckTableEntry::DuckTableEntry(Catalog *catalog, SchemaCatalogEntry *schema, Bou
|
|
81
81
|
auto &constraint = bound_constraints[i];
|
82
82
|
if (constraint->type == ConstraintType::UNIQUE) {
|
83
83
|
// unique constraint: create a unique index
|
84
|
-
auto &unique = (
|
84
|
+
auto &unique = constraint->Cast<BoundUniqueConstraint>();
|
85
85
|
IndexConstraintType constraint_type = IndexConstraintType::UNIQUE;
|
86
86
|
if (unique.is_primary_key) {
|
87
87
|
constraint_type = IndexConstraintType::PRIMARY;
|
@@ -94,7 +94,7 @@ DuckTableEntry::DuckTableEntry(Catalog *catalog, SchemaCatalogEntry *schema, Bou
|
|
94
94
|
}
|
95
95
|
} else if (constraint->type == ConstraintType::FOREIGN_KEY) {
|
96
96
|
// foreign key constraint: create a foreign key index
|
97
|
-
auto &bfk = (
|
97
|
+
auto &bfk = constraint->Cast<BoundForeignKeyConstraint>();
|
98
98
|
if (bfk.info.type == ForeignKeyType::FK_TYPE_FOREIGN_KEY_TABLE ||
|
99
99
|
bfk.info.type == ForeignKeyType::FK_TYPE_SELF_REFERENCE_TABLE) {
|
100
100
|
if (info->indexes.empty()) {
|
@@ -191,7 +191,7 @@ void DuckTableEntry::UndoAlter(ClientContext &context, AlterInfo *info) {
|
|
191
191
|
|
192
192
|
static void RenameExpression(ParsedExpression &expr, RenameColumnInfo &info) {
|
193
193
|
if (expr.type == ExpressionType::COLUMN_REF) {
|
194
|
-
auto &colref = (
|
194
|
+
auto &colref = expr.Cast<ColumnRefExpression>();
|
195
195
|
if (colref.column_names.back() == info.old_name) {
|
196
196
|
colref.column_names.back() = info.new_name;
|
197
197
|
}
|
@@ -225,13 +225,13 @@ unique_ptr<CatalogEntry> DuckTableEntry::RenameColumn(ClientContext &context, Re
|
|
225
225
|
break;
|
226
226
|
case ConstraintType::CHECK: {
|
227
227
|
// CHECK constraint: need to rename column references that refer to the renamed column
|
228
|
-
auto &check = (
|
228
|
+
auto &check = copy->Cast<CheckConstraint>();
|
229
229
|
RenameExpression(*check.expression, info);
|
230
230
|
break;
|
231
231
|
}
|
232
232
|
case ConstraintType::UNIQUE: {
|
233
233
|
// UNIQUE constraint: possibly need to rename columns
|
234
|
-
auto &unique = (
|
234
|
+
auto &unique = copy->Cast<UniqueConstraint>();
|
235
235
|
for (idx_t i = 0; i < unique.columns.size(); i++) {
|
236
236
|
if (unique.columns[i] == info.old_name) {
|
237
237
|
unique.columns[i] = info.new_name;
|
@@ -241,7 +241,7 @@ unique_ptr<CatalogEntry> DuckTableEntry::RenameColumn(ClientContext &context, Re
|
|
241
241
|
}
|
242
242
|
case ConstraintType::FOREIGN_KEY: {
|
243
243
|
// FOREIGN KEY constraint: possibly need to rename columns
|
244
|
-
auto &fk = (
|
244
|
+
auto &fk = copy->Cast<ForeignKeyConstraint>();
|
245
245
|
vector<string> columns = fk.pk_columns;
|
246
246
|
if (fk.info.type == ForeignKeyType::FK_TYPE_FOREIGN_KEY_TABLE) {
|
247
247
|
columns = fk.fk_columns;
|
@@ -312,7 +312,7 @@ void DuckTableEntry::UpdateConstraintsOnColumnDrop(const LogicalIndex &removed_i
|
|
312
312
|
auto &bound_constraint = bound_constraints[constr_idx];
|
313
313
|
switch (constraint->type) {
|
314
314
|
case ConstraintType::NOT_NULL: {
|
315
|
-
auto ¬_null_constraint = (
|
315
|
+
auto ¬_null_constraint = bound_constraint->Cast<BoundNotNullConstraint>();
|
316
316
|
auto not_null_index = columns.PhysicalToLogical(not_null_constraint.index);
|
317
317
|
if (not_null_index != removed_index) {
|
318
318
|
// the constraint is not about this column: we need to copy it
|
@@ -325,7 +325,7 @@ void DuckTableEntry::UpdateConstraintsOnColumnDrop(const LogicalIndex &removed_i
|
|
325
325
|
case ConstraintType::CHECK: {
|
326
326
|
// Generated columns can not be part of an index
|
327
327
|
// CHECK constraint
|
328
|
-
auto &bound_check = (
|
328
|
+
auto &bound_check = bound_constraint->Cast<BoundCheckConstraint>();
|
329
329
|
// check if the removed column is part of the check constraint
|
330
330
|
if (is_generated) {
|
331
331
|
// generated columns can not be referenced by constraints, we can just add the constraint back
|
@@ -350,7 +350,7 @@ void DuckTableEntry::UpdateConstraintsOnColumnDrop(const LogicalIndex &removed_i
|
|
350
350
|
}
|
351
351
|
case ConstraintType::UNIQUE: {
|
352
352
|
auto copy = constraint->Copy();
|
353
|
-
auto &unique = (
|
353
|
+
auto &unique = copy->Cast<UniqueConstraint>();
|
354
354
|
if (unique.index.index != DConstants::INVALID_INDEX) {
|
355
355
|
if (unique.index == removed_index) {
|
356
356
|
throw CatalogException(
|
@@ -364,7 +364,7 @@ void DuckTableEntry::UpdateConstraintsOnColumnDrop(const LogicalIndex &removed_i
|
|
364
364
|
}
|
365
365
|
case ConstraintType::FOREIGN_KEY: {
|
366
366
|
auto copy = constraint->Copy();
|
367
|
-
auto &fk = (
|
367
|
+
auto &fk = copy->Cast<ForeignKeyConstraint>();
|
368
368
|
vector<string> columns = fk.pk_columns;
|
369
369
|
if (fk.info.type == ForeignKeyType::FK_TYPE_FOREIGN_KEY_TABLE) {
|
370
370
|
columns = fk.fk_columns;
|
@@ -478,7 +478,7 @@ unique_ptr<CatalogEntry> DuckTableEntry::SetNotNull(ClientContext &context, SetN
|
|
478
478
|
for (idx_t i = 0; i < constraints.size(); i++) {
|
479
479
|
auto constraint = constraints[i]->Copy();
|
480
480
|
if (constraint->type == ConstraintType::NOT_NULL) {
|
481
|
-
auto ¬_null = (
|
481
|
+
auto ¬_null = constraint->Cast<NotNullConstraint>();
|
482
482
|
if (not_null.index == not_null_idx) {
|
483
483
|
has_not_null = true;
|
484
484
|
}
|
@@ -511,7 +511,7 @@ unique_ptr<CatalogEntry> DuckTableEntry::DropNotNull(ClientContext &context, Dro
|
|
511
511
|
auto constraint = constraints[i]->Copy();
|
512
512
|
// Skip/drop not_null
|
513
513
|
if (constraint->type == ConstraintType::NOT_NULL) {
|
514
|
-
auto ¬_null = (
|
514
|
+
auto ¬_null = constraint->Cast<NotNullConstraint>();
|
515
515
|
if (not_null.index == not_null_idx) {
|
516
516
|
continue;
|
517
517
|
}
|
@@ -555,7 +555,7 @@ unique_ptr<CatalogEntry> DuckTableEntry::ChangeColumnType(ClientContext &context
|
|
555
555
|
auto constraint = constraints[i]->Copy();
|
556
556
|
switch (constraint->type) {
|
557
557
|
case ConstraintType::CHECK: {
|
558
|
-
auto &bound_check =
|
558
|
+
auto &bound_check = bound_constraints[i]->Cast<BoundCheckConstraint>();
|
559
559
|
auto physical_index = columns.LogicalToPhysical(change_idx);
|
560
560
|
if (bound_check.bound_columns.find(physical_index) != bound_check.bound_columns.end()) {
|
561
561
|
throw BinderException("Cannot change the type of a column that has a CHECK constraint specified");
|
@@ -565,7 +565,7 @@ unique_ptr<CatalogEntry> DuckTableEntry::ChangeColumnType(ClientContext &context
|
|
565
565
|
case ConstraintType::NOT_NULL:
|
566
566
|
break;
|
567
567
|
case ConstraintType::UNIQUE: {
|
568
|
-
auto &bound_unique =
|
568
|
+
auto &bound_unique = bound_constraints[i]->Cast<BoundUniqueConstraint>();
|
569
569
|
if (bound_unique.key_set.find(change_idx) != bound_unique.key_set.end()) {
|
570
570
|
throw BinderException(
|
571
571
|
"Cannot change the type of a column that has a UNIQUE or PRIMARY KEY constraint specified");
|
@@ -573,7 +573,7 @@ unique_ptr<CatalogEntry> DuckTableEntry::ChangeColumnType(ClientContext &context
|
|
573
573
|
break;
|
574
574
|
}
|
575
575
|
case ConstraintType::FOREIGN_KEY: {
|
576
|
-
auto &bfk =
|
576
|
+
auto &bfk = bound_constraints[i]->Cast<BoundForeignKeyConstraint>();
|
577
577
|
auto key_set = bfk.pk_key_set;
|
578
578
|
if (bfk.info.type == ForeignKeyType::FK_TYPE_FOREIGN_KEY_TABLE) {
|
579
579
|
key_set = bfk.fk_key_set;
|
@@ -649,7 +649,7 @@ unique_ptr<CatalogEntry> DuckTableEntry::DropForeignKeyConstraint(ClientContext
|
|
649
649
|
for (idx_t i = 0; i < constraints.size(); i++) {
|
650
650
|
auto constraint = constraints[i]->Copy();
|
651
651
|
if (constraint->type == ConstraintType::FOREIGN_KEY) {
|
652
|
-
ForeignKeyConstraint &fk = (
|
652
|
+
ForeignKeyConstraint &fk = constraint->Cast<ForeignKeyConstraint>();
|
653
653
|
if (fk.info.type == ForeignKeyType::FK_TYPE_PRIMARY_KEY_TABLE && fk.info.table == info.fk_table) {
|
654
654
|
continue;
|
655
655
|
}
|
@@ -663,7 +663,7 @@ unique_ptr<CatalogEntry> DuckTableEntry::DropForeignKeyConstraint(ClientContext
|
|
663
663
|
return make_uniq<DuckTableEntry>(catalog, schema, (BoundCreateTableInfo *)bound_create_info.get(), storage);
|
664
664
|
}
|
665
665
|
|
666
|
-
unique_ptr<CatalogEntry> DuckTableEntry::Copy(ClientContext &context) {
|
666
|
+
unique_ptr<CatalogEntry> DuckTableEntry::Copy(ClientContext &context) const {
|
667
667
|
auto create_info = make_uniq<CreateTableInfo>(schema, name);
|
668
668
|
create_info->columns = columns.Copy();
|
669
669
|
|
@@ -9,17 +9,17 @@ IndexCatalogEntry::IndexCatalogEntry(Catalog *catalog, SchemaCatalogEntry *schem
|
|
9
9
|
this->temporary = info->temporary;
|
10
10
|
}
|
11
11
|
|
12
|
-
string IndexCatalogEntry::ToSQL() {
|
12
|
+
string IndexCatalogEntry::ToSQL() const {
|
13
13
|
if (sql.empty()) {
|
14
14
|
return sql;
|
15
15
|
}
|
16
16
|
if (sql[sql.size() - 1] != ';') {
|
17
|
-
sql
|
17
|
+
return sql + ";";
|
18
18
|
}
|
19
19
|
return sql;
|
20
20
|
}
|
21
21
|
|
22
|
-
void IndexCatalogEntry::Serialize(Serializer &serializer) {
|
22
|
+
void IndexCatalogEntry::Serialize(Serializer &serializer) const {
|
23
23
|
// here we serialize the index metadata in the following order:
|
24
24
|
// schema name, table name, index name, sql, index type, index constraint type, expression list, parsed expressions,
|
25
25
|
// column IDs
|
@@ -19,7 +19,7 @@ ScalarMacroCatalogEntry::ScalarMacroCatalogEntry(Catalog *catalog, SchemaCatalog
|
|
19
19
|
: MacroCatalogEntry(catalog, schema, info) {
|
20
20
|
}
|
21
21
|
|
22
|
-
void ScalarMacroCatalogEntry::Serialize(Serializer &main_serializer) {
|
22
|
+
void ScalarMacroCatalogEntry::Serialize(Serializer &main_serializer) const {
|
23
23
|
D_ASSERT(!internal);
|
24
24
|
auto &scalar_function = (ScalarMacroFunction &)*function;
|
25
25
|
FieldWriter writer(main_serializer);
|
@@ -62,7 +62,7 @@ TableMacroCatalogEntry::TableMacroCatalogEntry(Catalog *catalog, SchemaCatalogEn
|
|
62
62
|
: MacroCatalogEntry(catalog, schema, info) {
|
63
63
|
}
|
64
64
|
|
65
|
-
void TableMacroCatalogEntry::Serialize(Serializer &main_serializer) {
|
65
|
+
void TableMacroCatalogEntry::Serialize(Serializer &main_serializer) const {
|
66
66
|
D_ASSERT(!internal);
|
67
67
|
FieldWriter writer(main_serializer);
|
68
68
|
|
@@ -33,7 +33,7 @@ SimilarCatalogEntry SchemaCatalogEntry::GetSimilarEntry(CatalogTransaction trans
|
|
33
33
|
return result;
|
34
34
|
}
|
35
35
|
|
36
|
-
void SchemaCatalogEntry::Serialize(Serializer &serializer) {
|
36
|
+
void SchemaCatalogEntry::Serialize(Serializer &serializer) const {
|
37
37
|
FieldWriter writer(serializer);
|
38
38
|
writer.WriteString(name);
|
39
39
|
writer.Finalize();
|
@@ -49,7 +49,7 @@ unique_ptr<CreateSchemaInfo> SchemaCatalogEntry::Deserialize(Deserializer &sourc
|
|
49
49
|
return info;
|
50
50
|
}
|
51
51
|
|
52
|
-
string SchemaCatalogEntry::ToSQL() {
|
52
|
+
string SchemaCatalogEntry::ToSQL() const {
|
53
53
|
std::stringstream ss;
|
54
54
|
ss << "CREATE SCHEMA " << name << ";";
|
55
55
|
return ss.str();
|
@@ -18,7 +18,7 @@ SequenceCatalogEntry::SequenceCatalogEntry(Catalog *catalog, SchemaCatalogEntry
|
|
18
18
|
this->temporary = info->temporary;
|
19
19
|
}
|
20
20
|
|
21
|
-
void SequenceCatalogEntry::Serialize(Serializer &serializer) {
|
21
|
+
void SequenceCatalogEntry::Serialize(Serializer &serializer) const {
|
22
22
|
FieldWriter writer(serializer);
|
23
23
|
writer.WriteString(schema->name);
|
24
24
|
writer.WriteString(name);
|
@@ -48,7 +48,7 @@ unique_ptr<CreateSequenceInfo> SequenceCatalogEntry::Deserialize(Deserializer &s
|
|
48
48
|
return info;
|
49
49
|
}
|
50
50
|
|
51
|
-
string SequenceCatalogEntry::ToSQL() {
|
51
|
+
string SequenceCatalogEntry::ToSQL() const {
|
52
52
|
std::stringstream ss;
|
53
53
|
ss << "CREATE SEQUENCE ";
|
54
54
|
ss << name;
|
@@ -51,7 +51,7 @@ vector<LogicalType> TableCatalogEntry::GetTypes() {
|
|
51
51
|
return types;
|
52
52
|
}
|
53
53
|
|
54
|
-
void TableCatalogEntry::Serialize(Serializer &serializer) {
|
54
|
+
void TableCatalogEntry::Serialize(Serializer &serializer) const {
|
55
55
|
D_ASSERT(!internal);
|
56
56
|
|
57
57
|
FieldWriter writer(serializer);
|
@@ -88,10 +88,10 @@ string TableCatalogEntry::ColumnsToSQL(const ColumnList &columns, const vector<u
|
|
88
88
|
vector<string> extra_constraints;
|
89
89
|
for (auto &constraint : constraints) {
|
90
90
|
if (constraint->type == ConstraintType::NOT_NULL) {
|
91
|
-
auto ¬_null = (
|
91
|
+
auto ¬_null = constraint->Cast<NotNullConstraint>();
|
92
92
|
not_null_columns.insert(not_null.index);
|
93
93
|
} else if (constraint->type == ConstraintType::UNIQUE) {
|
94
|
-
auto &pk = (
|
94
|
+
auto &pk = constraint->Cast<UniqueConstraint>();
|
95
95
|
vector<string> constraint_columns = pk.columns;
|
96
96
|
if (pk.index.index != DConstants::INVALID_INDEX) {
|
97
97
|
// no columns specified: single column constraint
|
@@ -111,7 +111,7 @@ string TableCatalogEntry::ColumnsToSQL(const ColumnList &columns, const vector<u
|
|
111
111
|
extra_constraints.push_back(constraint->ToString());
|
112
112
|
}
|
113
113
|
} else if (constraint->type == ConstraintType::FOREIGN_KEY) {
|
114
|
-
auto &fk = (
|
114
|
+
auto &fk = constraint->Cast<ForeignKeyConstraint>();
|
115
115
|
if (fk.info.type == ForeignKeyType::FK_TYPE_FOREIGN_KEY_TABLE ||
|
116
116
|
fk.info.type == ForeignKeyType::FK_TYPE_SELF_REFERENCE_TABLE) {
|
117
117
|
extra_constraints.push_back(constraint->ToString());
|
@@ -160,7 +160,7 @@ string TableCatalogEntry::ColumnsToSQL(const ColumnList &columns, const vector<u
|
|
160
160
|
return ss.str();
|
161
161
|
}
|
162
162
|
|
163
|
-
string TableCatalogEntry::ToSQL() {
|
163
|
+
string TableCatalogEntry::ToSQL() const {
|
164
164
|
std::stringstream ss;
|
165
165
|
|
166
166
|
ss << "CREATE TABLE ";
|
@@ -18,7 +18,7 @@ TypeCatalogEntry::TypeCatalogEntry(Catalog *catalog, SchemaCatalogEntry *schema,
|
|
18
18
|
this->internal = info->internal;
|
19
19
|
}
|
20
20
|
|
21
|
-
void TypeCatalogEntry::Serialize(Serializer &serializer) {
|
21
|
+
void TypeCatalogEntry::Serialize(Serializer &serializer) const {
|
22
22
|
D_ASSERT(!internal);
|
23
23
|
FieldWriter writer(serializer);
|
24
24
|
writer.WriteString(schema->name);
|
@@ -45,7 +45,7 @@ unique_ptr<CreateTypeInfo> TypeCatalogEntry::Deserialize(Deserializer &source) {
|
|
45
45
|
return info;
|
46
46
|
}
|
47
47
|
|
48
|
-
string TypeCatalogEntry::ToSQL() {
|
48
|
+
string TypeCatalogEntry::ToSQL() const {
|
49
49
|
std::stringstream ss;
|
50
50
|
switch (user_type.id()) {
|
51
51
|
case (LogicalTypeId::ENUM): {
|
@@ -43,7 +43,7 @@ unique_ptr<CatalogEntry> ViewCatalogEntry::AlterEntry(ClientContext &context, Al
|
|
43
43
|
}
|
44
44
|
}
|
45
45
|
|
46
|
-
void ViewCatalogEntry::Serialize(Serializer &serializer) {
|
46
|
+
void ViewCatalogEntry::Serialize(Serializer &serializer) const {
|
47
47
|
D_ASSERT(!internal);
|
48
48
|
FieldWriter writer(serializer);
|
49
49
|
writer.WriteString(schema->name);
|
@@ -70,7 +70,7 @@ unique_ptr<CreateViewInfo> ViewCatalogEntry::Deserialize(Deserializer &source, C
|
|
70
70
|
return info;
|
71
71
|
}
|
72
72
|
|
73
|
-
string ViewCatalogEntry::ToSQL() {
|
73
|
+
string ViewCatalogEntry::ToSQL() const {
|
74
74
|
if (sql.empty()) {
|
75
75
|
//! Return empty sql with view name so pragma view_tables don't complain
|
76
76
|
return sql;
|
@@ -78,7 +78,7 @@ string ViewCatalogEntry::ToSQL() {
|
|
78
78
|
return sql + "\n;";
|
79
79
|
}
|
80
80
|
|
81
|
-
unique_ptr<CatalogEntry> ViewCatalogEntry::Copy(ClientContext &context) {
|
81
|
+
unique_ptr<CatalogEntry> ViewCatalogEntry::Copy(ClientContext &context) const {
|
82
82
|
D_ASSERT(!internal);
|
83
83
|
auto create_info = make_uniq<CreateViewInfo>(schema, name);
|
84
84
|
create_info->query = unique_ptr_cast<SQLStatement, SelectStatement>(query->Copy());
|
@@ -23,11 +23,11 @@ unique_ptr<CatalogEntry> CatalogEntry::AlterEntry(ClientContext &context, AlterI
|
|
23
23
|
void CatalogEntry::UndoAlter(ClientContext &context, AlterInfo *info) {
|
24
24
|
}
|
25
25
|
|
26
|
-
unique_ptr<CatalogEntry> CatalogEntry::Copy(ClientContext &context) {
|
26
|
+
unique_ptr<CatalogEntry> CatalogEntry::Copy(ClientContext &context) const {
|
27
27
|
throw InternalException("Unsupported copy type for catalog entry!");
|
28
28
|
}
|
29
29
|
|
30
|
-
string CatalogEntry::ToSQL() {
|
30
|
+
string CatalogEntry::ToSQL() const {
|
31
31
|
throw InternalException("Unsupported catalog type for ToSQL()");
|
32
32
|
}
|
33
33
|
// LCOV_EXCL_STOP
|
@@ -541,30 +541,30 @@ CatalogEntry *CatalogSet::GetEntry(ClientContext &context, const string &name) {
|
|
541
541
|
return GetEntry(catalog.GetCatalogTransaction(context), name);
|
542
542
|
}
|
543
543
|
|
544
|
-
void CatalogSet::UpdateTimestamp(CatalogEntry
|
545
|
-
entry
|
546
|
-
mapping[entry
|
544
|
+
void CatalogSet::UpdateTimestamp(CatalogEntry &entry, transaction_t timestamp) {
|
545
|
+
entry.timestamp = timestamp;
|
546
|
+
mapping[entry.name]->timestamp = timestamp;
|
547
547
|
}
|
548
548
|
|
549
|
-
void CatalogSet::AdjustUserDependency(CatalogEntry
|
549
|
+
void CatalogSet::AdjustUserDependency(CatalogEntry &entry, ColumnDefinition &column, bool remove) {
|
550
550
|
CatalogEntry *user_type_catalog = (CatalogEntry *)LogicalType::GetCatalog(column.Type());
|
551
551
|
if (user_type_catalog) {
|
552
552
|
auto &dependency_manager = catalog.GetDependencyManager();
|
553
553
|
if (remove) {
|
554
|
-
dependency_manager.dependents_map[user_type_catalog].erase(entry
|
555
|
-
dependency_manager.dependencies_map[entry
|
554
|
+
dependency_manager.dependents_map[user_type_catalog].erase(entry.parent);
|
555
|
+
dependency_manager.dependencies_map[entry.parent].erase(user_type_catalog);
|
556
556
|
} else {
|
557
|
-
dependency_manager.dependents_map[user_type_catalog].insert(entry);
|
558
|
-
dependency_manager.dependencies_map[entry].insert(user_type_catalog);
|
557
|
+
dependency_manager.dependents_map[user_type_catalog].insert(&entry);
|
558
|
+
dependency_manager.dependencies_map[&entry].insert(user_type_catalog);
|
559
559
|
}
|
560
560
|
}
|
561
561
|
}
|
562
562
|
|
563
|
-
void CatalogSet::AdjustDependency(CatalogEntry
|
563
|
+
void CatalogSet::AdjustDependency(CatalogEntry &entry, TableCatalogEntry &table, ColumnDefinition &column,
|
564
564
|
bool remove) {
|
565
565
|
bool found = false;
|
566
566
|
if (column.Type().id() == LogicalTypeId::ENUM) {
|
567
|
-
for (auto &old_column : table
|
567
|
+
for (auto &old_column : table.GetColumns().Logical()) {
|
568
568
|
if (old_column.Name() == column.Name() && old_column.Type().id() != LogicalTypeId::ENUM) {
|
569
569
|
AdjustUserDependency(entry, column, remove);
|
570
570
|
found = true;
|
@@ -575,7 +575,7 @@ void CatalogSet::AdjustDependency(CatalogEntry *entry, TableCatalogEntry *table,
|
|
575
575
|
}
|
576
576
|
} else if (!(column.Type().GetAlias().empty())) {
|
577
577
|
auto alias = column.Type().GetAlias();
|
578
|
-
for (auto &old_column : table
|
578
|
+
for (auto &old_column : table.GetColumns().Logical()) {
|
579
579
|
auto old_alias = old_column.Type().GetAlias();
|
580
580
|
if (old_column.Name() == column.Name() && old_alias != alias) {
|
581
581
|
AdjustUserDependency(entry, column, remove);
|
@@ -588,24 +588,24 @@ void CatalogSet::AdjustDependency(CatalogEntry *entry, TableCatalogEntry *table,
|
|
588
588
|
}
|
589
589
|
}
|
590
590
|
|
591
|
-
void CatalogSet::AdjustTableDependencies(CatalogEntry
|
592
|
-
if (entry
|
591
|
+
void CatalogSet::AdjustTableDependencies(CatalogEntry &entry) {
|
592
|
+
if (entry.type == CatalogType::TABLE_ENTRY && entry.parent->type == CatalogType::TABLE_ENTRY) {
|
593
593
|
// If it's a table entry we have to check for possibly removing or adding user type dependencies
|
594
|
-
auto old_table = (
|
595
|
-
auto new_table = (
|
594
|
+
auto &old_table = entry.parent->Cast<TableCatalogEntry>();
|
595
|
+
auto &new_table = entry.Cast<TableCatalogEntry>();
|
596
596
|
|
597
|
-
for (idx_t i = 0; i < new_table
|
598
|
-
auto &new_column = new_table
|
597
|
+
for (idx_t i = 0; i < new_table.GetColumns().LogicalColumnCount(); i++) {
|
598
|
+
auto &new_column = new_table.GetColumnsMutable().GetColumnMutable(LogicalIndex(i));
|
599
599
|
AdjustDependency(entry, old_table, new_column, false);
|
600
600
|
}
|
601
|
-
for (idx_t i = 0; i < old_table
|
602
|
-
auto &old_column = old_table
|
601
|
+
for (idx_t i = 0; i < old_table.GetColumns().LogicalColumnCount(); i++) {
|
602
|
+
auto &old_column = old_table.GetColumnsMutable().GetColumnMutable(LogicalIndex(i));
|
603
603
|
AdjustDependency(entry, new_table, old_column, true);
|
604
604
|
}
|
605
605
|
}
|
606
606
|
}
|
607
607
|
|
608
|
-
void CatalogSet::Undo(CatalogEntry
|
608
|
+
void CatalogSet::Undo(CatalogEntry &entry) {
|
609
609
|
lock_guard<mutex> write_lock(catalog.GetWriteLock());
|
610
610
|
lock_guard<mutex> lock(catalog_lock);
|
611
611
|
|
@@ -613,7 +613,7 @@ void CatalogSet::Undo(CatalogEntry *entry) {
|
|
613
613
|
// and entry->parent has to be removed ("rolled back")
|
614
614
|
|
615
615
|
// i.e. we have to place (entry) as (entry->parent) again
|
616
|
-
auto &to_be_removed_node = entry
|
616
|
+
auto &to_be_removed_node = entry.parent;
|
617
617
|
|
618
618
|
AdjustTableDependencies(entry);
|
619
619
|
|
@@ -622,7 +622,7 @@ void CatalogSet::Undo(CatalogEntry *entry) {
|
|
622
622
|
auto &dependency_manager = catalog.GetDependencyManager();
|
623
623
|
dependency_manager.EraseObject(to_be_removed_node);
|
624
624
|
}
|
625
|
-
if (entry
|
625
|
+
if (entry.name != to_be_removed_node->name) {
|
626
626
|
// rename: clean up the new name when the rename is rolled back
|
627
627
|
auto removed_entry = mapping.find(to_be_removed_node->name);
|
628
628
|
if (removed_entry->second->child) {
|
@@ -636,21 +636,21 @@ void CatalogSet::Undo(CatalogEntry *entry) {
|
|
636
636
|
// if the to be removed node has a parent, set the child pointer to the
|
637
637
|
// to be restored node
|
638
638
|
to_be_removed_node->parent->child = std::move(to_be_removed_node->child);
|
639
|
-
entry
|
639
|
+
entry.parent = to_be_removed_node->parent;
|
640
640
|
} else {
|
641
641
|
// otherwise we need to update the base entry tables
|
642
|
-
auto &name = entry
|
642
|
+
auto &name = entry.name;
|
643
643
|
to_be_removed_node->child->SetAsRoot();
|
644
644
|
mapping[name]->index.GetEntry() = std::move(to_be_removed_node->child);
|
645
|
-
entry
|
645
|
+
entry.parent = nullptr;
|
646
646
|
}
|
647
647
|
|
648
648
|
// restore the name if it was deleted
|
649
|
-
auto restored_entry = mapping.find(entry
|
650
|
-
if (restored_entry->second->deleted || entry
|
649
|
+
auto restored_entry = mapping.find(entry.name);
|
650
|
+
if (restored_entry->second->deleted || entry.type == CatalogType::INVALID) {
|
651
651
|
if (restored_entry->second->child) {
|
652
652
|
restored_entry->second->child->parent = nullptr;
|
653
|
-
mapping[entry
|
653
|
+
mapping[entry.name] = std::move(restored_entry->second->child);
|
654
654
|
} else {
|
655
655
|
mapping.erase(restored_entry);
|
656
656
|
}
|
@@ -10,6 +10,7 @@
|
|
10
10
|
namespace duckdb {
|
11
11
|
|
12
12
|
static DefaultMacro internal_macros[] = {
|
13
|
+
{DEFAULT_SCHEMA, "current_role", {nullptr}, "'duckdb'"}, // user name of current execution context
|
13
14
|
{DEFAULT_SCHEMA, "current_user", {nullptr}, "'duckdb'"}, // user name of current execution context
|
14
15
|
{DEFAULT_SCHEMA, "current_catalog", {nullptr}, "current_database()"}, // name of current database (called "catalog" in the SQL standard)
|
15
16
|
{DEFAULT_SCHEMA, "user", {nullptr}, "current_user"}, // equivalent to current_user
|
@@ -169,7 +170,7 @@ unique_ptr<CreateMacroInfo> DefaultFunctionGenerator::CreateInternalTableMacroIn
|
|
169
170
|
D_ASSERT(parser.statements.size() == 1);
|
170
171
|
D_ASSERT(parser.statements[0]->type == StatementType::SELECT_STATEMENT);
|
171
172
|
|
172
|
-
auto &select =
|
173
|
+
auto &select = parser.statements[0]->Cast<SelectStatement>();
|
173
174
|
auto result = make_uniq<TableMacroFunction>(std::move(select.node));
|
174
175
|
return CreateInternalTableMacroInfo(default_macro, std::move(result));
|
175
176
|
}
|
@@ -106,11 +106,11 @@ void DependencyManager::AlterObject(CatalogTransaction transaction, CatalogEntry
|
|
106
106
|
vector<CatalogEntry *> to_delete;
|
107
107
|
for (auto &dependency : old_dependencies) {
|
108
108
|
if (dependency->type == CatalogType::TYPE_ENTRY) {
|
109
|
-
auto user_type = (
|
110
|
-
auto table = (
|
109
|
+
auto &user_type = dependency->Cast<TypeCatalogEntry>();
|
110
|
+
auto &table = new_obj->Cast<TableCatalogEntry>();
|
111
111
|
bool deleted_dependency = true;
|
112
|
-
for (auto &column : table
|
113
|
-
if (column.Type() == user_type
|
112
|
+
for (auto &column : table.GetColumns().Logical()) {
|
113
|
+
if (column.Type() == user_type.user_type) {
|
114
114
|
deleted_dependency = false;
|
115
115
|
break;
|
116
116
|
}
|
@@ -139,6 +139,8 @@ string PhysicalOperatorToString(PhysicalOperatorType type) {
|
|
139
139
|
return "RESULT_COLLECTOR";
|
140
140
|
case PhysicalOperatorType::EXTENSION:
|
141
141
|
return "EXTENSION";
|
142
|
+
case PhysicalOperatorType::PIVOT:
|
143
|
+
return "PIVOT";
|
142
144
|
case PhysicalOperatorType::INVALID:
|
143
145
|
break;
|
144
146
|
}
|
@@ -40,7 +40,7 @@ static unordered_map<column_t, string> GetKnownColumnValues(string &filename,
|
|
40
40
|
static void ConvertKnownColRefToConstants(unique_ptr<Expression> &expr,
|
41
41
|
unordered_map<column_t, string> &known_column_values, idx_t table_index) {
|
42
42
|
if (expr->type == ExpressionType::BOUND_COLUMN_REF) {
|
43
|
-
auto &bound_colref = (
|
43
|
+
auto &bound_colref = expr->Cast<BoundColumnRefExpression>();
|
44
44
|
|
45
45
|
// This bound column ref is for another table
|
46
46
|
if (table_index != bound_colref.binding.table_index) {
|
@@ -342,7 +342,7 @@ HivePartitioningIndex HivePartitioningIndex::Deserialize(Deserializer &source) {
|
|
342
342
|
return HivePartitioningIndex(std::move(value), index);
|
343
343
|
}
|
344
344
|
|
345
|
-
void MultiFileReaderOptions::AddBatchInfo(BindInfo &bind_info) {
|
345
|
+
void MultiFileReaderOptions::AddBatchInfo(BindInfo &bind_info) const {
|
346
346
|
bind_info.InsertOption("filename", Value::BOOLEAN(filename));
|
347
347
|
bind_info.InsertOption("hive_partitioning", Value::BOOLEAN(hive_partitioning));
|
348
348
|
bind_info.InsertOption("union_by_name", Value::BOOLEAN(union_by_name));
|
@@ -57,6 +57,9 @@ void RowOperations::UpdateStates(AggregateObject &aggr, Vector &addresses, DataC
|
|
57
57
|
void RowOperations::UpdateFilteredStates(AggregateFilterData &filter_data, AggregateObject &aggr, Vector &addresses,
|
58
58
|
DataChunk &payload, idx_t arg_idx) {
|
59
59
|
idx_t count = filter_data.ApplyFilter(payload);
|
60
|
+
if (count == 0) {
|
61
|
+
return;
|
62
|
+
}
|
60
63
|
|
61
64
|
Vector filtered_addresses(addresses, filter_data.true_sel, count);
|
62
65
|
filtered_addresses.Flatten(count);
|
@@ -184,12 +184,34 @@ string StringUtil::Upper(const string &str) {
|
|
184
184
|
|
185
185
|
string StringUtil::Lower(const string &str) {
|
186
186
|
string copy(str);
|
187
|
-
transform(copy.begin(), copy.end(), copy.begin(), [](unsigned char c) { return
|
187
|
+
transform(copy.begin(), copy.end(), copy.begin(), [](unsigned char c) { return StringUtil::CharacterToLower(c); });
|
188
188
|
return (copy);
|
189
189
|
}
|
190
190
|
|
191
|
+
// Jenkins hash function: https://en.wikipedia.org/wiki/Jenkins_hash_function
|
192
|
+
uint64_t StringUtil::CIHash(const string &str) {
|
193
|
+
uint32_t hash = 0;
|
194
|
+
for (auto c : str) {
|
195
|
+
hash += StringUtil::CharacterToLower(c);
|
196
|
+
hash += hash << 10;
|
197
|
+
hash ^= hash >> 6;
|
198
|
+
}
|
199
|
+
hash += hash << 3;
|
200
|
+
hash ^= hash >> 11;
|
201
|
+
hash += hash << 15;
|
202
|
+
return hash;
|
203
|
+
}
|
204
|
+
|
191
205
|
bool StringUtil::CIEquals(const string &l1, const string &l2) {
|
192
|
-
|
206
|
+
if (l1.size() != l2.size()) {
|
207
|
+
return false;
|
208
|
+
}
|
209
|
+
for (idx_t c = 0; c < l1.size(); c++) {
|
210
|
+
if (StringUtil::CharacterToLower(l1[c]) != StringUtil::CharacterToLower(l2[c])) {
|
211
|
+
return false;
|
212
|
+
}
|
213
|
+
}
|
214
|
+
return true;
|
193
215
|
}
|
194
216
|
|
195
217
|
vector<string> StringUtil::Split(const string &input, const string &split) {
|