duckdb 0.6.2-dev971.0 → 0.7.1-dev2.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 +14 -8
- package/configure.py +2 -2
- package/lib/duckdb.d.ts +20 -3
- package/lib/duckdb.js +13 -1
- package/package.json +3 -1
- package/src/connection.cpp +5 -3
- package/src/database.cpp +117 -11
- package/src/duckdb/extension/icu/icu-dateadd.cpp +70 -7
- package/src/duckdb/extension/icu/icu-datefunc.cpp +0 -8
- package/src/duckdb/extension/icu/icu-datepart.cpp +1 -1
- package/src/duckdb/extension/icu/icu-extension.cpp +5 -3
- package/src/duckdb/extension/icu/icu-strptime.cpp +2 -2
- package/src/duckdb/extension/icu/icu-timebucket.cpp +637 -0
- package/src/duckdb/extension/icu/icu-timezone.cpp +7 -3
- package/src/duckdb/extension/icu/include/icu-datefunc.hpp +11 -1
- package/src/duckdb/{src/include/duckdb/main/replacement_opens.hpp → extension/icu/include/icu-timebucket.hpp} +3 -6
- package/src/duckdb/extension/icu/third_party/icu/common/uloc.cpp +3 -1
- package/src/duckdb/extension/icu/third_party/icu/i18n/calendar.cpp +1 -1
- package/src/duckdb/extension/icu/third_party/icu/i18n/choicfmt.cpp +3 -1
- package/src/duckdb/extension/icu/third_party/icu/i18n/plurrule.cpp +3 -1
- package/src/duckdb/extension/json/buffered_json_reader.cpp +254 -0
- package/src/duckdb/extension/json/include/buffered_json_reader.hpp +148 -0
- package/src/duckdb/extension/json/include/json_common.hpp +148 -226
- package/src/duckdb/extension/json/include/json_executors.hpp +139 -0
- package/src/duckdb/extension/json/include/json_functions.hpp +71 -30
- package/src/duckdb/extension/json/include/json_scan.hpp +310 -0
- package/src/duckdb/extension/json/include/json_structure.hpp +87 -0
- package/src/duckdb/extension/json/include/json_transform.hpp +72 -0
- package/src/duckdb/extension/json/json-extension.cpp +35 -17
- package/src/duckdb/extension/json/json_common.cpp +10 -87
- package/src/duckdb/extension/json/json_functions/copy_json.cpp +109 -0
- package/src/duckdb/extension/json/json_functions/json_array_length.cpp +18 -13
- package/src/duckdb/extension/json/json_functions/json_contains.cpp +95 -44
- package/src/duckdb/extension/json/json_functions/json_create.cpp +48 -39
- package/src/duckdb/extension/json/json_functions/json_extract.cpp +30 -21
- package/src/duckdb/extension/json/json_functions/json_keys.cpp +60 -0
- package/src/duckdb/extension/json/json_functions/json_merge_patch.cpp +33 -11
- package/src/duckdb/extension/json/json_functions/json_structure.cpp +483 -155
- package/src/duckdb/extension/json/json_functions/json_transform.cpp +369 -116
- package/src/duckdb/extension/json/json_functions/json_type.cpp +19 -14
- package/src/duckdb/extension/json/json_functions/json_valid.cpp +16 -6
- package/src/duckdb/extension/json/json_functions/read_json.cpp +282 -0
- package/src/duckdb/extension/json/json_functions/read_json_objects.cpp +65 -0
- package/src/duckdb/extension/json/json_functions.cpp +225 -0
- package/src/duckdb/extension/json/json_scan.cpp +666 -0
- package/src/duckdb/extension/json/yyjson/include/yyjson.hpp +3847 -3398
- package/src/duckdb/extension/json/yyjson/yyjson.cpp +6625 -6411
- package/src/duckdb/extension/parquet/column_reader.cpp +28 -23
- package/src/duckdb/extension/parquet/column_writer.cpp +79 -77
- package/src/duckdb/extension/parquet/include/boolean_column_reader.hpp +5 -1
- package/src/duckdb/extension/parquet/include/callback_column_reader.hpp +1 -1
- package/src/duckdb/extension/parquet/include/column_reader.hpp +2 -0
- package/src/duckdb/extension/parquet/include/generated_column_reader.hpp +1 -1
- package/src/duckdb/extension/parquet/include/parquet_reader.hpp +18 -3
- package/src/duckdb/extension/parquet/include/parquet_rle_bp_decoder.hpp +1 -1
- package/src/duckdb/extension/parquet/include/templated_column_reader.hpp +3 -3
- package/src/duckdb/extension/parquet/parquet-extension.cpp +102 -35
- package/src/duckdb/extension/parquet/parquet_metadata.cpp +2 -2
- package/src/duckdb/extension/parquet/parquet_reader.cpp +108 -39
- package/src/duckdb/extension/parquet/parquet_statistics.cpp +8 -4
- package/src/duckdb/extension/parquet/parquet_writer.cpp +23 -7
- package/src/duckdb/extension/parquet/zstd_file_system.cpp +2 -2
- package/src/duckdb/src/catalog/catalog.cpp +36 -134
- package/src/duckdb/src/catalog/catalog_entry/column_dependency_manager.cpp +2 -2
- package/src/duckdb/src/catalog/catalog_entry/duck_index_entry.cpp +27 -0
- package/src/duckdb/src/catalog/catalog_entry/duck_schema_entry.cpp +330 -0
- package/src/duckdb/src/catalog/catalog_entry/duck_table_entry.cpp +758 -0
- package/src/duckdb/src/catalog/catalog_entry/index_catalog_entry.cpp +4 -13
- package/src/duckdb/src/catalog/catalog_entry/pragma_function_catalog_entry.cpp +2 -1
- package/src/duckdb/src/catalog/catalog_entry/scalar_function_catalog_entry.cpp +1 -1
- package/src/duckdb/src/catalog/catalog_entry/scalar_macro_catalog_entry.cpp +5 -5
- package/src/duckdb/src/catalog/catalog_entry/schema_catalog_entry.cpp +11 -308
- package/src/duckdb/src/catalog/catalog_entry/table_catalog_entry.cpp +44 -708
- package/src/duckdb/src/catalog/catalog_entry/table_function_catalog_entry.cpp +2 -1
- package/src/duckdb/src/catalog/catalog_entry/view_catalog_entry.cpp +1 -1
- package/src/duckdb/src/catalog/catalog_entry.cpp +2 -2
- package/src/duckdb/src/catalog/catalog_search_path.cpp +10 -10
- package/src/duckdb/src/catalog/catalog_set.cpp +68 -62
- package/src/duckdb/src/catalog/catalog_transaction.cpp +9 -3
- package/src/duckdb/src/catalog/default/default_functions.cpp +7 -7
- package/src/duckdb/src/catalog/default/default_schemas.cpp +2 -2
- package/src/duckdb/src/catalog/default/default_types.cpp +2 -1
- package/src/duckdb/src/catalog/default/default_views.cpp +8 -16
- package/src/duckdb/src/catalog/dependency_manager.cpp +6 -6
- package/src/duckdb/src/catalog/duck_catalog.cpp +111 -0
- package/src/duckdb/src/catalog/similar_catalog_entry.cpp +26 -0
- package/src/duckdb/src/common/allocator.cpp +1 -1
- package/src/duckdb/src/common/arrow/arrow_appender.cpp +9 -9
- package/src/duckdb/src/common/arrow/arrow_converter.cpp +6 -6
- package/src/duckdb/src/common/arrow/arrow_wrapper.cpp +1 -1
- package/src/duckdb/src/common/bind_helpers.cpp +67 -0
- package/src/duckdb/src/common/box_renderer.cpp +11 -3
- package/src/duckdb/src/common/compressed_file_system.cpp +2 -2
- package/src/duckdb/src/common/enums/expression_type.cpp +2 -0
- package/src/duckdb/src/common/enums/logical_operator_type.cpp +2 -0
- package/src/duckdb/src/common/enums/optimizer_type.cpp +1 -0
- package/src/duckdb/src/common/enums/physical_operator_type.cpp +6 -0
- package/src/duckdb/src/common/enums/relation_type.cpp +2 -0
- package/src/duckdb/src/common/exception_format_value.cpp +2 -2
- package/src/duckdb/src/common/file_buffer.cpp +9 -34
- package/src/duckdb/src/common/file_system.cpp +28 -4
- package/src/duckdb/src/common/gzip_file_system.cpp +3 -3
- package/src/duckdb/src/common/hive_partitioning.cpp +129 -4
- package/src/duckdb/src/common/local_file_system.cpp +9 -7
- package/src/duckdb/src/common/operator/cast_operators.cpp +131 -28
- package/src/duckdb/src/common/pipe_file_system.cpp +2 -2
- package/src/duckdb/src/common/preserved_error.cpp +1 -1
- package/src/duckdb/src/common/radix_partitioning.cpp +5 -4
- package/src/duckdb/src/common/row_operations/row_aggregate.cpp +2 -2
- package/src/duckdb/src/common/serializer/buffered_serializer.cpp +1 -1
- package/src/duckdb/src/common/sort/merge_sorter.cpp +11 -5
- package/src/duckdb/src/common/sort/sort_state.cpp +19 -16
- package/src/duckdb/src/common/sort/sorted_block.cpp +12 -11
- package/src/duckdb/src/common/string_util.cpp +9 -1
- package/src/duckdb/src/common/tree_renderer.cpp +17 -8
- package/src/duckdb/src/common/types/batched_data_collection.cpp +4 -4
- package/src/duckdb/src/common/types/bit.cpp +278 -0
- package/src/duckdb/src/common/types/chunk_collection.cpp +7 -7
- package/src/duckdb/src/common/types/column_data_allocator.cpp +6 -6
- package/src/duckdb/src/common/types/column_data_collection.cpp +56 -32
- package/src/duckdb/src/common/types/column_data_collection_segment.cpp +2 -2
- package/src/duckdb/src/common/types/column_data_consumer.cpp +1 -1
- package/src/duckdb/src/common/types/conflict_info.cpp +18 -0
- package/src/duckdb/src/common/types/conflict_manager.cpp +257 -0
- package/src/duckdb/src/common/types/data_chunk.cpp +17 -7
- package/src/duckdb/src/common/types/date.cpp +7 -2
- package/src/duckdb/src/common/types/hash.cpp +2 -2
- package/src/duckdb/src/common/types/partitioned_column_data.cpp +7 -2
- package/src/duckdb/src/common/types/row_data_collection.cpp +7 -7
- package/src/duckdb/src/common/types/row_data_collection_scanner.cpp +10 -2
- package/src/duckdb/src/common/types/row_layout.cpp +4 -4
- package/src/duckdb/src/common/types/string_type.cpp +1 -0
- package/src/duckdb/src/common/types/time.cpp +10 -6
- package/src/duckdb/src/common/types/validity_mask.cpp +2 -2
- package/src/duckdb/src/common/types/value.cpp +35 -41
- package/src/duckdb/src/common/types/vector.cpp +149 -37
- package/src/duckdb/src/common/types/vector_buffer.cpp +4 -4
- package/src/duckdb/src/common/types/vector_cache.cpp +2 -2
- package/src/duckdb/src/common/types.cpp +64 -56
- package/src/duckdb/src/common/vector_operations/vector_cast.cpp +7 -2
- package/src/duckdb/src/common/virtual_file_system.cpp +3 -3
- package/src/duckdb/src/execution/aggregate_hashtable.cpp +10 -8
- package/src/duckdb/src/execution/base_aggregate_hashtable.cpp +1 -1
- package/src/duckdb/src/execution/column_binding_resolver.cpp +21 -1
- package/src/duckdb/src/execution/expression_executor/execute_case.cpp +1 -1
- package/src/duckdb/src/execution/expression_executor/execute_cast.cpp +10 -4
- package/src/duckdb/src/execution/expression_executor/execute_conjunction.cpp +1 -1
- package/src/duckdb/src/execution/expression_executor/execute_function.cpp +1 -1
- package/src/duckdb/src/execution/expression_executor/execute_operator.cpp +1 -1
- package/src/duckdb/src/execution/expression_executor.cpp +1 -1
- package/src/duckdb/src/execution/index/art/art.cpp +258 -197
- package/src/duckdb/src/execution/index/art/art_key.cpp +10 -0
- package/src/duckdb/src/execution/index/art/leaf.cpp +68 -25
- package/src/duckdb/src/execution/index/art/node.cpp +183 -90
- package/src/duckdb/src/execution/index/art/node16.cpp +62 -34
- package/src/duckdb/src/execution/index/art/node256.cpp +50 -30
- package/src/duckdb/src/execution/index/art/node4.cpp +63 -34
- package/src/duckdb/src/execution/index/art/node48.cpp +63 -38
- package/src/duckdb/src/execution/index/art/prefix.cpp +24 -14
- package/src/duckdb/src/execution/index/art/swizzleable_pointer.cpp +5 -2
- package/src/duckdb/src/execution/join_hashtable.cpp +18 -19
- package/src/duckdb/src/execution/operator/aggregate/aggregate_object.cpp +1 -1
- package/src/duckdb/src/execution/operator/aggregate/distinct_aggregate_data.cpp +2 -2
- package/src/duckdb/src/execution/operator/aggregate/grouped_aggregate_data.cpp +4 -4
- package/src/duckdb/src/execution/operator/aggregate/physical_hash_aggregate.cpp +22 -20
- package/src/duckdb/src/execution/operator/aggregate/physical_perfecthash_aggregate.cpp +3 -3
- package/src/duckdb/src/execution/operator/aggregate/physical_streaming_window.cpp +1 -1
- package/src/duckdb/src/execution/operator/aggregate/physical_ungrouped_aggregate.cpp +11 -11
- package/src/duckdb/src/execution/operator/aggregate/physical_window.cpp +322 -420
- package/src/duckdb/src/execution/operator/filter/physical_filter.cpp +8 -5
- package/src/duckdb/src/execution/operator/helper/physical_batch_collector.cpp +3 -3
- package/src/duckdb/src/execution/operator/helper/physical_limit.cpp +3 -2
- package/src/duckdb/src/execution/operator/helper/physical_materialized_collector.cpp +5 -5
- package/src/duckdb/src/execution/operator/helper/physical_set.cpp +9 -8
- package/src/duckdb/src/execution/operator/helper/physical_streaming_limit.cpp +3 -3
- package/src/duckdb/src/execution/operator/helper/physical_streaming_sample.cpp +1 -1
- package/src/duckdb/src/execution/operator/helper/physical_vacuum.cpp +4 -3
- package/src/duckdb/src/execution/operator/join/perfect_hash_join_executor.cpp +2 -2
- package/src/duckdb/src/execution/operator/join/physical_blockwise_nl_join.cpp +3 -3
- package/src/duckdb/src/execution/operator/join/physical_comparison_join.cpp +3 -2
- package/src/duckdb/src/execution/operator/join/physical_cross_product.cpp +3 -3
- package/src/duckdb/src/execution/operator/join/physical_delim_join.cpp +6 -6
- package/src/duckdb/src/execution/operator/join/physical_hash_join.cpp +19 -19
- package/src/duckdb/src/execution/operator/join/physical_iejoin.cpp +7 -7
- package/src/duckdb/src/execution/operator/join/physical_index_join.cpp +11 -10
- package/src/duckdb/src/execution/operator/join/physical_join.cpp +8 -1
- package/src/duckdb/src/execution/operator/join/physical_nested_loop_join.cpp +4 -3
- package/src/duckdb/src/execution/operator/join/physical_piecewise_merge_join.cpp +13 -8
- package/src/duckdb/src/execution/operator/join/physical_positional_join.cpp +195 -0
- package/src/duckdb/src/execution/operator/join/physical_range_join.cpp +7 -7
- package/src/duckdb/src/execution/operator/order/physical_order.cpp +6 -6
- package/src/duckdb/src/execution/operator/order/physical_top_n.cpp +3 -3
- package/src/duckdb/src/execution/operator/persistent/base_csv_reader.cpp +184 -26
- package/src/duckdb/src/execution/operator/persistent/buffered_csv_reader.cpp +92 -46
- package/src/duckdb/src/execution/operator/persistent/csv_buffer.cpp +19 -8
- package/src/duckdb/src/execution/operator/persistent/csv_reader_options.cpp +44 -55
- package/src/duckdb/src/execution/operator/persistent/parallel_csv_reader.cpp +137 -36
- package/src/duckdb/src/execution/operator/persistent/physical_batch_insert.cpp +32 -28
- package/src/duckdb/src/execution/operator/persistent/physical_copy_to_file.cpp +114 -19
- package/src/duckdb/src/execution/operator/persistent/physical_delete.cpp +2 -1
- package/src/duckdb/src/execution/operator/persistent/physical_insert.cpp +258 -24
- package/src/duckdb/src/execution/operator/persistent/physical_update.cpp +5 -3
- package/src/duckdb/src/execution/operator/projection/physical_projection.cpp +2 -2
- package/src/duckdb/src/execution/operator/projection/physical_tableinout_function.cpp +5 -5
- package/src/duckdb/src/execution/operator/projection/physical_unnest.cpp +183 -124
- package/src/duckdb/src/execution/operator/scan/physical_positional_scan.cpp +187 -0
- package/src/duckdb/src/execution/operator/scan/physical_table_scan.cpp +9 -8
- package/src/duckdb/src/execution/operator/schema/physical_attach.cpp +33 -8
- package/src/duckdb/src/execution/operator/schema/physical_create_index.cpp +63 -86
- package/src/duckdb/src/execution/operator/schema/physical_create_table.cpp +1 -1
- package/src/duckdb/src/execution/operator/schema/physical_create_type.cpp +1 -1
- package/src/duckdb/src/execution/operator/schema/physical_drop.cpp +22 -0
- package/src/duckdb/src/execution/operator/set/physical_recursive_cte.cpp +4 -3
- package/src/duckdb/src/execution/operator/set/physical_union.cpp +3 -3
- package/src/duckdb/src/execution/partitionable_hashtable.cpp +5 -5
- package/src/duckdb/src/execution/perfect_aggregate_hashtable.cpp +4 -4
- package/src/duckdb/src/execution/physical_operator.cpp +1 -1
- package/src/duckdb/src/execution/physical_plan/plan_aggregate.cpp +20 -19
- package/src/duckdb/src/execution/physical_plan/plan_any_join.cpp +2 -2
- package/src/duckdb/src/execution/physical_plan/plan_column_data_get.cpp +2 -2
- package/src/duckdb/src/execution/physical_plan/plan_comparison_join.cpp +25 -23
- package/src/duckdb/src/execution/physical_plan/plan_copy_to_file.cpp +11 -6
- package/src/duckdb/src/execution/physical_plan/plan_create.cpp +6 -6
- package/src/duckdb/src/execution/physical_plan/plan_create_index.cpp +63 -14
- package/src/duckdb/src/execution/physical_plan/plan_create_table.cpp +24 -18
- package/src/duckdb/src/execution/physical_plan/plan_cross_product.cpp +1 -1
- package/src/duckdb/src/execution/physical_plan/plan_delete.cpp +14 -8
- package/src/duckdb/src/execution/physical_plan/plan_delim_get.cpp +1 -1
- package/src/duckdb/src/execution/physical_plan/plan_delim_join.cpp +4 -4
- package/src/duckdb/src/execution/physical_plan/plan_distinct.cpp +14 -13
- package/src/duckdb/src/execution/physical_plan/plan_execute.cpp +3 -3
- package/src/duckdb/src/execution/physical_plan/plan_explain.cpp +4 -4
- package/src/duckdb/src/execution/physical_plan/plan_export.cpp +4 -4
- package/src/duckdb/src/execution/physical_plan/plan_expression_get.cpp +4 -4
- package/src/duckdb/src/execution/physical_plan/plan_filter.cpp +6 -6
- package/src/duckdb/src/execution/physical_plan/plan_get.cpp +15 -13
- package/src/duckdb/src/execution/physical_plan/plan_insert.cpp +32 -17
- package/src/duckdb/src/execution/physical_plan/plan_limit.cpp +8 -7
- package/src/duckdb/src/execution/physical_plan/plan_limit_percent.cpp +4 -4
- package/src/duckdb/src/execution/physical_plan/plan_order.cpp +5 -4
- package/src/duckdb/src/execution/physical_plan/plan_positional_join.cpp +21 -0
- package/src/duckdb/src/execution/physical_plan/plan_prepare.cpp +2 -2
- package/src/duckdb/src/execution/physical_plan/plan_projection.cpp +3 -3
- package/src/duckdb/src/execution/physical_plan/plan_recursive_cte.cpp +5 -5
- package/src/duckdb/src/execution/physical_plan/plan_sample.cpp +2 -2
- package/src/duckdb/src/execution/physical_plan/plan_set_operation.cpp +4 -4
- package/src/duckdb/src/execution/physical_plan/plan_show_select.cpp +2 -2
- package/src/duckdb/src/execution/physical_plan/plan_simple.cpp +10 -8
- package/src/duckdb/src/execution/physical_plan/plan_top_n.cpp +3 -3
- package/src/duckdb/src/execution/physical_plan/plan_unnest.cpp +3 -3
- package/src/duckdb/src/execution/physical_plan/plan_update.cpp +13 -6
- package/src/duckdb/src/execution/physical_plan/plan_window.cpp +10 -8
- package/src/duckdb/src/execution/physical_plan_generator.cpp +5 -1
- package/src/duckdb/src/execution/radix_partitioned_hashtable.cpp +2 -2
- package/src/duckdb/src/execution/reservoir_sample.cpp +2 -2
- package/src/duckdb/src/execution/window_segment_tree.cpp +2 -1
- package/src/duckdb/src/function/aggregate/distributive/approx_count.cpp +2 -2
- package/src/duckdb/src/function/aggregate/distributive/arg_min_max.cpp +232 -72
- package/src/duckdb/src/function/aggregate/distributive/first.cpp +2 -2
- package/src/duckdb/src/function/aggregate/distributive/minmax.cpp +3 -3
- package/src/duckdb/src/function/aggregate/distributive/string_agg.cpp +2 -2
- package/src/duckdb/src/function/aggregate/holistic/approximate_quantile.cpp +2 -2
- package/src/duckdb/src/function/aggregate/holistic/quantile.cpp +4 -1
- package/src/duckdb/src/function/aggregate/holistic/reservoir_quantile.cpp +2 -2
- package/src/duckdb/src/function/aggregate/sorted_aggregate_function.cpp +6 -5
- package/src/duckdb/src/function/built_in_functions.cpp +10 -10
- package/src/duckdb/src/function/cast/bit_cast.cpp +19 -0
- package/src/duckdb/src/function/cast/blob_cast.cpp +1 -0
- package/src/duckdb/src/function/cast/cast_function_set.cpp +5 -5
- package/src/duckdb/src/function/cast/decimal_cast.cpp +2 -2
- package/src/duckdb/src/function/cast/default_casts.cpp +12 -9
- package/src/duckdb/src/function/cast/enum_casts.cpp +2 -3
- package/src/duckdb/src/function/cast/list_casts.cpp +1 -2
- package/src/duckdb/src/function/cast/map_cast.cpp +12 -1
- package/src/duckdb/src/function/cast/numeric_casts.cpp +0 -1
- package/src/duckdb/src/function/cast/string_cast.cpp +92 -7
- package/src/duckdb/src/function/cast/struct_cast.cpp +3 -4
- package/src/duckdb/src/function/cast/time_casts.cpp +0 -9
- package/src/duckdb/src/function/cast/union_casts.cpp +11 -9
- package/src/duckdb/src/function/cast/uuid_casts.cpp +0 -1
- package/src/duckdb/src/function/cast/vector_cast_helpers.cpp +161 -53
- package/src/duckdb/src/function/cast_rules.cpp +2 -7
- package/src/duckdb/src/function/function.cpp +5 -5
- package/src/duckdb/src/function/function_binder.cpp +8 -8
- package/src/duckdb/src/function/function_set.cpp +3 -3
- package/src/duckdb/src/function/macro_function.cpp +12 -10
- package/src/duckdb/src/function/pragma/pragma_functions.cpp +1 -0
- package/src/duckdb/src/function/pragma/pragma_queries.cpp +24 -6
- package/src/duckdb/src/function/pragma_function.cpp +7 -6
- package/src/duckdb/src/function/scalar/date/date_part.cpp +11 -11
- package/src/duckdb/src/function/scalar/date/date_trunc.cpp +1 -1
- package/src/duckdb/src/function/scalar/date/strftime.cpp +14 -13
- package/src/duckdb/src/function/scalar/date/time_bucket.cpp +371 -0
- package/src/duckdb/src/function/scalar/date_functions.cpp +1 -0
- package/src/duckdb/src/function/scalar/generic/constant_or_null.cpp +3 -3
- package/src/duckdb/src/function/scalar/generic/current_setting.cpp +1 -1
- package/src/duckdb/src/function/scalar/generic/stats.cpp +1 -1
- package/src/duckdb/src/function/scalar/list/list_aggregates.cpp +9 -9
- package/src/duckdb/src/function/scalar/list/list_concat.cpp +1 -1
- package/src/duckdb/src/function/scalar/list/list_lambdas.cpp +20 -4
- package/src/duckdb/src/function/scalar/list/list_sort.cpp +4 -5
- package/src/duckdb/src/function/scalar/list/list_value.cpp +3 -3
- package/src/duckdb/src/function/scalar/map/map_extract.cpp +1 -4
- package/src/duckdb/src/function/scalar/math/numeric.cpp +35 -5
- package/src/duckdb/src/function/scalar/math/setseed.cpp +1 -1
- package/src/duckdb/src/function/scalar/math_functions.cpp +1 -0
- package/src/duckdb/src/function/scalar/operators/arithmetic.cpp +11 -11
- package/src/duckdb/src/function/scalar/operators/bitwise.cpp +160 -10
- package/src/duckdb/src/function/scalar/sequence/nextval.cpp +5 -5
- package/src/duckdb/src/function/scalar/string/bar.cpp +93 -0
- package/src/duckdb/src/function/scalar/string/left_right.cpp +5 -1
- package/src/duckdb/src/function/scalar/string/length.cpp +30 -4
- package/src/duckdb/src/function/scalar/string/like.cpp +5 -4
- package/src/duckdb/src/function/scalar/string/regexp.cpp +12 -11
- package/src/duckdb/src/function/scalar/string/string_split.cpp +1 -1
- package/src/duckdb/src/function/scalar/string/substring.cpp +8 -0
- package/src/duckdb/src/function/scalar/string_functions.cpp +7 -0
- package/src/duckdb/src/function/scalar/struct/struct_extract.cpp +2 -1
- package/src/duckdb/src/function/scalar/struct/struct_insert.cpp +2 -2
- package/src/duckdb/src/function/scalar/struct/struct_pack.cpp +2 -2
- package/src/duckdb/src/function/scalar/system/aggregate_export.cpp +4 -4
- package/src/duckdb/src/function/scalar/system/system_functions.cpp +9 -2
- package/src/duckdb/src/function/scalar/union/union_extract.cpp +2 -1
- package/src/duckdb/src/function/scalar/union/union_value.cpp +1 -1
- package/src/duckdb/src/function/scalar_function.cpp +5 -4
- package/src/duckdb/src/function/scalar_macro_function.cpp +2 -2
- package/src/duckdb/src/function/table/arrow.cpp +7 -7
- package/src/duckdb/src/function/table/arrow_conversion.cpp +1 -2
- package/src/duckdb/src/function/table/checkpoint.cpp +1 -0
- package/src/duckdb/src/function/table/copy_csv.cpp +23 -24
- package/src/duckdb/src/function/table/glob.cpp +1 -1
- package/src/duckdb/src/function/table/pragma_detailed_profiling_output.cpp +4 -4
- package/src/duckdb/src/function/table/pragma_last_profiling_output.cpp +3 -3
- package/src/duckdb/src/function/table/range.cpp +2 -2
- package/src/duckdb/src/function/table/read_csv.cpp +223 -122
- package/src/duckdb/src/function/table/repeat.cpp +1 -1
- package/src/duckdb/src/function/table/system/duckdb_columns.cpp +6 -6
- package/src/duckdb/src/function/table/system/duckdb_constraints.cpp +71 -60
- package/src/duckdb/src/function/table/system/duckdb_databases.cpp +89 -0
- package/src/duckdb/src/function/table/system/duckdb_dependencies.cpp +14 -10
- package/src/duckdb/src/function/table/system/duckdb_extensions.cpp +5 -5
- package/src/duckdb/src/function/table/system/duckdb_functions.cpp +13 -13
- package/src/duckdb/src/function/table/system/duckdb_indexes.cpp +17 -10
- package/src/duckdb/src/function/table/system/duckdb_keywords.cpp +2 -2
- package/src/duckdb/src/function/table/system/duckdb_schemas.cpp +1 -1
- package/src/duckdb/src/function/table/system/duckdb_sequences.cpp +1 -1
- package/src/duckdb/src/function/table/system/duckdb_settings.cpp +4 -4
- package/src/duckdb/src/function/table/system/duckdb_tables.cpp +10 -6
- package/src/duckdb/src/function/table/system/duckdb_types.cpp +1 -1
- package/src/duckdb/src/function/table/system/duckdb_views.cpp +2 -2
- package/src/duckdb/src/function/table/system/pragma_collations.cpp +1 -1
- package/src/duckdb/src/function/table/system/pragma_database_size.cpp +4 -4
- package/src/duckdb/src/function/table/system/pragma_storage_info.cpp +42 -19
- package/src/duckdb/src/function/table/system/pragma_table_info.cpp +17 -11
- package/src/duckdb/src/function/table/system/test_all_types.cpp +22 -19
- package/src/duckdb/src/function/table/system/test_vector_types.cpp +8 -8
- package/src/duckdb/src/function/table/system_functions.cpp +1 -1
- package/src/duckdb/src/function/table/table_scan.cpp +34 -30
- package/src/duckdb/src/function/table/unnest.cpp +5 -5
- package/src/duckdb/src/function/table/version/pragma_version.cpp +2 -2
- package/src/duckdb/src/function/table_function.cpp +1 -1
- package/src/duckdb/src/function/table_macro_function.cpp +2 -2
- package/src/duckdb/src/function/udf_function.cpp +4 -4
- package/src/duckdb/src/include/duckdb/catalog/catalog.hpp +44 -20
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/duck_index_entry.hpp +29 -0
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/duck_schema_entry.hpp +69 -0
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/duck_table_entry.hpp +71 -0
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/index_catalog_entry.hpp +3 -2
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/schema_catalog_entry.hpp +19 -50
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/table_catalog_entry.hpp +48 -39
- package/src/duckdb/src/include/duckdb/catalog/catalog_set.hpp +9 -6
- package/src/duckdb/src/include/duckdb/catalog/dependency_manager.hpp +3 -3
- package/src/duckdb/src/include/duckdb/catalog/duck_catalog.hpp +75 -0
- package/src/duckdb/src/include/duckdb/catalog/mapping_value.hpp +2 -1
- package/src/duckdb/src/include/duckdb/catalog/similar_catalog_entry.hpp +32 -0
- package/src/duckdb/src/include/duckdb/common/allocator.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/assert.hpp +4 -0
- package/src/duckdb/src/include/duckdb/common/bind_helpers.hpp +21 -0
- package/src/duckdb/src/include/duckdb/common/box_renderer.hpp +4 -0
- package/src/duckdb/src/include/duckdb/common/constants.hpp +2 -0
- package/src/duckdb/src/include/duckdb/common/enums/access_mode.hpp +17 -0
- package/src/duckdb/src/include/duckdb/common/enums/expression_type.hpp +3 -1
- package/src/duckdb/src/include/duckdb/common/enums/joinref_type.hpp +25 -0
- package/src/duckdb/src/include/duckdb/common/enums/logical_operator_type.hpp +1 -0
- package/src/duckdb/src/include/duckdb/common/enums/optimizer_type.hpp +1 -0
- package/src/duckdb/src/include/duckdb/common/enums/physical_operator_type.hpp +4 -1
- package/src/duckdb/src/include/duckdb/common/enums/relation_type.hpp +1 -0
- package/src/duckdb/src/include/duckdb/common/enums/tableref_type.hpp +0 -1
- package/src/duckdb/src/include/duckdb/common/field_writer.hpp +4 -4
- package/src/duckdb/src/include/duckdb/common/file_buffer.hpp +3 -16
- package/src/duckdb/src/include/duckdb/common/file_opener.hpp +4 -1
- package/src/duckdb/src/include/duckdb/common/file_system.hpp +17 -6
- package/src/duckdb/src/include/duckdb/common/gzip_file_system.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/helper.hpp +8 -0
- package/src/duckdb/src/include/duckdb/common/hive_partitioning.hpp +71 -2
- package/src/duckdb/src/include/duckdb/common/http_stats.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/index_vector.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/limits.hpp +3 -0
- package/src/duckdb/src/include/duckdb/common/local_file_system.hpp +2 -1
- package/src/duckdb/src/include/duckdb/common/operator/cast_operators.hpp +41 -0
- package/src/duckdb/src/include/duckdb/common/operator/convert_to_string.hpp +18 -18
- package/src/duckdb/src/include/duckdb/common/operator/decimal_cast_operators.hpp +20 -0
- package/src/duckdb/src/include/duckdb/common/operator/numeric_cast.hpp +39 -0
- package/src/duckdb/src/include/duckdb/common/operator/subtract.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/progress_bar/display/terminal_progress_bar_display.hpp +6 -7
- package/src/duckdb/src/include/duckdb/common/radix_partitioning.hpp +4 -0
- package/src/duckdb/src/include/duckdb/common/serializer.hpp +3 -3
- package/src/duckdb/src/include/duckdb/common/string_util.hpp +2 -0
- package/src/duckdb/src/include/duckdb/common/tree_renderer.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/types/bit.hpp +57 -0
- package/src/duckdb/src/include/duckdb/common/types/chunk_collection.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/types/conflict_manager.hpp +71 -0
- package/src/duckdb/src/include/duckdb/common/types/constraint_conflict_info.hpp +27 -0
- package/src/duckdb/src/include/duckdb/common/types/data_chunk.hpp +2 -0
- package/src/duckdb/src/include/duckdb/common/types/hugeint.hpp +3 -3
- package/src/duckdb/src/include/duckdb/common/types/partitioned_column_data.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/types/row_data_collection_scanner.hpp +4 -1
- package/src/duckdb/src/include/duckdb/common/types/selection_vector.hpp +84 -4
- package/src/duckdb/src/include/duckdb/common/types/validity_mask.hpp +1 -9
- package/src/duckdb/src/include/duckdb/common/types/value.hpp +6 -5
- package/src/duckdb/src/include/duckdb/common/types/vector.hpp +17 -3
- package/src/duckdb/src/include/duckdb/common/types/vector_buffer.hpp +5 -5
- package/src/duckdb/src/include/duckdb/common/types.hpp +7 -5
- package/src/duckdb/src/include/duckdb/common/unicode_bar.hpp +35 -0
- package/src/duckdb/src/include/duckdb/common/union_by_name.hpp +93 -0
- package/src/duckdb/src/include/duckdb/common/vector_operations/generic_executor.hpp +141 -0
- package/src/duckdb/src/include/duckdb/common/vector_operations/ternary_executor.hpp +14 -0
- package/src/duckdb/src/include/duckdb/common/virtual_file_system.hpp +23 -4
- package/src/duckdb/src/include/duckdb/execution/executor.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/expression_executor_state.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/index/art/art.hpp +26 -20
- package/src/duckdb/src/include/duckdb/execution/index/art/leaf.hpp +17 -8
- package/src/duckdb/src/include/duckdb/execution/index/art/node.hpp +21 -9
- package/src/duckdb/src/include/duckdb/execution/index/art/node16.hpp +15 -5
- package/src/duckdb/src/include/duckdb/execution/index/art/node256.hpp +14 -5
- package/src/duckdb/src/include/duckdb/execution/index/art/node4.hpp +16 -8
- package/src/duckdb/src/include/duckdb/execution/index/art/node48.hpp +14 -5
- package/src/duckdb/src/include/duckdb/execution/index/art/prefix.hpp +26 -20
- package/src/duckdb/src/include/duckdb/execution/index/art/swizzleable_pointer.hpp +4 -4
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_explain_analyze.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_limit_percent.hpp +3 -3
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_load.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_pragma.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_prepare.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_reservoir_sample.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_set.hpp +3 -3
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_transaction.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_cross_product.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_positional_join.hpp +50 -0
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/base_csv_reader.hpp +9 -8
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/buffered_csv_reader.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/csv_buffer.hpp +9 -3
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/csv_file_handle.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/csv_reader_options.hpp +31 -3
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/parallel_csv_reader.hpp +14 -2
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_batch_insert.hpp +2 -0
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_copy_to_file.hpp +7 -1
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_delete.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_export.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_insert.hpp +37 -2
- package/src/duckdb/src/include/duckdb/execution/operator/projection/physical_unnest.hpp +5 -1
- package/src/duckdb/src/include/duckdb/execution/operator/scan/physical_column_data_scan.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/scan/physical_dummy_scan.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/scan/physical_empty_result.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/scan/physical_expression_scan.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/scan/physical_positional_scan.hpp +41 -0
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_alter.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_attach.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_create_function.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_create_index.hpp +9 -17
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_create_schema.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_create_sequence.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_create_view.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_drop.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/physical_plan_generator.hpp +1 -0
- package/src/duckdb/src/include/duckdb/function/cast/default_casts.hpp +37 -13
- package/src/duckdb/src/include/duckdb/function/cast/vector_cast_helpers.hpp +11 -2
- package/src/duckdb/src/include/duckdb/function/compression_function.hpp +1 -1
- package/src/duckdb/src/include/duckdb/function/copy_function.hpp +12 -3
- package/src/duckdb/src/include/duckdb/function/create_database_extension.hpp +37 -0
- package/src/duckdb/src/include/duckdb/function/function_serialization.hpp +3 -3
- package/src/duckdb/src/include/duckdb/function/function_set.hpp +4 -2
- package/src/duckdb/src/include/duckdb/function/replacement_scan.hpp +4 -4
- package/src/duckdb/src/include/duckdb/function/scalar/bit_functions.hpp +28 -0
- package/src/duckdb/src/include/duckdb/function/scalar/date_functions.hpp +4 -0
- package/src/duckdb/src/include/duckdb/function/scalar/math_functions.hpp +4 -0
- package/src/duckdb/src/include/duckdb/function/scalar/nested_functions.hpp +2 -2
- package/src/duckdb/src/include/duckdb/function/scalar/strftime.hpp +4 -3
- package/src/duckdb/src/include/duckdb/function/scalar/string_functions.hpp +4 -0
- package/src/duckdb/src/include/duckdb/function/scalar_function.hpp +7 -0
- package/src/duckdb/src/include/duckdb/function/table/arrow.hpp +1 -1
- package/src/duckdb/src/include/duckdb/function/table/read_csv.hpp +6 -4
- package/src/duckdb/src/include/duckdb/function/table/system_functions.hpp +6 -6
- package/src/duckdb/src/include/duckdb/function/table/table_scan.hpp +3 -2
- package/src/duckdb/src/include/duckdb/function/udf_function.hpp +2 -2
- package/src/duckdb/src/include/duckdb/main/attached_database.hpp +6 -0
- package/src/duckdb/src/include/duckdb/main/client_config.hpp +3 -0
- package/src/duckdb/src/include/duckdb/main/client_context.hpp +9 -1
- package/src/duckdb/src/include/duckdb/main/config.hpp +13 -8
- package/src/duckdb/src/include/duckdb/main/connection.hpp +7 -3
- package/src/duckdb/src/include/duckdb/main/connection_manager.hpp +1 -1
- package/src/duckdb/src/include/duckdb/main/database.hpp +6 -0
- package/src/duckdb/src/include/duckdb/main/database_manager.hpp +3 -0
- package/src/duckdb/src/include/duckdb/main/extension_functions.hpp +5 -0
- package/src/duckdb/src/include/duckdb/main/extension_helper.hpp +5 -5
- package/src/duckdb/src/include/duckdb/main/materialized_query_result.hpp +1 -0
- package/src/duckdb/src/include/duckdb/main/prepared_statement.hpp +2 -0
- package/src/duckdb/src/include/duckdb/main/query_result.hpp +3 -0
- package/src/duckdb/src/include/duckdb/main/relation/read_csv_relation.hpp +10 -11
- package/src/duckdb/src/include/duckdb/main/relation/read_json_relation.hpp +23 -0
- package/src/duckdb/src/include/duckdb/main/relation/table_function_relation.hpp +11 -2
- package/src/duckdb/src/include/duckdb/main/relation/write_csv_relation.hpp +2 -1
- package/src/duckdb/src/include/duckdb/main/relation/write_parquet_relation.hpp +34 -0
- package/src/duckdb/src/include/duckdb/main/relation.hpp +14 -1
- package/src/duckdb/src/include/duckdb/main/settings.hpp +9 -0
- package/src/duckdb/src/include/duckdb/main/valid_checker.hpp +1 -1
- package/src/duckdb/src/include/duckdb/optimizer/deliminator.hpp +4 -1
- package/src/duckdb/src/include/duckdb/optimizer/filter_combiner.hpp +3 -3
- package/src/duckdb/src/include/duckdb/optimizer/filter_pushdown.hpp +1 -1
- package/src/duckdb/src/include/duckdb/optimizer/join_order/cardinality_estimator.hpp +3 -6
- package/src/duckdb/src/include/duckdb/optimizer/join_order/estimated_properties.hpp +0 -1
- package/src/duckdb/src/include/duckdb/optimizer/join_order/join_node.hpp +0 -1
- package/src/duckdb/src/include/duckdb/optimizer/join_order/join_order_optimizer.hpp +1 -2
- package/src/duckdb/src/include/duckdb/optimizer/join_order/join_relation.hpp +1 -1
- package/src/duckdb/src/include/duckdb/optimizer/matcher/expression_type_matcher.hpp +1 -1
- package/src/duckdb/src/include/duckdb/optimizer/matcher/function_matcher.hpp +2 -2
- package/src/duckdb/src/include/duckdb/optimizer/statistics_propagator.hpp +1 -0
- package/src/duckdb/src/include/duckdb/optimizer/unnest_rewriter.hpp +84 -0
- package/src/duckdb/src/include/duckdb/parallel/task_counter.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parallel/task_scheduler.hpp +3 -3
- package/src/duckdb/src/include/duckdb/parser/column_list.hpp +3 -1
- package/src/duckdb/src/include/duckdb/parser/expression/between_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/case_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/cast_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/collate_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/columnref_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/comparison_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/conjunction_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/constant_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/function_expression.hpp +3 -3
- package/src/duckdb/src/include/duckdb/parser/expression/lambda_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/operator_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/parameter_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/positional_reference_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/star_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/subquery_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/window_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/alter_info.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/copy_info.hpp +4 -3
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_database_info.hpp +50 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_info.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_macro_info.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_schema_info.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_sequence_info.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_type_info.hpp +2 -2
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_view_info.hpp +5 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/drop_info.hpp +28 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/load_info.hpp +17 -0
- package/src/duckdb/src/include/duckdb/parser/parser_extension.hpp +2 -2
- package/src/duckdb/src/include/duckdb/parser/qualified_name.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/result_modifier.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/statement/copy_statement.hpp +4 -0
- package/src/duckdb/src/include/duckdb/parser/statement/insert_statement.hpp +33 -0
- package/src/duckdb/src/include/duckdb/parser/statement/logical_plan_statement.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/statement/update_statement.hpp +20 -3
- package/src/duckdb/src/include/duckdb/parser/tableref/joinref.hpp +6 -3
- package/src/duckdb/src/include/duckdb/parser/tableref/list.hpp +0 -1
- package/src/duckdb/src/include/duckdb/parser/tableref/table_function_ref.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/tokens.hpp +0 -1
- package/src/duckdb/src/include/duckdb/parser/transformer.hpp +23 -0
- package/src/duckdb/src/include/duckdb/planner/bind_context.hpp +4 -3
- package/src/duckdb/src/include/duckdb/planner/binder.hpp +32 -20
- package/src/duckdb/src/include/duckdb/planner/bound_tokens.hpp +0 -1
- package/src/duckdb/src/include/duckdb/planner/column_binding.hpp +1 -0
- package/src/duckdb/src/include/duckdb/planner/constraints/bound_foreign_key_constraint.hpp +2 -2
- package/src/duckdb/src/include/duckdb/planner/constraints/bound_unique_constraint.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression/bound_cast_expression.hpp +2 -2
- package/src/duckdb/src/include/duckdb/planner/expression/bound_lambdaref_expression.hpp +54 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_parameter_data.hpp +2 -2
- package/src/duckdb/src/include/duckdb/planner/expression_binder/column_alias_binder.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression_binder/returning_binder.hpp +0 -4
- 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 +3 -4
- 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_copy_to_file.hpp +8 -2
- package/src/duckdb/src/include/duckdb/planner/operator/logical_create.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/operator/logical_create_index.hpp +3 -3
- package/src/duckdb/src/include/duckdb/planner/operator/logical_create_table.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/operator/logical_cross_product.hpp +3 -8
- package/src/duckdb/src/include/duckdb/planner/operator/logical_delete.hpp +4 -20
- package/src/duckdb/src/include/duckdb/planner/operator/logical_distinct.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/operator/logical_execute.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/operator/logical_explain.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/operator/logical_export.hpp +2 -2
- package/src/duckdb/src/include/duckdb/planner/operator/logical_expression_get.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/operator/logical_extension_operator.hpp +2 -3
- package/src/duckdb/src/include/duckdb/planner/operator/logical_insert.hpp +28 -18
- package/src/duckdb/src/include/duckdb/planner/operator/logical_limit_percent.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/operator/logical_order.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/operator/logical_positional_join.hpp +28 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_pragma.hpp +2 -1
- package/src/duckdb/src/include/duckdb/planner/operator/logical_prepare.hpp +2 -2
- package/src/duckdb/src/include/duckdb/planner/operator/logical_recursive_cte.hpp +2 -2
- package/src/duckdb/src/include/duckdb/planner/operator/logical_set_operation.hpp +2 -2
- package/src/duckdb/src/include/duckdb/planner/operator/logical_show.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/operator/logical_simple.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/operator/logical_top_n.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/operator/logical_unconditional_join.hpp +31 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_unnest.hpp +1 -2
- package/src/duckdb/src/include/duckdb/planner/operator/logical_update.hpp +4 -18
- package/src/duckdb/src/include/duckdb/planner/parsed_data/bound_create_function_info.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/parsed_data/bound_create_table_info.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/table_binding.hpp +8 -0
- package/src/duckdb/src/include/duckdb/planner/tableref/bound_basetableref.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/tableref/bound_joinref.hpp +5 -1
- package/src/duckdb/src/include/duckdb/planner/tableref/{bound_crossproductref.hpp → bound_pos_join_ref.hpp} +9 -9
- package/src/duckdb/src/include/duckdb/planner/tableref/bound_subqueryref.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/tableref/bound_table_function.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/tableref/list.hpp +0 -1
- package/src/duckdb/src/include/duckdb/storage/arena_allocator.hpp +12 -7
- package/src/duckdb/src/include/duckdb/storage/buffer_manager.hpp +10 -5
- package/src/duckdb/src/include/duckdb/storage/checkpoint/table_data_writer.hpp +2 -1
- package/src/duckdb/src/include/duckdb/storage/checkpoint_manager.hpp +1 -3
- package/src/duckdb/src/include/duckdb/storage/compression/chimp/chimp_compress.hpp +3 -3
- package/src/duckdb/src/include/duckdb/storage/compression/patas/patas_analyze.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/compression/patas/patas_compress.hpp +3 -3
- package/src/duckdb/src/include/duckdb/storage/data_table.hpp +14 -9
- package/src/duckdb/src/include/duckdb/storage/database_size.hpp +24 -0
- package/src/duckdb/src/include/duckdb/storage/index.hpp +32 -11
- package/src/duckdb/src/include/duckdb/storage/magic_bytes.hpp +28 -0
- package/src/duckdb/src/include/duckdb/storage/object_cache.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/partial_block_manager.hpp +3 -3
- package/src/duckdb/src/include/duckdb/storage/single_file_block_manager.hpp +9 -1
- package/src/duckdb/src/include/duckdb/storage/statistics/base_statistics.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/storage_extension.hpp +43 -0
- package/src/duckdb/src/include/duckdb/storage/storage_manager.hpp +1 -9
- package/src/duckdb/src/include/duckdb/storage/string_uncompressed.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/table/column_data.hpp +2 -1
- package/src/duckdb/src/include/duckdb/storage/table/list_column_data.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/table/row_group.hpp +2 -1
- package/src/duckdb/src/include/duckdb/storage/table/row_group_collection.hpp +6 -4
- package/src/duckdb/src/include/duckdb/storage/table/scan_state.hpp +3 -2
- package/src/duckdb/src/include/duckdb/storage/table/segment_base.hpp +9 -1
- package/src/duckdb/src/include/duckdb/storage/table/standard_column_data.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/table/struct_column_data.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/table/table_index_list.hpp +8 -2
- package/src/duckdb/src/include/duckdb/storage/table_storage_info.hpp +48 -0
- package/src/duckdb/src/include/duckdb/storage/write_ahead_log.hpp +5 -5
- package/src/duckdb/src/include/duckdb/transaction/duck_transaction.hpp +68 -0
- package/src/duckdb/src/include/duckdb/transaction/duck_transaction_manager.hpp +75 -0
- package/src/duckdb/src/include/duckdb/transaction/local_storage.hpp +9 -7
- package/src/duckdb/src/include/duckdb/transaction/meta_transaction.hpp +3 -0
- package/src/duckdb/src/include/duckdb/transaction/transaction.hpp +9 -42
- package/src/duckdb/src/include/duckdb/transaction/transaction_data.hpp +3 -2
- package/src/duckdb/src/include/duckdb/transaction/transaction_manager.hpp +12 -41
- package/src/duckdb/src/include/duckdb.h +32 -2
- package/src/duckdb/src/include/duckdb.hpp +1 -0
- package/src/duckdb/src/main/appender.cpp +4 -3
- package/src/duckdb/src/main/attached_database.cpp +32 -9
- package/src/duckdb/src/main/capi/arrow-c.cpp +1 -1
- package/src/duckdb/src/main/capi/data_chunk-c.cpp +20 -1
- package/src/duckdb/src/main/capi/duckdb-c.cpp +1 -1
- package/src/duckdb/src/main/capi/helper-c.cpp +2 -4
- package/src/duckdb/src/main/capi/pending-c.cpp +1 -1
- package/src/duckdb/src/main/capi/prepared-c.cpp +2 -2
- package/src/duckdb/src/main/capi/replacement_scan-c.cpp +6 -6
- package/src/duckdb/src/main/capi/result-c.cpp +1 -1
- package/src/duckdb/src/main/capi/table_function-c.cpp +4 -4
- package/src/duckdb/src/main/capi/threading-c.cpp +8 -0
- package/src/duckdb/src/main/client_context.cpp +90 -61
- package/src/duckdb/src/main/client_context_file_opener.cpp +14 -0
- package/src/duckdb/src/main/client_data.cpp +2 -0
- package/src/duckdb/src/main/client_verify.cpp +7 -7
- package/src/duckdb/src/main/config.cpp +13 -2
- package/src/duckdb/src/main/connection.cpp +14 -15
- package/src/duckdb/src/main/database.cpp +88 -34
- package/src/duckdb/src/main/database_manager.cpp +6 -4
- package/src/duckdb/src/main/error_manager.cpp +1 -1
- package/src/duckdb/src/main/extension/extension_alias.cpp +1 -0
- package/src/duckdb/src/main/extension/extension_helper.cpp +18 -1
- package/src/duckdb/src/main/extension/extension_install.cpp +6 -1
- package/src/duckdb/src/main/extension/extension_load.cpp +22 -28
- package/src/duckdb/src/main/materialized_query_result.cpp +16 -4
- package/src/duckdb/src/main/pending_query_result.cpp +4 -4
- package/src/duckdb/src/main/prepared_statement.cpp +16 -3
- package/src/duckdb/src/main/query_profiler.cpp +6 -6
- package/src/duckdb/src/main/query_result.cpp +12 -7
- package/src/duckdb/src/main/relation/aggregate_relation.cpp +6 -6
- package/src/duckdb/src/main/relation/create_table_relation.cpp +4 -4
- package/src/duckdb/src/main/relation/create_view_relation.cpp +7 -6
- package/src/duckdb/src/main/relation/cross_product_relation.cpp +6 -5
- package/src/duckdb/src/main/relation/delete_relation.cpp +3 -3
- package/src/duckdb/src/main/relation/distinct_relation.cpp +1 -1
- package/src/duckdb/src/main/relation/explain_relation.cpp +2 -2
- package/src/duckdb/src/main/relation/filter_relation.cpp +4 -3
- package/src/duckdb/src/main/relation/insert_relation.cpp +3 -3
- package/src/duckdb/src/main/relation/join_relation.cpp +7 -7
- package/src/duckdb/src/main/relation/limit_relation.cpp +2 -2
- package/src/duckdb/src/main/relation/order_relation.cpp +3 -3
- package/src/duckdb/src/main/relation/projection_relation.cpp +3 -3
- package/src/duckdb/src/main/relation/query_relation.cpp +5 -4
- package/src/duckdb/src/main/relation/read_csv_relation.cpp +31 -39
- package/src/duckdb/src/main/relation/read_json_relation.cpp +20 -0
- package/src/duckdb/src/main/relation/setop_relation.cpp +3 -3
- package/src/duckdb/src/main/relation/subquery_relation.cpp +2 -1
- package/src/duckdb/src/main/relation/table_function_relation.cpp +29 -17
- package/src/duckdb/src/main/relation/table_relation.cpp +7 -7
- package/src/duckdb/src/main/relation/update_relation.cpp +9 -6
- package/src/duckdb/src/main/relation/value_relation.cpp +6 -6
- package/src/duckdb/src/main/relation/view_relation.cpp +4 -3
- package/src/duckdb/src/main/relation/write_csv_relation.cpp +6 -3
- package/src/duckdb/src/main/relation/write_parquet_relation.cpp +37 -0
- package/src/duckdb/src/main/relation.cpp +53 -30
- package/src/duckdb/src/main/settings/settings.cpp +20 -3
- package/src/duckdb/src/main/stream_query_result.cpp +6 -5
- package/src/duckdb/src/main/valid_checker.cpp +1 -1
- package/src/duckdb/src/optimizer/cse_optimizer.cpp +5 -5
- package/src/duckdb/src/optimizer/deliminator.cpp +16 -9
- package/src/duckdb/src/optimizer/expression_heuristics.cpp +2 -2
- package/src/duckdb/src/optimizer/expression_rewriter.cpp +7 -7
- package/src/duckdb/src/optimizer/filter_combiner.cpp +41 -36
- package/src/duckdb/src/optimizer/filter_pullup.cpp +17 -17
- package/src/duckdb/src/optimizer/filter_pushdown.cpp +24 -24
- package/src/duckdb/src/optimizer/in_clause_rewriter.cpp +14 -14
- package/src/duckdb/src/optimizer/join_order/cardinality_estimator.cpp +8 -7
- package/src/duckdb/src/optimizer/join_order/join_order_optimizer.cpp +77 -61
- package/src/duckdb/src/optimizer/join_order/join_relation_set.cpp +5 -5
- package/src/duckdb/src/optimizer/join_order/query_graph.cpp +1 -1
- package/src/duckdb/src/optimizer/optimizer.cpp +19 -11
- package/src/duckdb/src/optimizer/pullup/pullup_both_side.cpp +4 -4
- package/src/duckdb/src/optimizer/pullup/pullup_filter.cpp +4 -4
- package/src/duckdb/src/optimizer/pullup/pullup_from_left.cpp +3 -3
- package/src/duckdb/src/optimizer/pullup/pullup_projection.cpp +7 -7
- package/src/duckdb/src/optimizer/pullup/pullup_set_operation.cpp +2 -2
- package/src/duckdb/src/optimizer/pushdown/pushdown_aggregate.cpp +6 -6
- package/src/duckdb/src/optimizer/pushdown/pushdown_cross_product.cpp +8 -7
- package/src/duckdb/src/optimizer/pushdown/pushdown_filter.cpp +4 -4
- package/src/duckdb/src/optimizer/pushdown/pushdown_get.cpp +5 -5
- package/src/duckdb/src/optimizer/pushdown/pushdown_inner_join.cpp +8 -8
- package/src/duckdb/src/optimizer/pushdown/pushdown_left_join.cpp +13 -13
- package/src/duckdb/src/optimizer/pushdown/pushdown_limit.cpp +2 -2
- package/src/duckdb/src/optimizer/pushdown/pushdown_mark_join.cpp +4 -4
- package/src/duckdb/src/optimizer/pushdown/pushdown_projection.cpp +6 -6
- package/src/duckdb/src/optimizer/pushdown/pushdown_set_operation.cpp +9 -9
- package/src/duckdb/src/optimizer/pushdown/pushdown_single_join.cpp +4 -4
- package/src/duckdb/src/optimizer/regex_range_filter.cpp +5 -5
- package/src/duckdb/src/optimizer/remove_unused_columns.cpp +13 -4
- package/src/duckdb/src/optimizer/rule/arithmetic_simplification.cpp +6 -6
- package/src/duckdb/src/optimizer/rule/case_simplification.cpp +3 -3
- package/src/duckdb/src/optimizer/rule/comparison_simplification.cpp +6 -6
- package/src/duckdb/src/optimizer/rule/conjunction_simplification.cpp +2 -2
- package/src/duckdb/src/optimizer/rule/constant_folding.cpp +1 -1
- package/src/duckdb/src/optimizer/rule/date_part_simplification.cpp +3 -3
- package/src/duckdb/src/optimizer/rule/distributivity.cpp +11 -11
- package/src/duckdb/src/optimizer/rule/empty_needle_removal.cpp +2 -2
- package/src/duckdb/src/optimizer/rule/enum_comparison.cpp +8 -7
- package/src/duckdb/src/optimizer/rule/equal_or_null_simplification.cpp +7 -7
- package/src/duckdb/src/optimizer/rule/in_clause_simplification_rule.cpp +5 -5
- package/src/duckdb/src/optimizer/rule/like_optimizations.cpp +8 -8
- package/src/duckdb/src/optimizer/rule/move_constants.cpp +14 -14
- package/src/duckdb/src/optimizer/rule/regex_optimizations.cpp +3 -3
- package/src/duckdb/src/optimizer/statistics/expression/propagate_and_compress.cpp +12 -12
- package/src/duckdb/src/optimizer/statistics/expression/propagate_between.cpp +12 -10
- package/src/duckdb/src/optimizer/statistics/expression/propagate_cast.cpp +2 -2
- package/src/duckdb/src/optimizer/statistics/expression/propagate_comparison.cpp +6 -6
- package/src/duckdb/src/optimizer/statistics/expression/propagate_conjunction.cpp +1 -1
- package/src/duckdb/src/optimizer/statistics/expression/propagate_constant.cpp +4 -4
- package/src/duckdb/src/optimizer/statistics/expression/propagate_operator.cpp +3 -3
- package/src/duckdb/src/optimizer/statistics/operator/propagate_aggregate.cpp +3 -3
- package/src/duckdb/src/optimizer/statistics/operator/propagate_filter.cpp +2 -2
- package/src/duckdb/src/optimizer/statistics/operator/propagate_get.cpp +3 -3
- package/src/duckdb/src/optimizer/statistics/operator/propagate_join.cpp +69 -13
- package/src/duckdb/src/optimizer/statistics/operator/propagate_order.cpp +1 -1
- package/src/duckdb/src/optimizer/statistics/operator/propagate_projection.cpp +3 -3
- package/src/duckdb/src/optimizer/statistics/operator/propagate_set_operation.cpp +1 -1
- package/src/duckdb/src/optimizer/statistics/operator/propagate_window.cpp +1 -1
- package/src/duckdb/src/optimizer/statistics_propagator.cpp +3 -1
- package/src/duckdb/src/optimizer/topn_optimizer.cpp +4 -4
- package/src/duckdb/src/optimizer/unnest_rewriter.cpp +312 -0
- package/src/duckdb/src/parallel/base_pipeline_event.cpp +1 -1
- package/src/duckdb/src/parallel/event.cpp +4 -4
- package/src/duckdb/src/parallel/executor.cpp +13 -9
- package/src/duckdb/src/parallel/pipeline.cpp +4 -4
- package/src/duckdb/src/parallel/pipeline_event.cpp +1 -1
- package/src/duckdb/src/parallel/pipeline_executor.cpp +1 -1
- package/src/duckdb/src/parallel/pipeline_finish_event.cpp +1 -1
- package/src/duckdb/src/parallel/pipeline_initialize_event.cpp +3 -3
- package/src/duckdb/src/parallel/task_scheduler.cpp +10 -10
- package/src/duckdb/src/parser/column_definition.cpp +16 -12
- package/src/duckdb/src/parser/column_list.cpp +20 -2
- package/src/duckdb/src/parser/constraints/check_constraint.cpp +2 -2
- package/src/duckdb/src/parser/constraints/foreign_key_constraint.cpp +3 -3
- package/src/duckdb/src/parser/constraints/unique_constraint.cpp +5 -5
- package/src/duckdb/src/parser/expression/between_expression.cpp +5 -5
- package/src/duckdb/src/parser/expression/case_expression.cpp +5 -5
- package/src/duckdb/src/parser/expression/cast_expression.cpp +5 -5
- package/src/duckdb/src/parser/expression/collate_expression.cpp +5 -5
- package/src/duckdb/src/parser/expression/columnref_expression.cpp +10 -8
- package/src/duckdb/src/parser/expression/comparison_expression.cpp +4 -4
- package/src/duckdb/src/parser/expression/conjunction_expression.cpp +9 -9
- package/src/duckdb/src/parser/expression/constant_expression.cpp +4 -4
- package/src/duckdb/src/parser/expression/default_expression.cpp +1 -1
- package/src/duckdb/src/parser/expression/function_expression.cpp +12 -11
- package/src/duckdb/src/parser/expression/lambda_expression.cpp +4 -4
- package/src/duckdb/src/parser/expression/operator_expression.cpp +6 -6
- package/src/duckdb/src/parser/expression/parameter_expression.cpp +3 -3
- package/src/duckdb/src/parser/expression/positional_reference_expression.cpp +4 -4
- package/src/duckdb/src/parser/expression/star_expression.cpp +5 -5
- package/src/duckdb/src/parser/expression/subquery_expression.cpp +4 -4
- package/src/duckdb/src/parser/expression/window_expression.cpp +6 -6
- package/src/duckdb/src/parser/parsed_data/alter_function_info.cpp +4 -2
- package/src/duckdb/src/parser/parsed_data/alter_info.cpp +2 -2
- package/src/duckdb/src/parser/parsed_data/alter_table_info.cpp +45 -41
- package/src/duckdb/src/parser/parsed_data/create_aggregate_function_info.cpp +3 -3
- package/src/duckdb/src/parser/parsed_data/create_collation_info.cpp +3 -3
- package/src/duckdb/src/parser/parsed_data/create_copy_function_info.cpp +2 -2
- package/src/duckdb/src/parser/parsed_data/create_index_info.cpp +1 -1
- package/src/duckdb/src/parser/parsed_data/create_info.cpp +3 -0
- package/src/duckdb/src/parser/parsed_data/create_pragma_function_info.cpp +4 -4
- package/src/duckdb/src/parser/parsed_data/create_scalar_function_info.cpp +4 -4
- package/src/duckdb/src/parser/parsed_data/create_table_function_info.cpp +4 -4
- package/src/duckdb/src/parser/parsed_data/create_table_info.cpp +4 -3
- package/src/duckdb/src/parser/parsed_data/create_view_info.cpp +56 -3
- package/src/duckdb/src/parser/parsed_expression.cpp +17 -17
- package/src/duckdb/src/parser/parsed_expression_iterator.cpp +2 -7
- package/src/duckdb/src/parser/parser.cpp +148 -31
- package/src/duckdb/src/parser/query_node/recursive_cte_node.cpp +2 -2
- package/src/duckdb/src/parser/query_node/select_node.cpp +2 -2
- package/src/duckdb/src/parser/query_node/set_operation_node.cpp +2 -2
- package/src/duckdb/src/parser/query_node.cpp +5 -5
- package/src/duckdb/src/parser/result_modifier.cpp +9 -9
- package/src/duckdb/src/parser/statement/copy_statement.cpp +102 -0
- package/src/duckdb/src/parser/statement/explain_statement.cpp +1 -1
- package/src/duckdb/src/parser/statement/export_statement.cpp +1 -1
- package/src/duckdb/src/parser/statement/extension_statement.cpp +2 -1
- package/src/duckdb/src/parser/statement/insert_statement.cpp +87 -1
- package/src/duckdb/src/parser/statement/relation_statement.cpp +1 -1
- package/src/duckdb/src/parser/statement/set_statement.cpp +3 -3
- package/src/duckdb/src/parser/statement/update_statement.cpp +21 -6
- package/src/duckdb/src/parser/tableref/basetableref.cpp +2 -2
- package/src/duckdb/src/parser/tableref/expressionlistref.cpp +4 -4
- package/src/duckdb/src/parser/tableref/joinref.cpp +20 -9
- package/src/duckdb/src/parser/tableref/subqueryref.cpp +5 -5
- package/src/duckdb/src/parser/tableref/table_function.cpp +2 -2
- package/src/duckdb/src/parser/tableref.cpp +2 -5
- package/src/duckdb/src/parser/transform/constraint/transform_constraint.cpp +2 -2
- package/src/duckdb/src/parser/transform/expression/transform_array_access.cpp +5 -5
- package/src/duckdb/src/parser/transform/expression/transform_bool_expr.cpp +9 -7
- package/src/duckdb/src/parser/transform/expression/transform_case.cpp +4 -4
- package/src/duckdb/src/parser/transform/expression/transform_cast.cpp +1 -1
- package/src/duckdb/src/parser/transform/expression/transform_coalesce.cpp +2 -2
- package/src/duckdb/src/parser/transform/expression/transform_columnref.cpp +5 -5
- package/src/duckdb/src/parser/transform/expression/transform_constant.cpp +1 -1
- package/src/duckdb/src/parser/transform/expression/transform_expression.cpp +1 -1
- package/src/duckdb/src/parser/transform/expression/transform_function.cpp +24 -24
- package/src/duckdb/src/parser/transform/expression/transform_grouping_function.cpp +1 -1
- package/src/duckdb/src/parser/transform/expression/transform_interval.cpp +4 -4
- package/src/duckdb/src/parser/transform/expression/transform_is_null.cpp +1 -1
- package/src/duckdb/src/parser/transform/expression/transform_lambda.cpp +1 -1
- package/src/duckdb/src/parser/transform/expression/transform_operator.cpp +37 -36
- package/src/duckdb/src/parser/transform/expression/transform_param_ref.cpp +1 -1
- package/src/duckdb/src/parser/transform/expression/transform_positional_reference.cpp +1 -1
- package/src/duckdb/src/parser/transform/expression/transform_subquery.cpp +13 -13
- package/src/duckdb/src/parser/transform/helpers/nodetype_to_string.cpp +2 -0
- package/src/duckdb/src/parser/transform/helpers/transform_cte.cpp +1 -1
- package/src/duckdb/src/parser/transform/helpers/transform_groupby.cpp +6 -6
- package/src/duckdb/src/parser/transform/helpers/transform_orderby.cpp +1 -1
- package/src/duckdb/src/parser/transform/helpers/transform_typename.cpp +35 -4
- package/src/duckdb/src/parser/transform/statement/transform_alter_sequence.cpp +1 -1
- package/src/duckdb/src/parser/transform/statement/transform_alter_table.cpp +8 -8
- package/src/duckdb/src/parser/transform/statement/transform_attach.cpp +2 -2
- package/src/duckdb/src/parser/transform/statement/transform_checkpoint.cpp +3 -3
- package/src/duckdb/src/parser/transform/statement/transform_copy.cpp +5 -3
- package/src/duckdb/src/parser/transform/statement/transform_create_database.cpp +29 -0
- package/src/duckdb/src/parser/transform/statement/transform_create_function.cpp +6 -6
- package/src/duckdb/src/parser/transform/statement/transform_create_index.cpp +25 -18
- package/src/duckdb/src/parser/transform/statement/transform_create_schema.cpp +1 -1
- package/src/duckdb/src/parser/transform/statement/transform_create_sequence.cpp +1 -1
- package/src/duckdb/src/parser/transform/statement/transform_create_table.cpp +4 -4
- package/src/duckdb/src/parser/transform/statement/transform_create_table_as.cpp +2 -2
- package/src/duckdb/src/parser/transform/statement/transform_create_type.cpp +2 -2
- package/src/duckdb/src/parser/transform/statement/transform_create_view.cpp +1 -1
- package/src/duckdb/src/parser/transform/statement/transform_delete.cpp +1 -2
- package/src/duckdb/src/parser/transform/statement/transform_drop.cpp +13 -4
- package/src/duckdb/src/parser/transform/statement/transform_export.cpp +1 -1
- package/src/duckdb/src/parser/transform/statement/transform_insert.cpp +20 -5
- package/src/duckdb/src/parser/transform/statement/transform_load.cpp +1 -1
- package/src/duckdb/src/parser/transform/statement/transform_pragma.cpp +9 -2
- package/src/duckdb/src/parser/transform/statement/transform_rename.cpp +4 -4
- package/src/duckdb/src/parser/transform/statement/transform_select_node.cpp +5 -5
- package/src/duckdb/src/parser/transform/statement/transform_show.cpp +8 -7
- package/src/duckdb/src/parser/transform/statement/transform_update.cpp +15 -7
- package/src/duckdb/src/parser/transform/statement/transform_upsert.cpp +95 -0
- package/src/duckdb/src/parser/transform/statement/transform_use.cpp +1 -1
- package/src/duckdb/src/parser/transform/statement/transform_vacuum.cpp +1 -1
- package/src/duckdb/src/parser/transform/tableref/transform_base_tableref.cpp +1 -1
- package/src/duckdb/src/parser/transform/tableref/transform_from.cpp +10 -10
- package/src/duckdb/src/parser/transform/tableref/transform_join.cpp +12 -10
- package/src/duckdb/src/parser/transform/tableref/transform_subquery.cpp +2 -2
- package/src/duckdb/src/parser/transform/tableref/transform_table_function.cpp +1 -1
- package/src/duckdb/src/parser/transformer.cpp +4 -2
- package/src/duckdb/src/planner/bind_context.cpp +15 -14
- package/src/duckdb/src/planner/binder/expression/bind_aggregate_expression.cpp +9 -9
- package/src/duckdb/src/planner/binder/expression/bind_between_expression.cpp +12 -12
- package/src/duckdb/src/planner/binder/expression/bind_case_expression.cpp +5 -5
- package/src/duckdb/src/planner/binder/expression/bind_cast_expression.cpp +5 -5
- package/src/duckdb/src/planner/binder/expression/bind_collate_expression.cpp +1 -1
- package/src/duckdb/src/planner/binder/expression/bind_columnref_expression.cpp +13 -12
- package/src/duckdb/src/planner/binder/expression/bind_comparison_expression.cpp +9 -8
- package/src/duckdb/src/planner/binder/expression/bind_conjunction_expression.cpp +3 -2
- package/src/duckdb/src/planner/binder/expression/bind_function_expression.cpp +59 -16
- package/src/duckdb/src/planner/binder/expression/bind_lambda.cpp +44 -26
- package/src/duckdb/src/planner/binder/expression/bind_macro_expression.cpp +1 -1
- package/src/duckdb/src/planner/binder/expression/bind_operator_expression.cpp +6 -6
- package/src/duckdb/src/planner/binder/expression/bind_parameter_expression.cpp +3 -3
- package/src/duckdb/src/planner/binder/expression/bind_subquery_expression.cpp +12 -12
- package/src/duckdb/src/planner/binder/expression/bind_unnest_expression.cpp +3 -3
- package/src/duckdb/src/planner/binder/expression/bind_window_expression.cpp +19 -19
- package/src/duckdb/src/planner/binder/query_node/bind_recursive_cte_node.cpp +1 -1
- package/src/duckdb/src/planner/binder/query_node/bind_select_node.cpp +38 -34
- package/src/duckdb/src/planner/binder/query_node/bind_setop_node.cpp +5 -5
- 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 +14 -14
- package/src/duckdb/src/planner/binder/query_node/plan_recursive_cte_node.cpp +9 -8
- package/src/duckdb/src/planner/binder/query_node/plan_select_node.cpp +31 -31
- package/src/duckdb/src/planner/binder/query_node/plan_setop.cpp +21 -19
- package/src/duckdb/src/planner/binder/query_node/plan_subquery.cpp +63 -61
- package/src/duckdb/src/planner/binder/statement/bind_attach.cpp +1 -1
- package/src/duckdb/src/planner/binder/statement/bind_call.cpp +1 -1
- package/src/duckdb/src/planner/binder/statement/bind_copy.cpp +102 -25
- package/src/duckdb/src/planner/binder/statement/bind_create.cpp +141 -52
- package/src/duckdb/src/planner/binder/statement/bind_create_table.cpp +10 -10
- package/src/duckdb/src/planner/binder/statement/bind_delete.cpp +13 -12
- package/src/duckdb/src/planner/binder/statement/bind_drop.cpp +1 -1
- package/src/duckdb/src/planner/binder/statement/bind_execute.cpp +7 -7
- package/src/duckdb/src/planner/binder/statement/bind_explain.cpp +2 -2
- package/src/duckdb/src/planner/binder/statement/bind_export.cpp +30 -25
- package/src/duckdb/src/planner/binder/statement/bind_extension.cpp +3 -2
- package/src/duckdb/src/planner/binder/statement/bind_insert.cpp +361 -20
- package/src/duckdb/src/planner/binder/statement/bind_load.cpp +1 -1
- package/src/duckdb/src/planner/binder/statement/bind_logical_plan.cpp +1 -1
- package/src/duckdb/src/planner/binder/statement/bind_prepare.cpp +3 -3
- package/src/duckdb/src/planner/binder/statement/bind_show.cpp +2 -2
- package/src/duckdb/src/planner/binder/statement/bind_simple.cpp +2 -2
- package/src/duckdb/src/planner/binder/statement/bind_summarize.cpp +31 -29
- package/src/duckdb/src/planner/binder/statement/bind_update.cpp +75 -57
- package/src/duckdb/src/planner/binder/statement/bind_vacuum.cpp +11 -10
- package/src/duckdb/src/planner/binder/tableref/bind_basetableref.cpp +19 -10
- package/src/duckdb/src/planner/binder/tableref/bind_expressionlistref.cpp +4 -4
- package/src/duckdb/src/planner/binder/tableref/bind_joinref.cpp +24 -16
- package/src/duckdb/src/planner/binder/tableref/bind_subqueryref.cpp +2 -2
- package/src/duckdb/src/planner/binder/tableref/bind_table_function.cpp +22 -18
- package/src/duckdb/src/planner/binder/tableref/plan_basetableref.cpp +1 -1
- package/src/duckdb/src/planner/binder/tableref/plan_expressionlistref.cpp +3 -3
- package/src/duckdb/src/planner/binder/tableref/plan_joinref.cpp +43 -32
- package/src/duckdb/src/planner/binder/tableref/plan_table_function.cpp +1 -1
- package/src/duckdb/src/planner/binder.cpp +38 -23
- package/src/duckdb/src/planner/bound_result_modifier.cpp +3 -3
- package/src/duckdb/src/planner/expression/bound_aggregate_expression.cpp +6 -6
- package/src/duckdb/src/planner/expression/bound_between_expression.cpp +4 -3
- package/src/duckdb/src/planner/expression/bound_case_expression.cpp +12 -12
- package/src/duckdb/src/planner/expression/bound_cast_expression.cpp +9 -8
- package/src/duckdb/src/planner/expression/bound_columnref_expression.cpp +4 -4
- package/src/duckdb/src/planner/expression/bound_comparison_expression.cpp +4 -3
- package/src/duckdb/src/planner/expression/bound_conjunction_expression.cpp +5 -5
- package/src/duckdb/src/planner/expression/bound_constant_expression.cpp +2 -2
- package/src/duckdb/src/planner/expression/bound_expression.cpp +1 -1
- package/src/duckdb/src/planner/expression/bound_function_expression.cpp +8 -7
- package/src/duckdb/src/planner/expression/bound_lambda_expression.cpp +3 -3
- package/src/duckdb/src/planner/expression/bound_lambdaref_expression.cpp +71 -0
- package/src/duckdb/src/planner/expression/bound_operator_expression.cpp +4 -4
- package/src/duckdb/src/planner/expression/bound_parameter_expression.cpp +3 -3
- package/src/duckdb/src/planner/expression/bound_reference_expression.cpp +3 -3
- package/src/duckdb/src/planner/expression/bound_subquery_expression.cpp +1 -1
- package/src/duckdb/src/planner/expression/bound_unnest_expression.cpp +4 -4
- package/src/duckdb/src/planner/expression/bound_window_expression.cpp +8 -7
- package/src/duckdb/src/planner/expression.cpp +1 -1
- package/src/duckdb/src/planner/expression_binder/alter_binder.cpp +3 -4
- package/src/duckdb/src/planner/expression_binder/check_binder.cpp +16 -2
- package/src/duckdb/src/planner/expression_binder/column_alias_binder.cpp +6 -4
- package/src/duckdb/src/planner/expression_binder/constant_binder.cpp +1 -1
- package/src/duckdb/src/planner/expression_binder/group_binder.cpp +2 -2
- package/src/duckdb/src/planner/expression_binder/having_binder.cpp +5 -2
- package/src/duckdb/src/planner/expression_binder/lateral_binder.cpp +1 -1
- package/src/duckdb/src/planner/expression_binder/order_binder.cpp +6 -5
- package/src/duckdb/src/planner/expression_binder/relation_binder.cpp +1 -1
- package/src/duckdb/src/planner/expression_binder/returning_binder.cpp +1 -9
- package/src/duckdb/src/planner/expression_binder/select_binder.cpp +7 -2
- package/src/duckdb/src/planner/expression_binder/table_function_binder.cpp +15 -2
- package/src/duckdb/src/planner/expression_binder.cpp +6 -6
- package/src/duckdb/src/planner/expression_iterator.cpp +4 -7
- package/src/duckdb/src/planner/filter/conjunction_filter.cpp +2 -2
- package/src/duckdb/src/planner/filter/constant_filter.cpp +1 -1
- package/src/duckdb/src/planner/joinside.cpp +10 -9
- package/src/duckdb/src/planner/logical_operator.cpp +6 -3
- package/src/duckdb/src/planner/logical_operator_visitor.cpp +11 -1
- package/src/duckdb/src/planner/operator/logical_aggregate.cpp +8 -7
- package/src/duckdb/src/planner/operator/logical_any_join.cpp +2 -2
- package/src/duckdb/src/planner/operator/logical_column_data_get.cpp +4 -3
- package/src/duckdb/src/planner/operator/logical_comparison_join.cpp +1 -1
- package/src/duckdb/src/planner/operator/logical_copy_to_file.cpp +10 -5
- package/src/duckdb/src/planner/operator/logical_create.cpp +1 -1
- package/src/duckdb/src/planner/operator/logical_create_index.cpp +2 -2
- package/src/duckdb/src/planner/operator/logical_create_table.cpp +1 -1
- package/src/duckdb/src/planner/operator/logical_cross_product.cpp +3 -19
- package/src/duckdb/src/planner/operator/logical_delete.cpp +22 -1
- package/src/duckdb/src/planner/operator/logical_delim_join.cpp +1 -1
- package/src/duckdb/src/planner/operator/logical_distinct.cpp +1 -1
- package/src/duckdb/src/planner/operator/logical_empty_result.cpp +1 -1
- package/src/duckdb/src/planner/operator/logical_explain.cpp +1 -1
- package/src/duckdb/src/planner/operator/logical_expression_get.cpp +1 -1
- package/src/duckdb/src/planner/operator/logical_filter.cpp +6 -6
- package/src/duckdb/src/planner/operator/logical_get.cpp +10 -10
- package/src/duckdb/src/planner/operator/logical_insert.cpp +26 -3
- package/src/duckdb/src/planner/operator/logical_limit.cpp +2 -2
- package/src/duckdb/src/planner/operator/logical_limit_percent.cpp +1 -1
- package/src/duckdb/src/planner/operator/logical_order.cpp +3 -3
- package/src/duckdb/src/planner/operator/logical_positional_join.cpp +30 -0
- package/src/duckdb/src/planner/operator/logical_projection.cpp +2 -2
- package/src/duckdb/src/planner/operator/logical_sample.cpp +4 -4
- package/src/duckdb/src/planner/operator/logical_show.cpp +1 -1
- package/src/duckdb/src/planner/operator/logical_simple.cpp +33 -2
- package/src/duckdb/src/planner/operator/logical_top_n.cpp +1 -1
- package/src/duckdb/src/planner/operator/logical_unconditional_join.cpp +26 -0
- package/src/duckdb/src/planner/operator/logical_unnest.cpp +2 -2
- package/src/duckdb/src/planner/operator/logical_update.cpp +20 -1
- package/src/duckdb/src/planner/operator/logical_window.cpp +1 -1
- package/src/duckdb/src/planner/parsed_data/bound_create_table_info.cpp +1 -1
- package/src/duckdb/src/planner/planner.cpp +7 -9
- package/src/duckdb/src/planner/pragma_handler.cpp +3 -3
- package/src/duckdb/src/planner/subquery/flatten_dependent_join.cpp +66 -60
- package/src/duckdb/src/planner/subquery/rewrite_correlated_expressions.cpp +4 -3
- package/src/duckdb/src/planner/table_binding.cpp +61 -30
- package/src/duckdb/src/planner/table_filter.cpp +6 -6
- package/src/duckdb/src/storage/arena_allocator.cpp +37 -7
- package/src/duckdb/src/storage/block.cpp +2 -2
- package/src/duckdb/src/storage/buffer/buffer_handle.cpp +1 -1
- package/src/duckdb/src/storage/buffer_manager.cpp +48 -33
- package/src/duckdb/src/storage/checkpoint/row_group_writer.cpp +2 -2
- package/src/duckdb/src/storage/checkpoint/table_data_reader.cpp +1 -1
- package/src/duckdb/src/storage/checkpoint/table_data_writer.cpp +6 -4
- package/src/duckdb/src/storage/checkpoint_manager.cpp +14 -13
- package/src/duckdb/src/storage/compression/bitpacking.cpp +5 -4
- package/src/duckdb/src/storage/compression/dictionary_compression.cpp +3 -3
- package/src/duckdb/src/storage/compression/fixed_size_uncompressed.cpp +5 -5
- package/src/duckdb/src/storage/compression/fsst.cpp +40 -25
- package/src/duckdb/src/storage/compression/rle.cpp +3 -3
- package/src/duckdb/src/storage/compression/string_uncompressed.cpp +8 -8
- package/src/duckdb/src/storage/compression/validity_uncompressed.cpp +2 -2
- package/src/duckdb/src/storage/data_table.cpp +309 -104
- package/src/duckdb/src/storage/index.cpp +12 -6
- package/src/duckdb/src/storage/local_storage.cpp +27 -32
- package/src/duckdb/src/storage/magic_bytes.cpp +31 -0
- package/src/duckdb/src/storage/meta_block_writer.cpp +1 -1
- package/src/duckdb/src/storage/partial_block_manager.cpp +4 -4
- package/src/duckdb/src/storage/single_file_block_manager.cpp +108 -71
- package/src/duckdb/src/storage/statistics/base_statistics.cpp +13 -12
- package/src/duckdb/src/storage/statistics/column_statistics.cpp +2 -2
- package/src/duckdb/src/storage/statistics/distinct_statistics.cpp +2 -2
- package/src/duckdb/src/storage/statistics/list_statistics.cpp +4 -4
- package/src/duckdb/src/storage/statistics/numeric_statistics.cpp +106 -8
- package/src/duckdb/src/storage/statistics/segment_statistics.cpp +2 -2
- package/src/duckdb/src/storage/statistics/string_statistics.cpp +4 -4
- package/src/duckdb/src/storage/statistics/struct_statistics.cpp +5 -4
- package/src/duckdb/src/storage/storage_info.cpp +1 -1
- package/src/duckdb/src/storage/storage_manager.cpp +8 -4
- package/src/duckdb/src/storage/table/chunk_info.cpp +2 -2
- package/src/duckdb/src/storage/table/column_checkpoint_state.cpp +4 -4
- package/src/duckdb/src/storage/table/column_data.cpp +28 -38
- package/src/duckdb/src/storage/table/column_data_checkpointer.cpp +5 -5
- package/src/duckdb/src/storage/table/column_segment.cpp +16 -16
- package/src/duckdb/src/storage/table/list_column_data.cpp +11 -11
- package/src/duckdb/src/storage/table/row_group.cpp +21 -18
- package/src/duckdb/src/storage/table/row_group_collection.cpp +21 -22
- package/src/duckdb/src/storage/table/scan_state.cpp +3 -3
- package/src/duckdb/src/storage/table/segment_tree.cpp +5 -5
- package/src/duckdb/src/storage/table/standard_column_data.cpp +11 -11
- package/src/duckdb/src/storage/table/struct_column_data.cpp +13 -13
- package/src/duckdb/src/storage/table/table_statistics.cpp +1 -1
- package/src/duckdb/src/storage/table/update_segment.cpp +7 -6
- package/src/duckdb/src/storage/table_index_list.cpp +12 -10
- package/src/duckdb/src/storage/wal_replay.cpp +6 -6
- package/src/duckdb/src/transaction/commit_state.cpp +9 -3
- package/src/duckdb/src/transaction/duck_transaction.cpp +155 -0
- package/src/duckdb/src/transaction/duck_transaction_manager.cpp +342 -0
- package/src/duckdb/src/transaction/meta_transaction.cpp +3 -0
- package/src/duckdb/src/transaction/transaction.cpp +10 -132
- package/src/duckdb/src/transaction/transaction_context.cpp +2 -2
- package/src/duckdb/src/transaction/transaction_manager.cpp +1 -321
- package/src/duckdb/src/verification/copied_statement_verifier.cpp +1 -1
- package/src/duckdb/src/verification/deserialized_statement_verifier.cpp +1 -1
- package/src/duckdb/src/verification/external_statement_verifier.cpp +1 -1
- package/src/duckdb/src/verification/parsed_statement_verifier.cpp +2 -2
- package/src/duckdb/src/verification/prepared_statement_verifier.cpp +12 -12
- package/src/duckdb/src/verification/statement_verifier.cpp +5 -4
- package/src/duckdb/src/verification/unoptimized_statement_verifier.cpp +1 -1
- package/src/duckdb/third_party/fast_float/fast_float/fast_float.h +22 -19
- package/src/duckdb/third_party/fmt/include/fmt/core.h +5 -3
- package/src/duckdb/third_party/fmt/include/fmt/format.h +10 -10
- package/src/duckdb/third_party/libpg_query/include/nodes/nodes.hpp +19 -1
- package/src/duckdb/third_party/libpg_query/include/nodes/parsenodes.hpp +12 -0
- package/src/duckdb/third_party/libpg_query/include/parser/gram.hpp +355 -352
- package/src/duckdb/third_party/libpg_query/include/parser/kwlist.hpp +1 -0
- package/src/duckdb/third_party/libpg_query/src_backend_parser_gram.cpp +19986 -19619
- package/src/duckdb/third_party/libpg_query/src_backend_parser_scan.cpp +2 -2
- package/src/duckdb/third_party/mbedtls/library/bignum.cpp +1 -3
- package/src/duckdb/third_party/thrift/thrift/TApplicationException.h +0 -3
- package/src/duckdb/third_party/zstd/decompress/huf_decompress.cpp +4 -4
- package/src/duckdb/ub_extension_icu_third_party_icu_i18n.cpp +6 -6
- package/src/duckdb/ub_extension_json_json_functions.cpp +8 -0
- package/src/duckdb/ub_src_catalog.cpp +4 -0
- package/src/duckdb/ub_src_catalog_catalog_entry.cpp +6 -0
- package/src/duckdb/ub_src_common.cpp +2 -0
- package/src/duckdb/ub_src_common_types.cpp +6 -0
- package/src/duckdb/ub_src_execution_operator_join.cpp +2 -0
- package/src/duckdb/ub_src_execution_operator_scan.cpp +2 -0
- package/src/duckdb/ub_src_execution_physical_plan.cpp +2 -0
- package/src/duckdb/ub_src_function_cast.cpp +2 -0
- package/src/duckdb/ub_src_function_scalar_date.cpp +2 -0
- package/src/duckdb/ub_src_function_scalar_string.cpp +2 -0
- package/src/duckdb/ub_src_function_table_system.cpp +2 -2
- package/src/duckdb/ub_src_main.cpp +0 -2
- package/src/duckdb/ub_src_main_relation.cpp +4 -0
- package/src/duckdb/ub_src_optimizer.cpp +2 -0
- package/src/duckdb/ub_src_parser_tableref.cpp +0 -2
- package/src/duckdb/ub_src_parser_transform_statement.cpp +4 -0
- package/src/duckdb/ub_src_planner_binder_tableref.cpp +0 -4
- package/src/duckdb/ub_src_planner_expression.cpp +2 -0
- package/src/duckdb/ub_src_planner_operator.cpp +4 -0
- package/src/duckdb/ub_src_storage.cpp +2 -0
- package/src/duckdb/ub_src_transaction.cpp +4 -0
- package/src/duckdb_node.hpp +8 -0
- package/src/statement.cpp +5 -50
- package/src/utils.cpp +42 -0
- package/test/replacement_scan.test.ts +144 -0
- package/test/udf.test.ts +9 -0
- package/src/duckdb/src/function/table/system/pragma_database_list.cpp +0 -59
- package/src/duckdb/src/include/duckdb/function/replacement_open.hpp +0 -45
- package/src/duckdb/src/include/duckdb/parser/tableref/crossproductref.hpp +0 -36
- package/src/duckdb/src/main/extension_prefix_opener.cpp +0 -47
- package/src/duckdb/src/parser/tableref/crossproductref.cpp +0 -43
- package/src/duckdb/src/planner/binder/tableref/bind_crossproductref.cpp +0 -31
- package/src/duckdb/src/planner/binder/tableref/plan_crossproductref.cpp +0 -26
|
@@ -27,7 +27,7 @@ BoundStatement Binder::Bind(AlterStatement &stmt) {
|
|
|
27
27
|
stmt.info->catalog = entry->catalog->GetName();
|
|
28
28
|
stmt.info->schema = ((StandardEntry *)entry)->schema->name;
|
|
29
29
|
}
|
|
30
|
-
result.plan = make_unique<LogicalSimple>(LogicalOperatorType::LOGICAL_ALTER, move(stmt.info));
|
|
30
|
+
result.plan = make_unique<LogicalSimple>(LogicalOperatorType::LOGICAL_ALTER, std::move(stmt.info));
|
|
31
31
|
properties.return_type = StatementReturnType::NOTHING;
|
|
32
32
|
return result;
|
|
33
33
|
}
|
|
@@ -39,7 +39,7 @@ BoundStatement Binder::Bind(TransactionStatement &stmt) {
|
|
|
39
39
|
BoundStatement result;
|
|
40
40
|
result.names = {"Success"};
|
|
41
41
|
result.types = {LogicalType::BOOLEAN};
|
|
42
|
-
result.plan = make_unique<LogicalSimple>(LogicalOperatorType::LOGICAL_TRANSACTION, move(stmt.info));
|
|
42
|
+
result.plan = make_unique<LogicalSimple>(LogicalOperatorType::LOGICAL_TRANSACTION, std::move(stmt.info));
|
|
43
43
|
properties.return_type = StatementReturnType::NOTHING;
|
|
44
44
|
return result;
|
|
45
45
|
}
|
|
@@ -11,58 +11,60 @@ namespace duckdb {
|
|
|
11
11
|
|
|
12
12
|
static unique_ptr<ParsedExpression> SummarizeWrapUnnest(vector<unique_ptr<ParsedExpression>> &children,
|
|
13
13
|
const string &alias) {
|
|
14
|
-
auto list_function = make_unique<FunctionExpression>("list_value", move(children));
|
|
14
|
+
auto list_function = make_unique<FunctionExpression>("list_value", std::move(children));
|
|
15
15
|
vector<unique_ptr<ParsedExpression>> unnest_children;
|
|
16
|
-
unnest_children.push_back(move(list_function));
|
|
17
|
-
auto unnest_function = make_unique<FunctionExpression>("unnest", move(unnest_children));
|
|
16
|
+
unnest_children.push_back(std::move(list_function));
|
|
17
|
+
auto unnest_function = make_unique<FunctionExpression>("unnest", std::move(unnest_children));
|
|
18
18
|
unnest_function->alias = alias;
|
|
19
|
-
return move(unnest_function);
|
|
19
|
+
return std::move(unnest_function);
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
static unique_ptr<ParsedExpression> SummarizeCreateAggregate(const string &aggregate, string column_name) {
|
|
23
23
|
vector<unique_ptr<ParsedExpression>> children;
|
|
24
|
-
children.push_back(make_unique<ColumnRefExpression>(move(column_name)));
|
|
25
|
-
auto aggregate_function = make_unique<FunctionExpression>(aggregate, move(children));
|
|
26
|
-
auto cast_function = make_unique<CastExpression>(LogicalType::VARCHAR, move(aggregate_function));
|
|
27
|
-
return move(cast_function);
|
|
24
|
+
children.push_back(make_unique<ColumnRefExpression>(std::move(column_name)));
|
|
25
|
+
auto aggregate_function = make_unique<FunctionExpression>(aggregate, std::move(children));
|
|
26
|
+
auto cast_function = make_unique<CastExpression>(LogicalType::VARCHAR, std::move(aggregate_function));
|
|
27
|
+
return std::move(cast_function);
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
static unique_ptr<ParsedExpression> SummarizeCreateAggregate(const string &aggregate, string column_name,
|
|
31
31
|
const Value &modifier) {
|
|
32
32
|
vector<unique_ptr<ParsedExpression>> children;
|
|
33
|
-
children.push_back(make_unique<ColumnRefExpression>(move(column_name)));
|
|
33
|
+
children.push_back(make_unique<ColumnRefExpression>(std::move(column_name)));
|
|
34
34
|
children.push_back(make_unique<ConstantExpression>(modifier));
|
|
35
|
-
auto aggregate_function = make_unique<FunctionExpression>(aggregate, move(children));
|
|
36
|
-
auto cast_function = make_unique<CastExpression>(LogicalType::VARCHAR, move(aggregate_function));
|
|
37
|
-
return move(cast_function);
|
|
35
|
+
auto aggregate_function = make_unique<FunctionExpression>(aggregate, std::move(children));
|
|
36
|
+
auto cast_function = make_unique<CastExpression>(LogicalType::VARCHAR, std::move(aggregate_function));
|
|
37
|
+
return std::move(cast_function);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
static unique_ptr<ParsedExpression> SummarizeCreateCountStar() {
|
|
41
41
|
vector<unique_ptr<ParsedExpression>> children;
|
|
42
|
-
auto aggregate_function = make_unique<FunctionExpression>("count_star", move(children));
|
|
43
|
-
return move(aggregate_function);
|
|
42
|
+
auto aggregate_function = make_unique<FunctionExpression>("count_star", std::move(children));
|
|
43
|
+
return std::move(aggregate_function);
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
static unique_ptr<ParsedExpression> SummarizeCreateBinaryFunction(const string &op, unique_ptr<ParsedExpression> left,
|
|
47
47
|
unique_ptr<ParsedExpression> right) {
|
|
48
48
|
vector<unique_ptr<ParsedExpression>> children;
|
|
49
|
-
children.push_back(move(left));
|
|
50
|
-
children.push_back(move(right));
|
|
51
|
-
auto binary_function = make_unique<FunctionExpression>(op, move(children));
|
|
52
|
-
return move(binary_function);
|
|
49
|
+
children.push_back(std::move(left));
|
|
50
|
+
children.push_back(std::move(right));
|
|
51
|
+
auto binary_function = make_unique<FunctionExpression>(op, std::move(children));
|
|
52
|
+
return std::move(binary_function);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
static unique_ptr<ParsedExpression> SummarizeCreateNullPercentage(string column_name) {
|
|
56
56
|
auto count_star = make_unique<CastExpression>(LogicalType::DOUBLE, SummarizeCreateCountStar());
|
|
57
|
-
auto count =
|
|
58
|
-
|
|
59
|
-
auto
|
|
60
|
-
|
|
57
|
+
auto count =
|
|
58
|
+
make_unique<CastExpression>(LogicalType::DOUBLE, SummarizeCreateAggregate("count", std::move(column_name)));
|
|
59
|
+
auto null_percentage = SummarizeCreateBinaryFunction("/", std::move(count), std::move(count_star));
|
|
60
|
+
auto negate_x = SummarizeCreateBinaryFunction("-", make_unique<ConstantExpression>(Value::DOUBLE(1)),
|
|
61
|
+
std::move(null_percentage));
|
|
61
62
|
auto percentage_x =
|
|
62
|
-
SummarizeCreateBinaryFunction("*", move(negate_x), make_unique<ConstantExpression>(Value::DOUBLE(100)));
|
|
63
|
-
auto round_x =
|
|
64
|
-
|
|
65
|
-
auto concat_x =
|
|
63
|
+
SummarizeCreateBinaryFunction("*", std::move(negate_x), make_unique<ConstantExpression>(Value::DOUBLE(100)));
|
|
64
|
+
auto round_x = SummarizeCreateBinaryFunction("round", std::move(percentage_x),
|
|
65
|
+
make_unique<ConstantExpression>(Value::INTEGER(2)));
|
|
66
|
+
auto concat_x =
|
|
67
|
+
SummarizeCreateBinaryFunction("concat", std::move(round_x), make_unique<ConstantExpression>(Value("%")));
|
|
66
68
|
|
|
67
69
|
return concat_x;
|
|
68
70
|
}
|
|
@@ -87,7 +89,7 @@ BoundStatement Binder::BindSummarize(ShowStatement &stmt) {
|
|
|
87
89
|
vector<unique_ptr<ParsedExpression>> count_children;
|
|
88
90
|
vector<unique_ptr<ParsedExpression>> null_percentage_children;
|
|
89
91
|
auto select = make_unique<SelectStatement>();
|
|
90
|
-
select->node = move(query_copy);
|
|
92
|
+
select->node = std::move(query_copy);
|
|
91
93
|
for (idx_t i = 0; i < plan.names.size(); i++) {
|
|
92
94
|
name_children.push_back(make_unique<ConstantExpression>(Value(plan.names[i])));
|
|
93
95
|
type_children.push_back(make_unique<ConstantExpression>(Value(plan.types[i].ToString())));
|
|
@@ -110,7 +112,7 @@ BoundStatement Binder::BindSummarize(ShowStatement &stmt) {
|
|
|
110
112
|
count_children.push_back(SummarizeCreateCountStar());
|
|
111
113
|
null_percentage_children.push_back(SummarizeCreateNullPercentage(plan.names[i]));
|
|
112
114
|
}
|
|
113
|
-
auto subquery_ref = make_unique<SubqueryRef>(move(select), "summarize_tbl");
|
|
115
|
+
auto subquery_ref = make_unique<SubqueryRef>(std::move(select), "summarize_tbl");
|
|
114
116
|
subquery_ref->column_name_alias = plan.names;
|
|
115
117
|
|
|
116
118
|
auto select_node = make_unique<SelectNode>();
|
|
@@ -126,7 +128,7 @@ BoundStatement Binder::BindSummarize(ShowStatement &stmt) {
|
|
|
126
128
|
select_node->select_list.push_back(SummarizeWrapUnnest(q75_children, "q75"));
|
|
127
129
|
select_node->select_list.push_back(SummarizeWrapUnnest(count_children, "count"));
|
|
128
130
|
select_node->select_list.push_back(SummarizeWrapUnnest(null_percentage_children, "null_percentage"));
|
|
129
|
-
select_node->from_table = move(subquery_ref);
|
|
131
|
+
select_node->from_table = std::move(subquery_ref);
|
|
130
132
|
|
|
131
133
|
properties.return_type = StatementReturnType::QUERY_RESULT;
|
|
132
134
|
return Bind(*select_node);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#include "duckdb/parser/expression/columnref_expression.hpp"
|
|
2
2
|
#include "duckdb/parser/statement/update_statement.hpp"
|
|
3
3
|
#include "duckdb/planner/binder.hpp"
|
|
4
|
+
#include "duckdb/planner/tableref/bound_joinref.hpp"
|
|
4
5
|
#include "duckdb/planner/bound_tableref.hpp"
|
|
5
6
|
#include "duckdb/planner/constraints/bound_check_constraint.hpp"
|
|
6
7
|
#include "duckdb/planner/expression/bound_columnref_expression.hpp"
|
|
@@ -12,7 +13,7 @@
|
|
|
12
13
|
#include "duckdb/planner/operator/logical_projection.hpp"
|
|
13
14
|
#include "duckdb/planner/operator/logical_update.hpp"
|
|
14
15
|
#include "duckdb/planner/tableref/bound_basetableref.hpp"
|
|
15
|
-
#include "duckdb/
|
|
16
|
+
#include "duckdb/catalog/catalog_entry/duck_table_entry.hpp"
|
|
16
17
|
#include "duckdb/storage/data_table.hpp"
|
|
17
18
|
|
|
18
19
|
#include <algorithm>
|
|
@@ -42,7 +43,7 @@ static void BindExtraColumns(TableCatalogEntry &table, LogicalGet &get, LogicalP
|
|
|
42
43
|
continue;
|
|
43
44
|
}
|
|
44
45
|
// column is not projected yet: project it by adding the clause "i=i" to the set of updated columns
|
|
45
|
-
auto &column = table.
|
|
46
|
+
auto &column = table.GetColumns().GetColumn(check_column_id);
|
|
46
47
|
update.expressions.push_back(make_unique<BoundColumnRefExpression>(
|
|
47
48
|
column.Type(), ColumnBinding(proj.table_index, proj.expressions.size())));
|
|
48
49
|
proj.expressions.push_back(make_unique<BoundColumnRefExpression>(
|
|
@@ -76,21 +77,25 @@ static bool TypeSupportsRegularUpdate(const LogicalType &type) {
|
|
|
76
77
|
|
|
77
78
|
static void BindUpdateConstraints(TableCatalogEntry &table, LogicalGet &get, LogicalProjection &proj,
|
|
78
79
|
LogicalUpdate &update) {
|
|
80
|
+
if (!table.IsDuckTable()) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
79
83
|
// check the constraints and indexes of the table to see if we need to project any additional columns
|
|
80
84
|
// we do this for indexes with multiple columns and CHECK constraints in the UPDATE clause
|
|
81
85
|
// suppose we have a constraint CHECK(i + j < 10); now we need both i and j to check the constraint
|
|
82
86
|
// if we are only updating one of the two columns we add the other one to the UPDATE set
|
|
83
87
|
// with a "useless" update (i.e. i=i) so we can verify that the CHECK constraint is not violated
|
|
84
|
-
for (auto &constraint : table.
|
|
88
|
+
for (auto &constraint : table.GetBoundConstraints()) {
|
|
85
89
|
if (constraint->type == ConstraintType::CHECK) {
|
|
86
90
|
auto &check = *reinterpret_cast<BoundCheckConstraint *>(constraint.get());
|
|
87
91
|
// check constraint! check if we need to add any extra columns to the UPDATE clause
|
|
88
92
|
BindExtraColumns(table, get, proj, update, check.bound_columns);
|
|
89
93
|
}
|
|
90
94
|
}
|
|
95
|
+
auto &storage = table.GetStorage();
|
|
91
96
|
if (update.return_chunk) {
|
|
92
97
|
physical_index_set_t all_columns;
|
|
93
|
-
for (idx_t i = 0; i <
|
|
98
|
+
for (idx_t i = 0; i < storage.column_definitions.size(); i++) {
|
|
94
99
|
all_columns.insert(PhysicalIndex(i));
|
|
95
100
|
}
|
|
96
101
|
BindExtraColumns(table, get, proj, update, all_columns);
|
|
@@ -100,7 +105,7 @@ static void BindUpdateConstraints(TableCatalogEntry &table, LogicalGet &get, Log
|
|
|
100
105
|
// If the returning keyword is used, we need access to the whole row in case the user requests it.
|
|
101
106
|
// Therefore switch the update to a delete and insert.
|
|
102
107
|
update.update_is_del_and_insert = false;
|
|
103
|
-
|
|
108
|
+
storage.info->indexes.Scan([&](Index &index) {
|
|
104
109
|
if (index.IndexIsUpdated(update.columns)) {
|
|
105
110
|
update.update_is_del_and_insert = true;
|
|
106
111
|
return true;
|
|
@@ -110,7 +115,7 @@ static void BindUpdateConstraints(TableCatalogEntry &table, LogicalGet &get, Log
|
|
|
110
115
|
|
|
111
116
|
// we also convert any updates on LIST columns into delete + insert
|
|
112
117
|
for (auto &col_index : update.columns) {
|
|
113
|
-
auto &column = table.
|
|
118
|
+
auto &column = table.GetColumns().GetColumn(col_index);
|
|
114
119
|
if (!TypeSupportsRegularUpdate(column.Type())) {
|
|
115
120
|
update.update_is_del_and_insert = true;
|
|
116
121
|
break;
|
|
@@ -121,13 +126,58 @@ static void BindUpdateConstraints(TableCatalogEntry &table, LogicalGet &get, Log
|
|
|
121
126
|
// the update updates a column required by an index or requires returning the updated rows,
|
|
122
127
|
// push projections for all columns
|
|
123
128
|
physical_index_set_t all_columns;
|
|
124
|
-
for (idx_t i = 0; i <
|
|
129
|
+
for (idx_t i = 0; i < storage.column_definitions.size(); i++) {
|
|
125
130
|
all_columns.insert(PhysicalIndex(i));
|
|
126
131
|
}
|
|
127
132
|
BindExtraColumns(table, get, proj, update, all_columns);
|
|
128
133
|
}
|
|
129
134
|
}
|
|
130
135
|
|
|
136
|
+
// This creates a LogicalProjection and moves 'root' into it as a child
|
|
137
|
+
// unless there are no expressions to project, in which case it just returns 'root'
|
|
138
|
+
unique_ptr<LogicalOperator> Binder::BindUpdateSet(LogicalOperator *op, unique_ptr<LogicalOperator> root,
|
|
139
|
+
UpdateSetInfo &set_info, TableCatalogEntry *table,
|
|
140
|
+
vector<PhysicalIndex> &columns) {
|
|
141
|
+
auto proj_index = GenerateTableIndex();
|
|
142
|
+
|
|
143
|
+
vector<unique_ptr<Expression>> projection_expressions;
|
|
144
|
+
D_ASSERT(set_info.columns.size() == set_info.expressions.size());
|
|
145
|
+
for (idx_t i = 0; i < set_info.columns.size(); i++) {
|
|
146
|
+
auto &colname = set_info.columns[i];
|
|
147
|
+
auto &expr = set_info.expressions[i];
|
|
148
|
+
if (!table->ColumnExists(colname)) {
|
|
149
|
+
throw BinderException("Referenced update column %s not found in table!", colname);
|
|
150
|
+
}
|
|
151
|
+
auto &column = table->GetColumn(colname);
|
|
152
|
+
if (column.Generated()) {
|
|
153
|
+
throw BinderException("Cant update column \"%s\" because it is a generated column!", column.Name());
|
|
154
|
+
}
|
|
155
|
+
if (std::find(columns.begin(), columns.end(), column.Physical()) != columns.end()) {
|
|
156
|
+
throw BinderException("Multiple assignments to same column \"%s\"", colname);
|
|
157
|
+
}
|
|
158
|
+
columns.push_back(column.Physical());
|
|
159
|
+
if (expr->type == ExpressionType::VALUE_DEFAULT) {
|
|
160
|
+
op->expressions.push_back(make_unique<BoundDefaultExpression>(column.Type()));
|
|
161
|
+
} else {
|
|
162
|
+
UpdateBinder binder(*this, context);
|
|
163
|
+
binder.target_type = column.Type();
|
|
164
|
+
auto bound_expr = binder.Bind(expr);
|
|
165
|
+
PlanSubqueries(&bound_expr, &root);
|
|
166
|
+
|
|
167
|
+
op->expressions.push_back(make_unique<BoundColumnRefExpression>(
|
|
168
|
+
bound_expr->return_type, ColumnBinding(proj_index, projection_expressions.size())));
|
|
169
|
+
projection_expressions.push_back(std::move(bound_expr));
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
if (op->type != LogicalOperatorType::LOGICAL_UPDATE && projection_expressions.empty()) {
|
|
173
|
+
return root;
|
|
174
|
+
}
|
|
175
|
+
// now create the projection
|
|
176
|
+
auto proj = make_unique<LogicalProjection>(proj_index, std::move(projection_expressions));
|
|
177
|
+
proj->AddChild(std::move(root));
|
|
178
|
+
return unique_ptr_cast<LogicalProjection, LogicalOperator>(std::move(proj));
|
|
179
|
+
}
|
|
180
|
+
|
|
131
181
|
BoundStatement Binder::Bind(UpdateStatement &stmt) {
|
|
132
182
|
BoundStatement result;
|
|
133
183
|
unique_ptr<LogicalOperator> root;
|
|
@@ -145,8 +195,8 @@ BoundStatement Binder::Bind(UpdateStatement &stmt) {
|
|
|
145
195
|
AddCTEMap(stmt.cte_map);
|
|
146
196
|
|
|
147
197
|
if (stmt.from_table) {
|
|
148
|
-
|
|
149
|
-
bound_crossproduct.left = move(bound_table);
|
|
198
|
+
BoundJoinRef bound_crossproduct(JoinRefType::CROSS);
|
|
199
|
+
bound_crossproduct.left = std::move(bound_table);
|
|
150
200
|
bound_crossproduct.right = Bind(*stmt.from_table);
|
|
151
201
|
root = CreatePlan(bound_crossproduct);
|
|
152
202
|
get = (LogicalGet *)root->children[0].get();
|
|
@@ -166,80 +216,48 @@ BoundStatement Binder::Bind(UpdateStatement &stmt) {
|
|
|
166
216
|
update->return_chunk = true;
|
|
167
217
|
}
|
|
168
218
|
// bind the default values
|
|
169
|
-
BindDefaultValues(table->
|
|
219
|
+
BindDefaultValues(table->GetColumns(), update->bound_defaults);
|
|
170
220
|
|
|
171
221
|
// project any additional columns required for the condition/expressions
|
|
172
|
-
if (stmt.condition) {
|
|
222
|
+
if (stmt.set_info->condition) {
|
|
173
223
|
WhereBinder binder(*this, context);
|
|
174
|
-
auto condition = binder.Bind(stmt.condition);
|
|
224
|
+
auto condition = binder.Bind(stmt.set_info->condition);
|
|
175
225
|
|
|
176
226
|
PlanSubqueries(&condition, &root);
|
|
177
|
-
auto filter = make_unique<LogicalFilter>(move(condition));
|
|
178
|
-
filter->AddChild(move(root));
|
|
179
|
-
root = move(filter);
|
|
227
|
+
auto filter = make_unique<LogicalFilter>(std::move(condition));
|
|
228
|
+
filter->AddChild(std::move(root));
|
|
229
|
+
root = std::move(filter);
|
|
180
230
|
}
|
|
181
231
|
|
|
182
|
-
D_ASSERT(stmt.
|
|
183
|
-
|
|
184
|
-
auto proj_index = GenerateTableIndex();
|
|
185
|
-
vector<unique_ptr<Expression>> projection_expressions;
|
|
232
|
+
D_ASSERT(stmt.set_info);
|
|
233
|
+
D_ASSERT(stmt.set_info->columns.size() == stmt.set_info->expressions.size());
|
|
186
234
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
if (!table->ColumnExists(colname)) {
|
|
191
|
-
throw BinderException("Referenced update column %s not found in table!", colname);
|
|
192
|
-
}
|
|
193
|
-
auto &column = table->GetColumn(colname);
|
|
194
|
-
if (column.Generated()) {
|
|
195
|
-
throw BinderException("Cant update column \"%s\" because it is a generated column!", column.Name());
|
|
196
|
-
}
|
|
197
|
-
if (std::find(update->columns.begin(), update->columns.end(), column.Physical()) != update->columns.end()) {
|
|
198
|
-
throw BinderException("Multiple assignments to same column \"%s\"", colname);
|
|
199
|
-
}
|
|
200
|
-
update->columns.push_back(column.Physical());
|
|
201
|
-
|
|
202
|
-
if (expr->type == ExpressionType::VALUE_DEFAULT) {
|
|
203
|
-
update->expressions.push_back(make_unique<BoundDefaultExpression>(column.Type()));
|
|
204
|
-
} else {
|
|
205
|
-
UpdateBinder binder(*this, context);
|
|
206
|
-
binder.target_type = column.Type();
|
|
207
|
-
auto bound_expr = binder.Bind(expr);
|
|
208
|
-
PlanSubqueries(&bound_expr, &root);
|
|
209
|
-
|
|
210
|
-
update->expressions.push_back(make_unique<BoundColumnRefExpression>(
|
|
211
|
-
bound_expr->return_type, ColumnBinding(proj_index, projection_expressions.size())));
|
|
212
|
-
projection_expressions.push_back(move(bound_expr));
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
// now create the projection
|
|
217
|
-
auto proj = make_unique<LogicalProjection>(proj_index, move(projection_expressions));
|
|
218
|
-
proj->AddChild(move(root));
|
|
235
|
+
auto proj_tmp = BindUpdateSet(update.get(), std::move(root), *stmt.set_info, table, update->columns);
|
|
236
|
+
D_ASSERT(proj_tmp->type == LogicalOperatorType::LOGICAL_PROJECTION);
|
|
237
|
+
auto proj = unique_ptr_cast<LogicalOperator, LogicalProjection>(std::move(proj_tmp));
|
|
219
238
|
|
|
220
239
|
// bind any extra columns necessary for CHECK constraints or indexes
|
|
221
240
|
BindUpdateConstraints(*table, *get, *proj, *update);
|
|
222
|
-
|
|
223
241
|
// finally add the row id column to the projection list
|
|
224
242
|
proj->expressions.push_back(make_unique<BoundColumnRefExpression>(
|
|
225
243
|
LogicalType::ROW_TYPE, ColumnBinding(get->table_index, get->column_ids.size())));
|
|
226
244
|
get->column_ids.push_back(COLUMN_IDENTIFIER_ROW_ID);
|
|
227
245
|
|
|
228
246
|
// set the projection as child of the update node and finalize the result
|
|
229
|
-
update->AddChild(move(proj));
|
|
247
|
+
update->AddChild(std::move(proj));
|
|
230
248
|
|
|
231
249
|
auto update_table_index = GenerateTableIndex();
|
|
232
250
|
update->table_index = update_table_index;
|
|
233
251
|
if (!stmt.returning_list.empty()) {
|
|
234
|
-
unique_ptr<LogicalOperator> update_as_logicaloperator = move(update);
|
|
252
|
+
unique_ptr<LogicalOperator> update_as_logicaloperator = std::move(update);
|
|
235
253
|
|
|
236
|
-
return BindReturning(move(stmt.returning_list), table, update_table_index,
|
|
237
|
-
move(result));
|
|
254
|
+
return BindReturning(std::move(stmt.returning_list), table, update_table_index,
|
|
255
|
+
std::move(update_as_logicaloperator), std::move(result));
|
|
238
256
|
}
|
|
239
257
|
|
|
240
258
|
result.names = {"Count"};
|
|
241
259
|
result.types = {LogicalType::BIGINT};
|
|
242
|
-
result.plan = move(update);
|
|
260
|
+
result.plan = std::move(update);
|
|
243
261
|
properties.allow_stream_result = false;
|
|
244
262
|
properties.return_type = StatementReturnType::CHANGED_ROWS;
|
|
245
263
|
return result;
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
#include "duckdb/planner/operator/logical_get.hpp"
|
|
5
5
|
#include "duckdb/planner/operator/logical_projection.hpp"
|
|
6
6
|
#include "duckdb/planner/operator/logical_simple.hpp"
|
|
7
|
+
#include "duckdb/catalog/catalog_entry/table_catalog_entry.hpp"
|
|
7
8
|
|
|
8
9
|
namespace duckdb {
|
|
9
10
|
|
|
@@ -19,7 +20,7 @@ BoundStatement Binder::Bind(VacuumStatement &stmt) {
|
|
|
19
20
|
if (bound_table->type != TableReferenceType::BASE_TABLE) {
|
|
20
21
|
throw InvalidInputException("Can only vacuum/analyze base tables!");
|
|
21
22
|
}
|
|
22
|
-
auto ref = unique_ptr_cast<BoundTableRef, BoundBaseTableRef>(move(bound_table));
|
|
23
|
+
auto ref = unique_ptr_cast<BoundTableRef, BoundBaseTableRef>(std::move(bound_table));
|
|
23
24
|
stmt.info->table = ref->table;
|
|
24
25
|
|
|
25
26
|
auto &columns = stmt.info->columns;
|
|
@@ -51,9 +52,9 @@ BoundStatement Binder::Bind(VacuumStatement &stmt) {
|
|
|
51
52
|
if (result.HasError()) {
|
|
52
53
|
throw BinderException(result.error);
|
|
53
54
|
}
|
|
54
|
-
select_list.push_back(move(result.expression));
|
|
55
|
+
select_list.push_back(std::move(result.expression));
|
|
55
56
|
}
|
|
56
|
-
stmt.info->columns = move(non_generated_column_names);
|
|
57
|
+
stmt.info->columns = std::move(non_generated_column_names);
|
|
57
58
|
if (!select_list.empty()) {
|
|
58
59
|
auto table_scan = CreatePlan(*ref);
|
|
59
60
|
D_ASSERT(table_scan->type == LogicalOperatorType::LOGICAL_GET);
|
|
@@ -64,13 +65,13 @@ BoundStatement Binder::Bind(VacuumStatement &stmt) {
|
|
|
64
65
|
D_ASSERT(stmt.info->columns.size() == get.column_ids.size());
|
|
65
66
|
for (idx_t i = 0; i < get.column_ids.size(); i++) {
|
|
66
67
|
stmt.info->column_id_map[i] =
|
|
67
|
-
ref->table->
|
|
68
|
+
ref->table->GetColumns().LogicalToPhysical(LogicalIndex(get.column_ids[i])).index;
|
|
68
69
|
}
|
|
69
70
|
|
|
70
|
-
auto projection = make_unique<LogicalProjection>(GenerateTableIndex(), move(select_list));
|
|
71
|
-
projection->children.push_back(move(table_scan));
|
|
71
|
+
auto projection = make_unique<LogicalProjection>(GenerateTableIndex(), std::move(select_list));
|
|
72
|
+
projection->children.push_back(std::move(table_scan));
|
|
72
73
|
|
|
73
|
-
root = move(projection);
|
|
74
|
+
root = std::move(projection);
|
|
74
75
|
} else {
|
|
75
76
|
// eg. CREATE TABLE test (x AS (1));
|
|
76
77
|
// ANALYZE test;
|
|
@@ -78,14 +79,14 @@ BoundStatement Binder::Bind(VacuumStatement &stmt) {
|
|
|
78
79
|
stmt.info->has_table = false;
|
|
79
80
|
}
|
|
80
81
|
}
|
|
81
|
-
auto vacuum = make_unique<LogicalSimple>(LogicalOperatorType::LOGICAL_VACUUM, move(stmt.info));
|
|
82
|
+
auto vacuum = make_unique<LogicalSimple>(LogicalOperatorType::LOGICAL_VACUUM, std::move(stmt.info));
|
|
82
83
|
if (root) {
|
|
83
|
-
vacuum->children.push_back(move(root));
|
|
84
|
+
vacuum->children.push_back(std::move(root));
|
|
84
85
|
}
|
|
85
86
|
|
|
86
87
|
result.names = {"Success"};
|
|
87
88
|
result.types = {LogicalType::BOOLEAN};
|
|
88
|
-
result.plan = move(vacuum);
|
|
89
|
+
result.plan = std::move(vacuum);
|
|
89
90
|
properties.return_type = StatementReturnType::NOTHING;
|
|
90
91
|
return result;
|
|
91
92
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
#include "duckdb/catalog/catalog_entry/table_catalog_entry.hpp"
|
|
1
2
|
#include "duckdb/catalog/catalog_entry/view_catalog_entry.hpp"
|
|
2
3
|
#include "duckdb/parser/tableref/basetableref.hpp"
|
|
3
4
|
#include "duckdb/parser/tableref/subqueryref.hpp"
|
|
@@ -8,7 +9,6 @@
|
|
|
8
9
|
#include "duckdb/planner/tableref/bound_cteref.hpp"
|
|
9
10
|
#include "duckdb/planner/operator/logical_get.hpp"
|
|
10
11
|
#include "duckdb/parser/statement/select_statement.hpp"
|
|
11
|
-
#include "duckdb/function/table/table_scan.hpp"
|
|
12
12
|
#include "duckdb/common/string_util.hpp"
|
|
13
13
|
#include "duckdb/parser/tableref/table_function_ref.hpp"
|
|
14
14
|
#include "duckdb/main/config.hpp"
|
|
@@ -57,8 +57,8 @@ unique_ptr<BoundTableRef> Binder::Bind(BaseTableRef &ref) {
|
|
|
57
57
|
(*cteref)++;
|
|
58
58
|
|
|
59
59
|
result->types = b->types;
|
|
60
|
-
result->bound_columns = move(names);
|
|
61
|
-
return move(result);
|
|
60
|
+
result->bound_columns = std::move(names);
|
|
61
|
+
return std::move(result);
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
// not a CTE
|
|
@@ -79,7 +79,16 @@ unique_ptr<BoundTableRef> Binder::Bind(BaseTableRef &ref) {
|
|
|
79
79
|
auto replacement_function = scan.function(context, table_name, scan.data.get());
|
|
80
80
|
if (replacement_function) {
|
|
81
81
|
replacement_function->alias = ref.alias.empty() ? ref.table_name : ref.alias;
|
|
82
|
-
replacement_function->
|
|
82
|
+
if (replacement_function->type == TableReferenceType::TABLE_FUNCTION) {
|
|
83
|
+
auto &table_function = (TableFunctionRef &)*replacement_function;
|
|
84
|
+
table_function.column_name_alias = ref.column_name_alias;
|
|
85
|
+
;
|
|
86
|
+
} else if (replacement_function->type == TableReferenceType::SUBQUERY) {
|
|
87
|
+
auto &subquery = (SubqueryRef &)*replacement_function;
|
|
88
|
+
subquery.column_name_alias = ref.column_name_alias;
|
|
89
|
+
} else {
|
|
90
|
+
throw InternalException("Replacement scan should return either a table function or a subquery");
|
|
91
|
+
}
|
|
83
92
|
return Bind(*replacement_function);
|
|
84
93
|
}
|
|
85
94
|
}
|
|
@@ -108,8 +117,8 @@ unique_ptr<BoundTableRef> Binder::Bind(BaseTableRef &ref) {
|
|
|
108
117
|
auto table_index = GenerateTableIndex();
|
|
109
118
|
auto table = (TableCatalogEntry *)table_or_view;
|
|
110
119
|
|
|
111
|
-
|
|
112
|
-
auto
|
|
120
|
+
unique_ptr<FunctionData> bind_data;
|
|
121
|
+
auto scan_function = table->GetScanFunction(context, bind_data);
|
|
113
122
|
auto alias = ref.alias.empty() ? ref.table_name : ref.alias;
|
|
114
123
|
// TODO: bundle the type and name vector in a struct (e.g PackedColumnMetadata)
|
|
115
124
|
vector<LogicalType> table_types;
|
|
@@ -118,7 +127,7 @@ unique_ptr<BoundTableRef> Binder::Bind(BaseTableRef &ref) {
|
|
|
118
127
|
|
|
119
128
|
vector<LogicalType> return_types;
|
|
120
129
|
vector<string> return_names;
|
|
121
|
-
for (auto &col : table->
|
|
130
|
+
for (auto &col : table->GetColumns().Logical()) {
|
|
122
131
|
table_types.push_back(col.Type());
|
|
123
132
|
table_names.push_back(col.Name());
|
|
124
133
|
return_types.push_back(col.Type());
|
|
@@ -126,11 +135,11 @@ unique_ptr<BoundTableRef> Binder::Bind(BaseTableRef &ref) {
|
|
|
126
135
|
}
|
|
127
136
|
table_names = BindContext::AliasColumnNames(alias, table_names, ref.column_name_alias);
|
|
128
137
|
|
|
129
|
-
auto logical_get = make_unique<LogicalGet>(table_index, scan_function, move(bind_data),
|
|
130
|
-
move(return_names));
|
|
138
|
+
auto logical_get = make_unique<LogicalGet>(table_index, scan_function, std::move(bind_data),
|
|
139
|
+
std::move(return_types), std::move(return_names));
|
|
131
140
|
bind_context.AddBaseTable(table_index, alias, table_names, table_types, logical_get->column_ids,
|
|
132
141
|
logical_get->GetTable());
|
|
133
|
-
return make_unique_base<BoundTableRef, BoundBaseTableRef>(table, move(logical_get));
|
|
142
|
+
return make_unique_base<BoundTableRef, BoundBaseTableRef>(table, std::move(logical_get));
|
|
134
143
|
}
|
|
135
144
|
case CatalogType::VIEW_ENTRY: {
|
|
136
145
|
// the node is a view: get the query that the view represents
|
|
@@ -30,9 +30,9 @@ unique_ptr<BoundTableRef> Binder::Bind(ExpressionListRef &expr) {
|
|
|
30
30
|
binder.target_type = result->types[val_idx];
|
|
31
31
|
}
|
|
32
32
|
auto expr = binder.Bind(expression_list[val_idx]);
|
|
33
|
-
list.push_back(move(expr));
|
|
33
|
+
list.push_back(std::move(expr));
|
|
34
34
|
}
|
|
35
|
-
result->values.push_back(move(list));
|
|
35
|
+
result->values.push_back(std::move(list));
|
|
36
36
|
}
|
|
37
37
|
if (result->types.empty() && !expr.values.empty()) {
|
|
38
38
|
// there are no types specified
|
|
@@ -53,13 +53,13 @@ unique_ptr<BoundTableRef> Binder::Bind(ExpressionListRef &expr) {
|
|
|
53
53
|
auto &list = result->values[list_idx];
|
|
54
54
|
for (idx_t val_idx = 0; val_idx < list.size(); val_idx++) {
|
|
55
55
|
list[val_idx] =
|
|
56
|
-
BoundCastExpression::AddCastToType(context, move(list[val_idx]), result->types[val_idx]);
|
|
56
|
+
BoundCastExpression::AddCastToType(context, std::move(list[val_idx]), result->types[val_idx]);
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
result->bind_index = GenerateTableIndex();
|
|
61
61
|
bind_context.AddGenericBinding(result->bind_index, expr.alias, result->names, result->types);
|
|
62
|
-
return move(result);
|
|
62
|
+
return std::move(result);
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
} // namespace duckdb
|
|
@@ -18,7 +18,7 @@ static unique_ptr<ParsedExpression> BindColumn(Binder &binder, ClientContext &co
|
|
|
18
18
|
auto expr = make_unique_base<ParsedExpression, ColumnRefExpression>(column_name, alias);
|
|
19
19
|
ExpressionBinder expr_binder(binder, context);
|
|
20
20
|
auto result = expr_binder.Bind(expr);
|
|
21
|
-
return make_unique<BoundExpression>(move(result));
|
|
21
|
+
return make_unique<BoundExpression>(std::move(result));
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
static unique_ptr<ParsedExpression> AddCondition(ClientContext &context, Binder &left_binder, Binder &right_binder,
|
|
@@ -27,7 +27,7 @@ static unique_ptr<ParsedExpression> AddCondition(ClientContext &context, Binder
|
|
|
27
27
|
ExpressionBinder expr_binder(left_binder, context);
|
|
28
28
|
auto left = BindColumn(left_binder, context, left_alias, column_name);
|
|
29
29
|
auto right = BindColumn(right_binder, context, right_alias, column_name);
|
|
30
|
-
return make_unique<ComparisonExpression>(ExpressionType::COMPARE_EQUAL, move(left), move(right));
|
|
30
|
+
return make_unique<ComparisonExpression>(ExpressionType::COMPARE_EQUAL, std::move(left), std::move(right));
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
bool Binder::TryFindBinding(const string &using_column, const string &join_side, string &result) {
|
|
@@ -117,7 +117,7 @@ static vector<string> RemoveDuplicateUsingColumns(const vector<string> &using_co
|
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
unique_ptr<BoundTableRef> Binder::Bind(JoinRef &ref) {
|
|
120
|
-
auto result = make_unique<BoundJoinRef>();
|
|
120
|
+
auto result = make_unique<BoundJoinRef>(ref.ref_type);
|
|
121
121
|
result->left_binder = Binder::CreateBinder(context, this);
|
|
122
122
|
result->right_binder = Binder::CreateBinder(context, this);
|
|
123
123
|
auto &left_binder = *result->left_binder;
|
|
@@ -140,7 +140,8 @@ unique_ptr<BoundTableRef> Binder::Bind(JoinRef &ref) {
|
|
|
140
140
|
|
|
141
141
|
vector<unique_ptr<ParsedExpression>> extra_conditions;
|
|
142
142
|
vector<string> extra_using_columns;
|
|
143
|
-
|
|
143
|
+
switch (ref.ref_type) {
|
|
144
|
+
case JoinRefType::NATURAL: {
|
|
144
145
|
// natural join, figure out which column names are present in both sides of the join
|
|
145
146
|
// first bind the left hand side and get a list of all the tables and column names
|
|
146
147
|
case_insensitive_set_t lhs_columns;
|
|
@@ -191,10 +192,18 @@ unique_ptr<BoundTableRef> Binder::Bind(JoinRef &ref) {
|
|
|
191
192
|
error_msg += "\n Right candidates: " + right_candidates;
|
|
192
193
|
throw BinderException(FormatError(ref, error_msg));
|
|
193
194
|
}
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
195
|
+
break;
|
|
196
|
+
}
|
|
197
|
+
case JoinRefType::REGULAR:
|
|
198
|
+
if (!ref.using_columns.empty()) {
|
|
199
|
+
// USING columns
|
|
200
|
+
D_ASSERT(!result->condition);
|
|
201
|
+
extra_using_columns = ref.using_columns;
|
|
202
|
+
}
|
|
203
|
+
break;
|
|
204
|
+
case JoinRefType::CROSS:
|
|
205
|
+
case JoinRefType::POSITIONAL:
|
|
206
|
+
break;
|
|
198
207
|
}
|
|
199
208
|
extra_using_columns = RemoveDuplicateUsingColumns(extra_using_columns);
|
|
200
209
|
|
|
@@ -239,28 +248,27 @@ unique_ptr<BoundTableRef> Binder::Bind(JoinRef &ref) {
|
|
|
239
248
|
using_column);
|
|
240
249
|
bind_context.TransferUsingBinding(right_binder.bind_context, right_using_binding, set.get(), right_binding,
|
|
241
250
|
using_column);
|
|
242
|
-
AddUsingBindingSet(move(set));
|
|
251
|
+
AddUsingBindingSet(std::move(set));
|
|
243
252
|
}
|
|
244
253
|
}
|
|
245
254
|
|
|
246
|
-
bind_context.AddContext(move(left_binder.bind_context));
|
|
247
|
-
bind_context.AddContext(move(right_binder.bind_context));
|
|
255
|
+
bind_context.AddContext(std::move(left_binder.bind_context));
|
|
256
|
+
bind_context.AddContext(std::move(right_binder.bind_context));
|
|
248
257
|
MoveCorrelatedExpressions(left_binder);
|
|
249
258
|
MoveCorrelatedExpressions(right_binder);
|
|
250
259
|
for (auto &condition : extra_conditions) {
|
|
251
260
|
if (ref.condition) {
|
|
252
|
-
ref.condition = make_unique<ConjunctionExpression>(ExpressionType::CONJUNCTION_AND,
|
|
253
|
-
move(condition));
|
|
261
|
+
ref.condition = make_unique<ConjunctionExpression>(ExpressionType::CONJUNCTION_AND,
|
|
262
|
+
std::move(ref.condition), std::move(condition));
|
|
254
263
|
} else {
|
|
255
|
-
ref.condition = move(condition);
|
|
264
|
+
ref.condition = std::move(condition);
|
|
256
265
|
}
|
|
257
266
|
}
|
|
258
267
|
if (ref.condition) {
|
|
259
268
|
WhereBinder binder(*this, context);
|
|
260
269
|
result->condition = binder.Bind(ref.condition);
|
|
261
270
|
}
|
|
262
|
-
|
|
263
|
-
return move(result);
|
|
271
|
+
return std::move(result);
|
|
264
272
|
}
|
|
265
273
|
|
|
266
274
|
} // namespace duckdb
|
|
@@ -19,10 +19,10 @@ unique_ptr<BoundTableRef> Binder::Bind(SubqueryRef &ref, CommonTableExpressionIn
|
|
|
19
19
|
} else {
|
|
20
20
|
alias = ref.alias;
|
|
21
21
|
}
|
|
22
|
-
auto result = make_unique<BoundSubqueryRef>(move(binder), move(subquery));
|
|
22
|
+
auto result = make_unique<BoundSubqueryRef>(std::move(binder), std::move(subquery));
|
|
23
23
|
bind_context.AddSubquery(bind_index, alias, ref, *result->subquery);
|
|
24
24
|
MoveCorrelatedExpressions(*result->binder);
|
|
25
|
-
return move(result);
|
|
25
|
+
return std::move(result);
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
} // namespace duckdb
|