duckdb 0.10.2-dev0.0 → 0.10.2-dev3.0
Sign up to get free protection for your applications and to get access to all the features.
- package/binding.gyp +22 -18
- package/binding.gyp.in +3 -0
- package/package.json +1 -1
- package/src/duckdb/extension/icu/icu-timezone.cpp +3 -1
- package/src/duckdb/extension/icu/icu_extension.cpp +6 -2
- package/src/duckdb/extension/json/buffered_json_reader.cpp +10 -3
- package/src/duckdb/extension/json/include/buffered_json_reader.hpp +2 -0
- package/src/duckdb/extension/json/include/json_scan.hpp +13 -7
- package/src/duckdb/extension/json/include/json_serializer.hpp +5 -4
- package/src/duckdb/extension/json/include/json_structure.hpp +3 -3
- package/src/duckdb/extension/json/json_functions/json_serialize_plan.cpp +15 -5
- package/src/duckdb/extension/json/json_functions/json_serialize_sql.cpp +15 -6
- package/src/duckdb/extension/json/json_functions/json_structure.cpp +21 -20
- package/src/duckdb/extension/json/json_functions/read_json.cpp +37 -3
- package/src/duckdb/extension/json/json_functions.cpp +7 -2
- package/src/duckdb/extension/json/json_scan.cpp +57 -33
- package/src/duckdb/extension/parquet/column_reader.cpp +12 -3
- package/src/duckdb/extension/parquet/column_writer.cpp +44 -7
- package/src/duckdb/extension/parquet/include/parquet_writer.hpp +5 -1
- package/src/duckdb/extension/parquet/parquet_extension.cpp +30 -3
- package/src/duckdb/extension/parquet/parquet_metadata.cpp +1 -1
- package/src/duckdb/extension/parquet/parquet_writer.cpp +4 -2
- package/src/duckdb/extension/parquet/zstd_file_system.cpp +1 -1
- package/src/duckdb/src/catalog/catalog.cpp +5 -1
- package/src/duckdb/src/catalog/catalog_entry/duck_schema_entry.cpp +21 -5
- package/src/duckdb/src/catalog/catalog_entry/duck_table_entry.cpp +8 -9
- package/src/duckdb/src/catalog/catalog_entry/index_catalog_entry.cpp +3 -7
- package/src/duckdb/src/catalog/catalog_entry/sequence_catalog_entry.cpp +1 -1
- package/src/duckdb/src/catalog/catalog_entry/table_catalog_entry.cpp +6 -7
- package/src/duckdb/src/catalog/catalog_entry.cpp +8 -0
- package/src/duckdb/src/catalog/catalog_search_path.cpp +5 -0
- package/src/duckdb/src/catalog/catalog_set.cpp +2 -2
- package/src/duckdb/src/catalog/default/default_functions.cpp +6 -6
- package/src/duckdb/src/catalog/default/default_schemas.cpp +1 -1
- package/src/duckdb/src/catalog/default/default_views.cpp +7 -7
- package/src/duckdb/src/catalog/dependency_catalog_set.cpp +2 -1
- package/src/duckdb/src/catalog/dependency_list.cpp +92 -8
- package/src/duckdb/src/catalog/dependency_manager.cpp +53 -68
- package/src/duckdb/src/catalog/duck_catalog.cpp +1 -1
- package/src/duckdb/src/common/adbc/adbc.cpp +287 -45
- package/src/duckdb/src/common/arrow/appender/union_data.cpp +2 -2
- package/src/duckdb/src/common/box_renderer.cpp +12 -12
- package/src/duckdb/src/common/crypto/md5.cpp +2 -1
- package/src/duckdb/src/common/enum_util.cpp +307 -1
- package/src/duckdb/src/common/enums/expression_type.cpp +4 -0
- package/src/duckdb/src/common/enums/optimizer_type.cpp +1 -1
- package/src/duckdb/src/common/file_system.cpp +60 -13
- package/src/duckdb/src/common/filename_pattern.cpp +13 -13
- package/src/duckdb/src/common/gzip_file_system.cpp +1 -1
- package/src/duckdb/src/common/http_state.cpp +1 -1
- package/src/duckdb/src/common/local_file_system.cpp +72 -71
- package/src/duckdb/src/common/multi_file_reader.cpp +48 -28
- package/src/duckdb/src/common/row_operations/row_matcher.cpp +2 -2
- package/src/duckdb/src/common/serializer/buffered_file_reader.cpp +13 -1
- package/src/duckdb/src/common/serializer/buffered_file_writer.cpp +32 -13
- package/src/duckdb/src/common/string_util.cpp +2 -3
- package/src/duckdb/src/common/tree_renderer.cpp +32 -67
- package/src/duckdb/src/common/types/bit.cpp +6 -6
- package/src/duckdb/src/common/types/data_chunk.cpp +2 -2
- package/src/duckdb/src/common/types/hash.cpp +6 -6
- package/src/duckdb/src/common/types/hyperloglog.cpp +2 -0
- package/src/duckdb/src/common/types/row/tuple_data_allocator.cpp +13 -0
- package/src/duckdb/src/common/types/row/tuple_data_layout.cpp +5 -7
- package/src/duckdb/src/common/types/uuid.cpp +1 -1
- package/src/duckdb/src/common/types/vector.cpp +22 -14
- package/src/duckdb/src/common/types.cpp +8 -1
- package/src/duckdb/src/common/vector_operations/comparison_operators.cpp +20 -18
- package/src/duckdb/src/common/vector_operations/generators.cpp +1 -1
- package/src/duckdb/src/common/vector_operations/is_distinct_from.cpp +267 -110
- package/src/duckdb/src/common/vector_operations/vector_hash.cpp +52 -23
- package/src/duckdb/src/common/virtual_file_system.cpp +33 -20
- package/src/duckdb/src/core_functions/aggregate/algebraic/avg.cpp +2 -2
- package/src/duckdb/src/core_functions/aggregate/distributive/minmax.cpp +3 -3
- package/src/duckdb/src/core_functions/aggregate/distributive/sum.cpp +31 -16
- package/src/duckdb/src/core_functions/aggregate/holistic/quantile.cpp +3 -0
- package/src/duckdb/src/core_functions/aggregate/nested/list.cpp +2 -0
- package/src/duckdb/src/core_functions/core_functions.cpp +1 -1
- package/src/duckdb/src/core_functions/function_list.cpp +2 -2
- package/src/duckdb/src/core_functions/scalar/date/time_bucket.cpp +1 -1
- package/src/duckdb/src/core_functions/scalar/generic/system_functions.cpp +46 -17
- package/src/duckdb/src/core_functions/scalar/list/array_slice.cpp +1 -1
- package/src/duckdb/src/core_functions/scalar/list/flatten.cpp +82 -45
- package/src/duckdb/src/core_functions/scalar/list/list_aggregates.cpp +2 -2
- package/src/duckdb/src/core_functions/scalar/list/list_sort.cpp +3 -0
- package/src/duckdb/src/core_functions/scalar/math/numeric.cpp +3 -2
- package/src/duckdb/src/core_functions/scalar/string/hex.cpp +2 -4
- package/src/duckdb/src/core_functions/scalar/string/repeat.cpp +12 -21
- package/src/duckdb/src/execution/column_binding_resolver.cpp +2 -10
- package/src/duckdb/src/execution/expression_executor/execute_comparison.cpp +133 -66
- package/src/duckdb/src/execution/expression_executor/execute_function.cpp +0 -2
- package/src/duckdb/src/execution/expression_executor.cpp +0 -4
- package/src/duckdb/src/execution/expression_executor_state.cpp +1 -1
- package/src/duckdb/src/execution/index/art/art.cpp +2 -2
- package/src/duckdb/src/execution/index/unknown_index.cpp +13 -13
- package/src/duckdb/src/execution/join_hashtable.cpp +1 -1
- package/src/duckdb/src/execution/nested_loop_join/nested_loop_join_mark.cpp +0 -1
- package/src/duckdb/src/execution/operator/csv_scanner/buffer_manager/csv_buffer.cpp +10 -7
- package/src/duckdb/src/execution/operator/csv_scanner/buffer_manager/csv_buffer_manager.cpp +32 -1
- package/src/duckdb/src/execution/operator/csv_scanner/buffer_manager/csv_file_handle.cpp +16 -2
- package/src/duckdb/src/execution/operator/csv_scanner/scanner/scanner_boundary.cpp +7 -7
- package/src/duckdb/src/execution/operator/csv_scanner/scanner/string_value_scanner.cpp +354 -159
- package/src/duckdb/src/execution/operator/csv_scanner/sniffer/csv_sniffer.cpp +11 -2
- package/src/duckdb/src/execution/operator/csv_scanner/sniffer/dialect_detection.cpp +22 -7
- package/src/duckdb/src/execution/operator/csv_scanner/sniffer/type_detection.cpp +1 -1
- package/src/duckdb/src/execution/operator/csv_scanner/state_machine/csv_state_machine_cache.cpp +10 -10
- package/src/duckdb/src/execution/operator/csv_scanner/table_function/csv_file_scanner.cpp +9 -18
- package/src/duckdb/src/execution/operator/csv_scanner/table_function/global_csv_state.cpp +180 -47
- package/src/duckdb/src/execution/operator/csv_scanner/util/csv_error.cpp +100 -58
- package/src/duckdb/src/execution/operator/csv_scanner/util/csv_reader_options.cpp +88 -21
- package/src/duckdb/src/execution/operator/helper/physical_vacuum.cpp +12 -13
- package/src/duckdb/src/execution/operator/join/physical_iejoin.cpp +2 -0
- package/src/duckdb/src/execution/operator/persistent/csv_rejects_table.cpp +118 -23
- package/src/duckdb/src/execution/operator/persistent/physical_batch_copy_to_file.cpp +2 -2
- package/src/duckdb/src/execution/operator/persistent/physical_batch_insert.cpp +14 -5
- package/src/duckdb/src/execution/operator/persistent/physical_copy_database.cpp +1 -1
- package/src/duckdb/src/execution/operator/persistent/physical_export.cpp +5 -5
- package/src/duckdb/src/execution/operator/schema/physical_attach.cpp +1 -1
- package/src/duckdb/src/execution/physical_plan/plan_simple.cpp +0 -9
- package/src/duckdb/src/execution/physical_plan/plan_vacuum.cpp +18 -0
- package/src/duckdb/src/execution/physical_plan_generator.cpp +5 -3
- package/src/duckdb/src/execution/radix_partitioned_hashtable.cpp +81 -106
- package/src/duckdb/src/execution/reservoir_sample.cpp +1 -1
- package/src/duckdb/src/execution/window_executor.cpp +48 -28
- package/src/duckdb/src/execution/window_segment_tree.cpp +20 -23
- package/src/duckdb/src/function/aggregate/sorted_aggregate_function.cpp +1 -1
- package/src/duckdb/src/function/cast/enum_casts.cpp +20 -55
- package/src/duckdb/src/function/cast/vector_cast_helpers.cpp +10 -9
- package/src/duckdb/src/function/cast_rules.cpp +9 -1
- package/src/duckdb/src/function/compression_config.cpp +1 -1
- package/src/duckdb/src/function/function_binder.cpp +45 -44
- package/src/duckdb/src/function/function_set.cpp +9 -9
- package/src/duckdb/src/function/pragma/pragma_queries.cpp +1 -2
- package/src/duckdb/src/function/scalar/compressed_materialization/compress_integral.cpp +21 -5
- package/src/duckdb/src/function/scalar/compressed_materialization/compress_string.cpp +2 -2
- package/src/duckdb/src/function/scalar/list/list_select.cpp +5 -2
- package/src/duckdb/src/function/scalar/list/list_zip.cpp +5 -4
- package/src/duckdb/src/function/scalar/operators/arithmetic.cpp +60 -32
- package/src/duckdb/src/function/scalar/sequence/nextval.cpp +1 -1
- package/src/duckdb/src/function/scalar/strftime_format.cpp +31 -25
- package/src/duckdb/src/function/scalar/string/caseconvert.cpp +6 -6
- package/src/duckdb/src/function/scalar/string/length.cpp +23 -2
- package/src/duckdb/src/function/scalar/string/like.cpp +1 -1
- package/src/duckdb/src/function/scalar/string/regexp/regexp_extract_all.cpp +1 -1
- package/src/duckdb/src/function/scalar/system/aggregate_export.cpp +3 -3
- package/src/duckdb/src/function/table/arrow/arrow_array_scan_state.cpp +1 -1
- package/src/duckdb/src/function/table/arrow.cpp +7 -1
- package/src/duckdb/src/function/table/copy_csv.cpp +17 -13
- package/src/duckdb/src/function/table/read_csv.cpp +52 -39
- package/src/duckdb/src/function/table/sniff_csv.cpp +7 -13
- package/src/duckdb/src/function/table/system/duckdb_constraints.cpp +1 -1
- package/src/duckdb/src/function/table/system/duckdb_databases.cpp +7 -1
- package/src/duckdb/src/function/table/system/duckdb_extensions.cpp +12 -2
- package/src/duckdb/src/function/table/system/duckdb_sequences.cpp +1 -2
- package/src/duckdb/src/function/table/system/duckdb_tables.cpp +2 -2
- package/src/duckdb/src/function/table/system/pragma_metadata_info.cpp +9 -2
- package/src/duckdb/src/function/table/system/pragma_table_info.cpp +10 -6
- package/src/duckdb/src/function/table/table_scan.cpp +1 -4
- package/src/duckdb/src/function/table/version/pragma_version.cpp +3 -3
- package/src/duckdb/src/include/duckdb/catalog/catalog.hpp +6 -2
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/duck_index_entry.hpp +1 -1
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/duck_schema_entry.hpp +1 -1
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/sequence_catalog_entry.hpp +1 -1
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry.hpp +6 -1
- package/src/duckdb/src/include/duckdb/catalog/catalog_set.hpp +3 -3
- package/src/duckdb/src/include/duckdb/catalog/default/default_functions.hpp +3 -3
- package/src/duckdb/src/include/duckdb/catalog/dependency.hpp +26 -4
- package/src/duckdb/src/include/duckdb/catalog/dependency_list.hpp +39 -6
- package/src/duckdb/src/include/duckdb/catalog/dependency_manager.hpp +19 -14
- package/src/duckdb/src/include/duckdb/catalog/duck_catalog.hpp +1 -1
- package/src/duckdb/src/include/duckdb/catalog/standard_entry.hpp +4 -0
- package/src/duckdb/src/include/duckdb/common/allocator.hpp +3 -3
- package/src/duckdb/src/include/duckdb/common/arrow/arrow_wrapper.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/bit_utils.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/box_renderer.hpp +16 -16
- package/src/duckdb/src/include/duckdb/common/crypto/md5.hpp +0 -1
- package/src/duckdb/src/include/duckdb/common/enum_util.hpp +32 -0
- package/src/duckdb/src/include/duckdb/common/enums/expression_type.hpp +4 -2
- package/src/duckdb/src/include/duckdb/common/exception/binder_exception.hpp +14 -10
- package/src/duckdb/src/include/duckdb/common/exception/catalog_exception.hpp +4 -4
- package/src/duckdb/src/include/duckdb/common/exception/conversion_exception.hpp +6 -6
- package/src/duckdb/src/include/duckdb/common/exception/http_exception.hpp +3 -3
- package/src/duckdb/src/include/duckdb/common/exception/parser_exception.hpp +4 -4
- package/src/duckdb/src/include/duckdb/common/exception/transaction_exception.hpp +2 -2
- package/src/duckdb/src/include/duckdb/common/exception.hpp +57 -58
- package/src/duckdb/src/include/duckdb/common/exception_format_value.hpp +2 -2
- package/src/duckdb/src/include/duckdb/common/extra_type_info.hpp +2 -2
- package/src/duckdb/src/include/duckdb/common/file_open_flags.hpp +134 -0
- package/src/duckdb/src/include/duckdb/common/file_opener.hpp +9 -6
- package/src/duckdb/src/include/duckdb/common/file_system.hpp +35 -36
- package/src/duckdb/src/include/duckdb/common/filename_pattern.hpp +4 -6
- package/src/duckdb/src/include/duckdb/common/fixed_size_map.hpp +13 -13
- package/src/duckdb/src/include/duckdb/common/helper.hpp +42 -47
- package/src/duckdb/src/include/duckdb/common/http_state.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/hugeint.hpp +2 -2
- package/src/duckdb/src/include/duckdb/common/index_vector.hpp +10 -10
- package/src/duckdb/src/include/duckdb/common/local_file_system.hpp +13 -10
- package/src/duckdb/src/include/duckdb/common/memory_safety.hpp +3 -3
- package/src/duckdb/src/include/duckdb/common/multi_file_reader_options.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/opener_file_system.hpp +50 -24
- package/src/duckdb/src/include/duckdb/common/operator/abs.hpp +12 -4
- package/src/duckdb/src/include/duckdb/common/optional_ptr.hpp +5 -5
- package/src/duckdb/src/include/duckdb/common/pipe_file_system.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/platform.h +1 -1
- package/src/duckdb/src/include/duckdb/common/printer.hpp +5 -5
- package/src/duckdb/src/include/duckdb/common/profiler.hpp +2 -2
- package/src/duckdb/src/include/duckdb/common/progress_bar/display/terminal_progress_bar_display.hpp +5 -5
- package/src/duckdb/src/include/duckdb/common/random_engine.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/re2_regex.hpp +7 -7
- package/src/duckdb/src/include/duckdb/common/serializer/buffered_file_reader.hpp +3 -0
- package/src/duckdb/src/include/duckdb/common/serializer/buffered_file_writer.hpp +2 -2
- package/src/duckdb/src/include/duckdb/common/serializer/deserialization_data.hpp +17 -6
- package/src/duckdb/src/include/duckdb/common/serializer/deserializer.hpp +12 -0
- package/src/duckdb/src/include/duckdb/common/serializer/serialization_traits.hpp +14 -0
- package/src/duckdb/src/include/duckdb/common/serializer/serializer.hpp +16 -0
- package/src/duckdb/src/include/duckdb/common/sort/duckdb_pdqsort.hpp +3 -0
- package/src/duckdb/src/include/duckdb/common/sort/partition_state.hpp +2 -0
- package/src/duckdb/src/include/duckdb/common/string_util.hpp +4 -4
- package/src/duckdb/src/include/duckdb/common/tree_renderer.hpp +24 -25
- package/src/duckdb/src/include/duckdb/common/typedefs.hpp +5 -5
- package/src/duckdb/src/include/duckdb/common/types/cast_helpers.hpp +1 -2
- package/src/duckdb/src/include/duckdb/common/types/column/column_data_collection.hpp +10 -10
- package/src/duckdb/src/include/duckdb/common/types/column/column_data_collection_iterators.hpp +5 -5
- package/src/duckdb/src/include/duckdb/common/types/column/partitioned_column_data.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/types/constraint_conflict_info.hpp +1 -2
- package/src/duckdb/src/include/duckdb/common/types/data_chunk.hpp +2 -2
- package/src/duckdb/src/include/duckdb/common/types/date.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/types/hash.hpp +5 -5
- package/src/duckdb/src/include/duckdb/common/types/hyperloglog.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/types/interval.hpp +4 -4
- package/src/duckdb/src/include/duckdb/common/types/row/partitioned_tuple_data.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/types/row/tuple_data_layout.hpp +10 -3
- package/src/duckdb/src/include/duckdb/common/types/row/tuple_data_segment.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/types/selection_vector.hpp +12 -12
- package/src/duckdb/src/include/duckdb/common/types/string_heap.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/types/string_type.hpp +21 -20
- package/src/duckdb/src/include/duckdb/common/types/time.hpp +2 -2
- package/src/duckdb/src/include/duckdb/common/types/timestamp.hpp +3 -3
- package/src/duckdb/src/include/duckdb/common/types/uuid.hpp +2 -2
- package/src/duckdb/src/include/duckdb/common/types/value.hpp +2 -2
- package/src/duckdb/src/include/duckdb/common/types/vector.hpp +15 -7
- package/src/duckdb/src/include/duckdb/common/types/vector_buffer.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/types.hpp +14 -10
- package/src/duckdb/src/include/duckdb/common/uhugeint.hpp +2 -2
- package/src/duckdb/src/include/duckdb/common/union_by_name.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/unique_ptr.hpp +15 -14
- package/src/duckdb/src/include/duckdb/common/vector.hpp +21 -21
- package/src/duckdb/src/include/duckdb/common/vector_operations/aggregate_executor.hpp +2 -0
- package/src/duckdb/src/include/duckdb/common/vector_operations/general_cast.hpp +2 -1
- package/src/duckdb/src/include/duckdb/common/vector_operations/generic_executor.hpp +2 -3
- package/src/duckdb/src/include/duckdb/common/vector_operations/unary_executor.hpp +3 -2
- package/src/duckdb/src/include/duckdb/common/vector_operations/vector_operations.hpp +50 -32
- package/src/duckdb/src/include/duckdb/common/virtual_file_system.hpp +10 -11
- package/src/duckdb/src/include/duckdb/core_functions/aggregate/distributive_functions.hpp +1 -1
- package/src/duckdb/src/include/duckdb/core_functions/aggregate/sum_helpers.hpp +13 -1
- package/src/duckdb/src/include/duckdb/core_functions/function_list.hpp +1 -1
- package/src/duckdb/src/include/duckdb/core_functions/lambda_functions.hpp +2 -1
- package/src/duckdb/src/include/duckdb/execution/aggregate_hashtable.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/column_binding_resolver.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/expression_executor.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/expression_executor_state.hpp +2 -5
- package/src/duckdb/src/include/duckdb/execution/merge_sort_tree.hpp +3 -3
- package/src/duckdb/src/include/duckdb/execution/operator/aggregate/aggregate_object.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/aggregate/distinct_aggregate_data.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/base_scanner.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/column_count_scanner.hpp +0 -3
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_buffer.hpp +9 -6
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_buffer_manager.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_error.hpp +40 -22
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_file_handle.hpp +5 -0
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_file_scanner.hpp +1 -0
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_option.hpp +6 -4
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_reader_options.hpp +24 -10
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_state_machine.hpp +4 -0
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/global_csv_state.hpp +3 -1
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/skip_scanner.hpp +0 -3
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/string_value_scanner.hpp +58 -17
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_batch_collector.hpp +1 -1
- 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_prepare.hpp +3 -3
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_set.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_vacuum.hpp +4 -1
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/csv_rejects_table.hpp +16 -5
- package/src/duckdb/src/include/duckdb/execution/physical_operator_states.hpp +6 -6
- package/src/duckdb/src/include/duckdb/execution/physical_plan_generator.hpp +2 -1
- package/src/duckdb/src/include/duckdb/execution/window_executor.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/window_segment_tree.hpp +1 -1
- package/src/duckdb/src/include/duckdb/function/aggregate_function.hpp +1 -1
- package/src/duckdb/src/include/duckdb/function/cast/cast_function_set.hpp +5 -5
- package/src/duckdb/src/include/duckdb/function/cast/default_casts.hpp +4 -4
- package/src/duckdb/src/include/duckdb/function/cast/vector_cast_helpers.hpp +6 -6
- package/src/duckdb/src/include/duckdb/function/compression_function.hpp +4 -4
- package/src/duckdb/src/include/duckdb/function/copy_function.hpp +10 -13
- package/src/duckdb/src/include/duckdb/function/function.hpp +3 -3
- package/src/duckdb/src/include/duckdb/function/function_binder.hpp +24 -23
- package/src/duckdb/src/include/duckdb/function/function_serialization.hpp +1 -1
- package/src/duckdb/src/include/duckdb/function/function_set.hpp +1 -1
- package/src/duckdb/src/include/duckdb/function/pragma_function.hpp +1 -1
- package/src/duckdb/src/include/duckdb/function/scalar/regexp.hpp +3 -3
- package/src/duckdb/src/include/duckdb/function/scalar/strftime_format.hpp +7 -7
- package/src/duckdb/src/include/duckdb/function/scalar/string_functions.hpp +3 -3
- package/src/duckdb/src/include/duckdb/function/scalar_function.hpp +6 -6
- package/src/duckdb/src/include/duckdb/function/table/arrow/arrow_duck_schema.hpp +4 -4
- package/src/duckdb/src/include/duckdb/function/table/arrow.hpp +2 -2
- package/src/duckdb/src/include/duckdb/function/table/read_csv.hpp +1 -3
- package/src/duckdb/src/include/duckdb/function/table/table_scan.hpp +1 -1
- package/src/duckdb/src/include/duckdb/function/table_function.hpp +12 -11
- package/src/duckdb/src/include/duckdb/function/udf_function.hpp +66 -60
- package/src/duckdb/src/include/duckdb/main/appender.hpp +6 -6
- package/src/duckdb/src/include/duckdb/main/attached_database.hpp +3 -1
- package/src/duckdb/src/include/duckdb/main/buffered_data/buffered_data.hpp +2 -2
- package/src/duckdb/src/include/duckdb/main/buffered_data/simple_buffered_data.hpp +1 -1
- package/src/duckdb/src/include/duckdb/main/capi/capi_internal.hpp +2 -2
- package/src/duckdb/src/include/duckdb/main/chunk_scan_state/query_result.hpp +2 -2
- package/src/duckdb/src/include/duckdb/main/client_context.hpp +1 -1
- package/src/duckdb/src/include/duckdb/main/client_context_file_opener.hpp +3 -2
- package/src/duckdb/src/include/duckdb/main/client_data.hpp +1 -0
- package/src/duckdb/src/include/duckdb/main/client_properties.hpp +2 -1
- package/src/duckdb/src/include/duckdb/main/config.hpp +14 -5
- package/src/duckdb/src/include/duckdb/main/connection.hpp +27 -26
- package/src/duckdb/src/include/duckdb/main/database.hpp +19 -3
- package/src/duckdb/src/include/duckdb/main/database_file_opener.hpp +58 -0
- package/src/duckdb/src/include/duckdb/main/database_path_and_type.hpp +2 -2
- package/src/duckdb/src/include/duckdb/main/error_manager.hpp +6 -6
- package/src/duckdb/src/include/duckdb/main/extension_entries.hpp +8 -0
- package/src/duckdb/src/include/duckdb/main/extension_helper.hpp +1 -0
- package/src/duckdb/src/include/duckdb/main/external_dependencies.hpp +2 -1
- package/src/duckdb/src/include/duckdb/main/prepared_statement.hpp +8 -8
- package/src/duckdb/src/include/duckdb/main/query_profiler.hpp +2 -59
- package/src/duckdb/src/include/duckdb/main/query_result.hpp +3 -3
- package/src/duckdb/src/include/duckdb/main/relation/query_relation.hpp +1 -1
- package/src/duckdb/src/include/duckdb/main/relation.hpp +1 -1
- package/src/duckdb/src/include/duckdb/main/secret/secret.hpp +11 -7
- package/src/duckdb/src/include/duckdb/main/secret/secret_manager.hpp +2 -2
- package/src/duckdb/src/include/duckdb/main/secret/secret_storage.hpp +4 -4
- package/src/duckdb/src/include/duckdb/main/settings.hpp +78 -70
- package/src/duckdb/src/include/duckdb/optimizer/column_lifetime_analyzer.hpp +45 -0
- package/src/duckdb/src/include/duckdb/optimizer/compressed_materialization.hpp +11 -13
- package/src/duckdb/src/include/duckdb/optimizer/join_order/cardinality_estimator.hpp +2 -2
- package/src/duckdb/src/include/duckdb/optimizer/join_order/cost_model.hpp +1 -1
- package/src/duckdb/src/include/duckdb/optimizer/join_order/join_node.hpp +1 -1
- package/src/duckdb/src/include/duckdb/optimizer/join_order/query_graph.hpp +1 -1
- package/src/duckdb/src/include/duckdb/optimizer/join_order/query_graph_manager.hpp +1 -1
- package/src/duckdb/src/include/duckdb/optimizer/join_order/relation_manager.hpp +1 -1
- package/src/duckdb/src/include/duckdb/optimizer/matcher/expression_matcher.hpp +7 -7
- package/src/duckdb/src/include/duckdb/optimizer/matcher/function_matcher.hpp +7 -7
- package/src/duckdb/src/include/duckdb/optimizer/matcher/type_matcher.hpp +1 -1
- package/src/duckdb/src/include/duckdb/optimizer/optimizer.hpp +3 -0
- package/src/duckdb/src/include/duckdb/optimizer/statistics_propagator.hpp +32 -30
- package/src/duckdb/src/include/duckdb/optimizer/unnest_rewriter.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parallel/event.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parallel/executor_task.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parallel/interrupt.hpp +2 -2
- package/src/duckdb/src/include/duckdb/parallel/pipeline_event.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/column_list.hpp +4 -4
- package/src/duckdb/src/include/duckdb/parser/constraints/unique_constraint.hpp +49 -8
- package/src/duckdb/src/include/duckdb/parser/expression/bound_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/parsed_data/alter_scalar_function_info.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/alter_table_function_info.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/alter_table_info.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/copy_database_info.hpp +40 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_function_info.hpp +2 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_index_info.hpp +1 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_info.hpp +2 -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_pragma_function_info.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_secret_info.hpp +2 -2
- package/src/duckdb/src/include/duckdb/parser/parsed_data/extra_drop_info.hpp +3 -3
- package/src/duckdb/src/include/duckdb/parser/parsed_data/parse_info.hpp +3 -2
- package/src/duckdb/src/include/duckdb/parser/parsed_data/vacuum_info.hpp +2 -5
- package/src/duckdb/src/include/duckdb/parser/parser.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/parser_extension.hpp +3 -3
- package/src/duckdb/src/include/duckdb/parser/query_error_context.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/transformer.hpp +3 -5
- package/src/duckdb/src/include/duckdb/planner/bind_context.hpp +2 -2
- package/src/duckdb/src/include/duckdb/planner/binder.hpp +16 -9
- package/src/duckdb/src/include/duckdb/planner/expression/bound_case_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression/bound_cast_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression/bound_default_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression/bound_expanded_expression.hpp +34 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_subquery_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/expression_binder/base_select_binder.hpp +5 -8
- package/src/duckdb/src/include/duckdb/planner/expression_binder/column_alias_binder.hpp +3 -4
- package/src/duckdb/src/include/duckdb/planner/expression_binder/group_binder.hpp +3 -2
- package/src/duckdb/src/include/duckdb/planner/expression_binder/having_binder.hpp +3 -5
- package/src/duckdb/src/include/duckdb/planner/expression_binder/order_binder.hpp +6 -14
- package/src/duckdb/src/include/duckdb/planner/expression_binder/qualify_binder.hpp +3 -6
- package/src/duckdb/src/include/duckdb/planner/expression_binder/select_bind_state.hpp +52 -0
- package/src/duckdb/src/include/duckdb/planner/expression_binder/select_binder.hpp +4 -10
- package/src/duckdb/src/include/duckdb/planner/expression_binder/table_function_binder.hpp +5 -2
- package/src/duckdb/src/include/duckdb/planner/expression_binder.hpp +1 -0
- package/src/duckdb/src/include/duckdb/planner/expression_iterator.hpp +2 -0
- package/src/duckdb/src/include/duckdb/planner/filter/conjunction_filter.hpp +3 -6
- package/src/duckdb/src/include/duckdb/planner/logical_operator.hpp +2 -0
- package/src/duckdb/src/include/duckdb/planner/logical_tokens.hpp +1 -0
- package/src/duckdb/src/include/duckdb/planner/operator/list.hpp +1 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_copy_database.hpp +4 -12
- package/src/duckdb/src/include/duckdb/planner/operator/logical_create_secret.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/operator/logical_cteref.hpp +2 -2
- package/src/duckdb/src/include/duckdb/planner/operator/logical_delim_get.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/operator/logical_dummy_scan.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 +2 -2
- package/src/duckdb/src/include/duckdb/planner/operator/logical_extension_operator.hpp +2 -2
- package/src/duckdb/src/include/duckdb/planner/operator/logical_materialized_cte.hpp +2 -2
- package/src/duckdb/src/include/duckdb/planner/operator/logical_pragma.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/operator/logical_prepare.hpp +3 -2
- package/src/duckdb/src/include/duckdb/planner/operator/logical_recursive_cte.hpp +3 -3
- package/src/duckdb/src/include/duckdb/planner/operator/logical_reset.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/operator/logical_set.hpp +2 -1
- package/src/duckdb/src/include/duckdb/planner/operator/logical_vacuum.hpp +52 -0
- package/src/duckdb/src/include/duckdb/planner/operator_extension.hpp +1 -1
- package/src/duckdb/src/include/duckdb/planner/parsed_data/bound_create_table_info.hpp +2 -2
- package/src/duckdb/src/include/duckdb/planner/query_node/bound_select_node.hpp +5 -4
- package/src/duckdb/src/include/duckdb/planner/subquery/flatten_dependent_join.hpp +2 -2
- package/src/duckdb/src/include/duckdb/storage/arena_allocator.hpp +4 -1
- package/src/duckdb/src/include/duckdb/storage/buffer/block_handle.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/buffer_manager.hpp +3 -3
- package/src/duckdb/src/include/duckdb/storage/checkpoint/row_group_writer.hpp +2 -3
- package/src/duckdb/src/include/duckdb/storage/checkpoint/string_checkpoint_state.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/checkpoint/table_data_writer.hpp +3 -3
- package/src/duckdb/src/include/duckdb/storage/checkpoint_manager.hpp +5 -5
- package/src/duckdb/src/include/duckdb/storage/compression/alp/alp_analyze.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/compression/alp/alp_compress.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/compression/alp/alp_fetch.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/compression/alp/alp_scan.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/compression/alprd/algorithm/alprd.hpp +3 -3
- package/src/duckdb/src/include/duckdb/storage/compression/alprd/alprd_analyze.hpp +2 -2
- package/src/duckdb/src/include/duckdb/storage/compression/alprd/alprd_compress.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/compression/alprd/alprd_fetch.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/compression/alprd/alprd_scan.hpp +3 -3
- package/src/duckdb/src/include/duckdb/storage/compression/chimp/algorithm/flag_buffer.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/compression/chimp/algorithm/leading_zero_buffer.hpp +3 -3
- package/src/duckdb/src/include/duckdb/storage/compression/chimp/chimp.hpp +3 -3
- package/src/duckdb/src/include/duckdb/storage/compression/chimp/chimp_analyze.hpp +0 -1
- package/src/duckdb/src/include/duckdb/storage/compression/chimp/chimp_fetch.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/compression/chimp/chimp_scan.hpp +4 -4
- package/src/duckdb/src/include/duckdb/storage/compression/patas/patas.hpp +4 -4
- package/src/duckdb/src/include/duckdb/storage/compression/patas/patas_analyze.hpp +0 -1
- package/src/duckdb/src/include/duckdb/storage/compression/patas/patas_fetch.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/compression/patas/patas_scan.hpp +3 -3
- package/src/duckdb/src/include/duckdb/storage/data_pointer.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/index.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/magic_bytes.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/object_cache.hpp +3 -3
- package/src/duckdb/src/include/duckdb/storage/optimistic_data_writer.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/partial_block_manager.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/single_file_block_manager.hpp +4 -1
- package/src/duckdb/src/include/duckdb/storage/standard_buffer_manager.hpp +24 -24
- package/src/duckdb/src/include/duckdb/storage/statistics/numeric_stats_union.hpp +3 -3
- package/src/duckdb/src/include/duckdb/storage/statistics/segment_statistics.hpp +2 -2
- package/src/duckdb/src/include/duckdb/storage/storage_info.hpp +2 -2
- package/src/duckdb/src/include/duckdb/storage/storage_manager.hpp +4 -4
- package/src/duckdb/src/include/duckdb/storage/string_uncompressed.hpp +9 -6
- package/src/duckdb/src/include/duckdb/storage/table/append_state.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/table/chunk_info.hpp +2 -2
- package/src/duckdb/src/include/duckdb/storage/table/column_checkpoint_state.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/table/column_data.hpp +10 -1
- package/src/duckdb/src/include/duckdb/storage/table/data_table_info.hpp +3 -2
- package/src/duckdb/src/include/duckdb/storage/table/row_group.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/table/row_group_segment_tree.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/table/row_version_manager.hpp +2 -1
- package/src/duckdb/src/include/duckdb/storage/table/scan_state.hpp +3 -3
- package/src/duckdb/src/include/duckdb/storage/table/segment_lock.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/table/segment_tree.hpp +4 -4
- package/src/duckdb/src/include/duckdb/storage/table/standard_column_data.hpp +2 -0
- package/src/duckdb/src/include/duckdb/storage/table/table_index_list.hpp +3 -2
- package/src/duckdb/src/include/duckdb/storage/table/table_statistics.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/table/update_segment.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/table_storage_info.hpp +2 -1
- package/src/duckdb/src/include/duckdb/storage/write_ahead_log.hpp +1 -1
- package/src/duckdb/src/include/duckdb/transaction/delete_info.hpp +20 -1
- package/src/duckdb/src/include/duckdb/transaction/transaction.hpp +1 -1
- package/src/duckdb/src/include/duckdb/transaction/transaction_data.hpp +1 -1
- package/src/duckdb/src/include/duckdb/transaction/undo_buffer.hpp +1 -1
- package/src/duckdb/src/include/duckdb/transaction/update_info.hpp +1 -1
- package/src/duckdb/src/main/appender.cpp +1 -1
- package/src/duckdb/src/main/attached_database.cpp +11 -3
- package/src/duckdb/src/main/capi/arrow-c.cpp +6 -2
- package/src/duckdb/src/main/capi/cast/utils-c.cpp +1 -1
- package/src/duckdb/src/main/capi/duckdb-c.cpp +1 -1
- 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/result-c.cpp +4 -4
- package/src/duckdb/src/main/client_context.cpp +4 -12
- package/src/duckdb/src/main/client_context_file_opener.cpp +15 -3
- package/src/duckdb/src/main/client_data.cpp +5 -0
- package/src/duckdb/src/main/config.cpp +82 -82
- package/src/duckdb/src/main/database.cpp +31 -7
- package/src/duckdb/src/main/database_manager.cpp +3 -2
- package/src/duckdb/src/main/database_path_and_type.cpp +4 -4
- package/src/duckdb/src/main/error_manager.cpp +1 -1
- package/src/duckdb/src/main/extension/extension_alias.cpp +9 -9
- package/src/duckdb/src/main/extension/extension_helper.cpp +10 -5
- package/src/duckdb/src/main/extension/extension_install.cpp +1 -1
- package/src/duckdb/src/main/extension/extension_load.cpp +111 -37
- package/src/duckdb/src/main/query_profiler.cpp +1 -118
- package/src/duckdb/src/main/secret/secret_manager.cpp +1 -2
- package/src/duckdb/src/main/secret/secret_storage.cpp +1 -1
- package/src/duckdb/src/main/settings/settings.cpp +81 -65
- package/src/duckdb/src/optimizer/column_lifetime_analyzer.cpp +8 -1
- package/src/duckdb/src/optimizer/compressed_materialization/compress_aggregate.cpp +3 -0
- package/src/duckdb/src/optimizer/compressed_materialization.cpp +26 -28
- package/src/duckdb/src/optimizer/cse_optimizer.cpp +5 -5
- package/src/duckdb/src/optimizer/join_order/cardinality_estimator.cpp +10 -6
- package/src/duckdb/src/optimizer/optimizer.cpp +14 -17
- package/src/duckdb/src/optimizer/pushdown/pushdown_cross_product.cpp +16 -5
- package/src/duckdb/src/optimizer/pushdown/pushdown_inner_join.cpp +7 -4
- package/src/duckdb/src/optimizer/pushdown/pushdown_set_operation.cpp +2 -2
- package/src/duckdb/src/optimizer/remove_unused_columns.cpp +3 -3
- package/src/duckdb/src/optimizer/rule/ordered_aggregate_optimizer.cpp +2 -2
- package/src/duckdb/src/optimizer/statistics/expression/propagate_aggregate.cpp +1 -1
- package/src/duckdb/src/optimizer/statistics/expression/propagate_between.cpp +8 -8
- package/src/duckdb/src/optimizer/statistics/expression/propagate_case.cpp +1 -1
- package/src/duckdb/src/optimizer/statistics/expression/propagate_cast.cpp +1 -1
- package/src/duckdb/src/optimizer/statistics/expression/propagate_columnref.cpp +1 -1
- package/src/duckdb/src/optimizer/statistics/expression/propagate_comparison.cpp +7 -7
- package/src/duckdb/src/optimizer/statistics/expression/propagate_conjunction.cpp +6 -6
- package/src/duckdb/src/optimizer/statistics/expression/propagate_constant.cpp +1 -1
- package/src/duckdb/src/optimizer/statistics/expression/propagate_function.cpp +2 -2
- package/src/duckdb/src/optimizer/statistics/expression/propagate_operator.cpp +10 -10
- package/src/duckdb/src/optimizer/statistics/operator/propagate_aggregate.cpp +1 -1
- package/src/duckdb/src/optimizer/statistics/operator/propagate_cross_product.cpp +1 -1
- package/src/duckdb/src/optimizer/statistics/operator/propagate_filter.cpp +14 -7
- package/src/duckdb/src/optimizer/statistics/operator/propagate_get.cpp +2 -2
- package/src/duckdb/src/optimizer/statistics/operator/propagate_join.cpp +9 -9
- package/src/duckdb/src/optimizer/statistics/operator/propagate_limit.cpp +1 -1
- package/src/duckdb/src/optimizer/statistics/operator/propagate_order.cpp +1 -1
- package/src/duckdb/src/optimizer/statistics/operator/propagate_projection.cpp +2 -2
- 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 +39 -18
- package/src/duckdb/src/parallel/pipeline_finish_event.cpp +1 -1
- package/src/duckdb/src/parallel/task_scheduler.cpp +8 -1
- package/src/duckdb/src/parser/constraints/unique_constraint.cpp +4 -2
- package/src/duckdb/src/parser/parsed_data/create_index_info.cpp +64 -0
- package/src/duckdb/src/parser/parsed_data/vacuum_info.cpp +1 -0
- package/src/duckdb/src/parser/transform/expression/transform_function.cpp +13 -5
- package/src/duckdb/src/parser/transform/expression/transform_subquery.cpp +24 -0
- package/src/duckdb/src/parser/transform/helpers/transform_cte.cpp +1 -8
- package/src/duckdb/src/parser/transform/statement/transform_create_function.cpp +2 -1
- package/src/duckdb/src/parser/transform/statement/transform_create_index.cpp +3 -0
- package/src/duckdb/src/parser/transform/statement/transform_delete.cpp +2 -6
- package/src/duckdb/src/parser/transform/statement/transform_insert.cpp +2 -6
- package/src/duckdb/src/parser/transform/statement/transform_pivot_stmt.cpp +2 -6
- package/src/duckdb/src/parser/transform/statement/transform_pragma.cpp +1 -1
- package/src/duckdb/src/parser/transform/statement/transform_select.cpp +5 -2
- package/src/duckdb/src/parser/transform/statement/transform_select_node.cpp +2 -8
- package/src/duckdb/src/parser/transform/statement/transform_update.cpp +1 -6
- package/src/duckdb/src/parser/transform/statement/transform_use.cpp +3 -2
- package/src/duckdb/src/parser/transformer.cpp +14 -2
- package/src/duckdb/src/planner/binder/expression/bind_aggregate_expression.cpp +40 -17
- package/src/duckdb/src/planner/binder/expression/bind_unnest_expression.cpp +8 -3
- package/src/duckdb/src/planner/binder/expression/bind_window_expression.cpp +32 -30
- package/src/duckdb/src/planner/binder/query_node/bind_cte_node.cpp +28 -17
- package/src/duckdb/src/planner/binder/query_node/bind_select_node.cpp +146 -101
- package/src/duckdb/src/planner/binder/query_node/bind_setop_node.cpp +28 -26
- package/src/duckdb/src/planner/binder/query_node/plan_cte_node.cpp +29 -0
- package/src/duckdb/src/planner/binder/query_node/plan_subquery.cpp +10 -10
- package/src/duckdb/src/planner/binder/statement/bind_copy.cpp +3 -2
- package/src/duckdb/src/planner/binder/statement/bind_copy_database.cpp +23 -28
- package/src/duckdb/src/planner/binder/statement/bind_create.cpp +11 -12
- package/src/duckdb/src/planner/binder/statement/bind_create_table.cpp +9 -11
- package/src/duckdb/src/planner/binder/statement/bind_insert.cpp +10 -13
- package/src/duckdb/src/planner/binder/statement/bind_pragma.cpp +3 -3
- package/src/duckdb/src/planner/binder/statement/bind_set.cpp +3 -0
- package/src/duckdb/src/planner/binder/statement/bind_vacuum.cpp +66 -65
- package/src/duckdb/src/planner/binder/tableref/bind_basetableref.cpp +54 -46
- package/src/duckdb/src/planner/binder/tableref/bind_pivot.cpp +3 -0
- package/src/duckdb/src/planner/binder/tableref/bind_subqueryref.cpp +1 -1
- package/src/duckdb/src/planner/binder/tableref/bind_table_function.cpp +5 -5
- package/src/duckdb/src/planner/binder.cpp +78 -6
- package/src/duckdb/src/planner/expression/bound_cast_expression.cpp +11 -3
- package/src/duckdb/src/planner/expression/bound_expanded_expression.cpp +22 -0
- package/src/duckdb/src/planner/expression_binder/base_select_binder.cpp +11 -58
- package/src/duckdb/src/planner/expression_binder/column_alias_binder.cpp +5 -8
- package/src/duckdb/src/planner/expression_binder/group_binder.cpp +5 -4
- package/src/duckdb/src/planner/expression_binder/having_binder.cpp +5 -19
- package/src/duckdb/src/planner/expression_binder/lateral_binder.cpp +8 -8
- package/src/duckdb/src/planner/expression_binder/order_binder.cpp +42 -26
- package/src/duckdb/src/planner/expression_binder/qualify_binder.cpp +3 -22
- package/src/duckdb/src/planner/expression_binder/select_bind_state.cpp +52 -0
- package/src/duckdb/src/planner/expression_binder/select_binder.cpp +43 -5
- package/src/duckdb/src/planner/expression_binder/table_function_binder.cpp +19 -7
- package/src/duckdb/src/planner/logical_operator.cpp +20 -3
- package/src/duckdb/src/planner/operator/logical_copy_database.cpp +4 -14
- package/src/duckdb/src/planner/operator/logical_delete.cpp +1 -1
- package/src/duckdb/src/planner/operator/logical_get.cpp +1 -1
- package/src/duckdb/src/planner/operator/logical_insert.cpp +1 -1
- package/src/duckdb/src/planner/operator/logical_update.cpp +1 -1
- package/src/duckdb/src/planner/operator/logical_vacuum.cpp +65 -0
- package/src/duckdb/src/planner/planner.cpp +4 -4
- package/src/duckdb/src/planner/subquery/flatten_dependent_join.cpp +26 -27
- package/src/duckdb/src/storage/arena_allocator.cpp +9 -0
- package/src/duckdb/src/storage/buffer/buffer_pool_reservation.cpp +1 -1
- package/src/duckdb/src/storage/buffer_manager.cpp +2 -10
- package/src/duckdb/src/storage/checkpoint/table_data_writer.cpp +2 -3
- package/src/duckdb/src/storage/checkpoint_manager.cpp +15 -8
- package/src/duckdb/src/storage/compression/bitpacking.cpp +6 -1
- package/src/duckdb/src/storage/compression/string_uncompressed.cpp +1 -1
- package/src/duckdb/src/storage/data_pointer.cpp +1 -1
- package/src/duckdb/src/storage/data_table.cpp +18 -7
- package/src/duckdb/src/storage/local_storage.cpp +8 -5
- package/src/duckdb/src/storage/magic_bytes.cpp +6 -5
- package/src/duckdb/src/storage/partial_block_manager.cpp +1 -1
- package/src/duckdb/src/storage/serialization/serialize_logical_operator.cpp +20 -9
- package/src/duckdb/src/storage/serialization/serialize_nodes.cpp +12 -10
- package/src/duckdb/src/storage/serialization/serialize_parse_info.cpp +23 -0
- package/src/duckdb/src/storage/single_file_block_manager.cpp +46 -19
- package/src/duckdb/src/storage/standard_buffer_manager.cpp +21 -5
- package/src/duckdb/src/storage/statistics/array_stats.cpp +1 -1
- package/src/duckdb/src/storage/statistics/base_statistics.cpp +2 -3
- package/src/duckdb/src/storage/statistics/list_stats.cpp +1 -1
- package/src/duckdb/src/storage/statistics/struct_stats.cpp +1 -1
- package/src/duckdb/src/storage/storage_info.cpp +19 -19
- package/src/duckdb/src/storage/storage_manager.cpp +18 -13
- package/src/duckdb/src/storage/table/chunk_info.cpp +11 -3
- package/src/duckdb/src/storage/table/column_data.cpp +88 -66
- package/src/duckdb/src/storage/table/row_group.cpp +7 -7
- package/src/duckdb/src/storage/table/row_version_manager.cpp +2 -2
- package/src/duckdb/src/storage/table/standard_column_data.cpp +4 -0
- package/src/duckdb/src/storage/table/update_segment.cpp +3 -1
- package/src/duckdb/src/storage/table_index_list.cpp +6 -1
- package/src/duckdb/src/storage/temporary_file_manager.cpp +1 -1
- package/src/duckdb/src/storage/wal_replay.cpp +8 -7
- package/src/duckdb/src/storage/write_ahead_log.cpp +3 -4
- package/src/duckdb/src/transaction/cleanup_state.cpp +10 -3
- package/src/duckdb/src/transaction/commit_state.cpp +11 -4
- package/src/duckdb/src/transaction/duck_transaction.cpp +23 -3
- package/src/duckdb/src/transaction/rollback_state.cpp +1 -1
- package/src/duckdb/src/transaction/transaction_context.cpp +1 -1
- package/src/duckdb/src/transaction/undo_buffer.cpp +3 -1
- package/src/duckdb/third_party/fmt/include/fmt/core.h +0 -5
- package/src/duckdb/third_party/fsst/fsst.h +1 -1
- package/src/duckdb/third_party/fsst/libfsst.cpp +1 -140
- package/src/duckdb/third_party/fsst/libfsst.hpp +0 -13
- package/src/duckdb/third_party/hyperloglog/hyperloglog.hpp +4 -0
- package/src/duckdb/third_party/libpg_query/include/nodes/parsenodes.hpp +8 -1
- package/src/duckdb/third_party/libpg_query/include/parser/gram.hpp +2 -1
- package/src/duckdb/third_party/libpg_query/src_backend_parser_gram.cpp +15401 -15354
- package/src/duckdb/third_party/libpg_query/src_backend_parser_scan.cpp +299 -538
- package/src/duckdb/third_party/lz4/lz4.cpp +2605 -0
- package/src/duckdb/third_party/lz4/lz4.hpp +843 -0
- package/src/duckdb/third_party/parquet/parquet_types.cpp +3 -0
- package/src/duckdb/third_party/parquet/parquet_types.h +2 -1
- package/src/duckdb/third_party/re2/re2/bitmap256.cc +44 -0
- package/src/duckdb/third_party/re2/re2/bitmap256.h +3 -35
- package/src/duckdb/third_party/re2/re2/bitstate.cc +31 -24
- package/src/duckdb/third_party/re2/re2/compile.cc +146 -164
- package/src/duckdb/third_party/re2/re2/dfa.cc +174 -181
- package/src/duckdb/third_party/re2/re2/filtered_re2.cc +19 -3
- package/src/duckdb/third_party/re2/re2/filtered_re2.h +27 -23
- package/src/duckdb/third_party/re2/re2/mimics_pcre.cc +21 -11
- package/src/duckdb/third_party/re2/re2/nfa.cc +91 -131
- package/src/duckdb/third_party/re2/re2/onepass.cc +11 -10
- package/src/duckdb/third_party/re2/re2/parse.cc +171 -154
- package/src/duckdb/third_party/re2/re2/perl_groups.cc +35 -35
- package/src/duckdb/third_party/re2/re2/pod_array.h +55 -0
- package/src/duckdb/third_party/re2/re2/prefilter.cc +40 -40
- package/src/duckdb/third_party/re2/re2/prefilter.h +24 -2
- package/src/duckdb/third_party/re2/re2/prefilter_tree.cc +70 -84
- package/src/duckdb/third_party/re2/re2/prefilter_tree.h +5 -4
- package/src/duckdb/third_party/re2/re2/prog.cc +315 -58
- package/src/duckdb/third_party/re2/re2/prog.h +77 -44
- package/src/duckdb/third_party/re2/re2/re2.cc +333 -221
- package/src/duckdb/third_party/re2/re2/re2.h +277 -201
- package/src/duckdb/third_party/re2/re2/regexp.cc +137 -105
- package/src/duckdb/third_party/re2/re2/regexp.h +45 -40
- package/src/duckdb/third_party/re2/re2/set.cc +40 -17
- package/src/duckdb/third_party/re2/re2/set.h +11 -6
- package/src/duckdb/third_party/re2/re2/simplify.cc +50 -41
- package/src/duckdb/third_party/re2/re2/sparse_array.h +392 -0
- package/src/duckdb/third_party/re2/re2/sparse_set.h +264 -0
- package/src/duckdb/third_party/re2/re2/stringpiece.cc +1 -1
- package/src/duckdb/third_party/re2/re2/stringpiece.h +11 -8
- package/src/duckdb/third_party/re2/re2/tostring.cc +8 -6
- package/src/duckdb/third_party/re2/re2/unicode_casefold.cc +39 -10
- package/src/duckdb/third_party/re2/re2/unicode_casefold.h +1 -1
- package/src/duckdb/third_party/re2/re2/unicode_groups.cc +5019 -4566
- package/src/duckdb/third_party/re2/re2/unicode_groups.h +1 -1
- package/src/duckdb/third_party/re2/re2/walker-inl.h +21 -20
- package/src/duckdb/third_party/re2/util/logging.h +14 -18
- package/src/duckdb/third_party/re2/util/mix.h +4 -4
- package/src/duckdb/third_party/re2/util/mutex.h +48 -15
- package/src/duckdb/third_party/re2/util/rune.cc +5 -5
- package/src/duckdb/third_party/re2/util/strutil.cc +1 -16
- package/src/duckdb/third_party/re2/util/strutil.h +1 -3
- package/src/duckdb/third_party/re2/util/utf.h +1 -1
- package/src/duckdb/third_party/re2/util/util.h +9 -1
- package/src/duckdb/third_party/utf8proc/include/utf8proc_wrapper.hpp +2 -0
- package/src/duckdb/third_party/utf8proc/utf8proc_wrapper.cpp +36 -1
- package/src/duckdb/ub_src_common.cpp +0 -2
- package/src/duckdb/ub_src_execution_physical_plan.cpp +2 -0
- package/src/duckdb/ub_src_planner_expression.cpp +2 -0
- package/src/duckdb/ub_src_planner_expression_binder.cpp +2 -0
- package/src/duckdb/ub_src_planner_operator.cpp +2 -0
@@ -121,11 +121,12 @@ BoundStatement Binder::BindCopyTo(CopyStatement &stmt) {
|
|
121
121
|
if (file_size_bytes.IsValid() && !partition_cols.empty()) {
|
122
122
|
throw NotImplementedException("Can't combine FILE_SIZE_BYTES and PARTITION_BY for COPY");
|
123
123
|
}
|
124
|
-
bool is_remote_file =
|
124
|
+
bool is_remote_file = FileSystem::IsRemoteFile(stmt.info->file_path);
|
125
125
|
if (is_remote_file) {
|
126
126
|
use_tmp_file = false;
|
127
127
|
} else {
|
128
|
-
|
128
|
+
auto &fs = FileSystem::GetFileSystem(context);
|
129
|
+
bool is_file_and_exists = fs.FileExists(stmt.info->file_path);
|
129
130
|
bool is_stdout = stmt.info->file_path == "/dev/stdout";
|
130
131
|
if (!user_set_use_tmp_file) {
|
131
132
|
use_tmp_file = is_file_and_exists && !per_thread_output && partition_cols.empty() && !is_stdout;
|
@@ -1,12 +1,8 @@
|
|
1
1
|
#include "duckdb/catalog/catalog.hpp"
|
2
2
|
#include "duckdb/parser/statement/copy_database_statement.hpp"
|
3
3
|
#include "duckdb/catalog/catalog_entry/list.hpp"
|
4
|
-
#include "duckdb/parser/parsed_data/create_macro_info.hpp"
|
5
4
|
#include "duckdb/parser/parsed_data/create_schema_info.hpp"
|
6
|
-
#include "duckdb/parser/parsed_data/create_sequence_info.hpp"
|
7
5
|
#include "duckdb/parser/parsed_data/create_table_info.hpp"
|
8
|
-
#include "duckdb/parser/parsed_data/create_type_info.hpp"
|
9
|
-
#include "duckdb/parser/parsed_data/create_view_info.hpp"
|
10
6
|
#include "duckdb/planner/operator/logical_copy_database.hpp"
|
11
7
|
#include "duckdb/execution/operator/persistent/physical_export.hpp"
|
12
8
|
#include "duckdb/planner/operator/logical_create_table.hpp"
|
@@ -22,23 +18,23 @@
|
|
22
18
|
|
23
19
|
namespace duckdb {
|
24
20
|
|
25
|
-
unique_ptr<LogicalOperator> Binder::BindCopyDatabaseSchema(
|
26
|
-
|
27
|
-
auto
|
21
|
+
unique_ptr<LogicalOperator> Binder::BindCopyDatabaseSchema(Catalog &source_catalog,
|
22
|
+
const string &target_database_name) {
|
23
|
+
auto source_schemas = source_catalog.GetSchemas(context);
|
28
24
|
|
29
25
|
ExportEntries entries;
|
30
|
-
PhysicalExport::ExtractEntries(context,
|
26
|
+
PhysicalExport::ExtractEntries(context, source_schemas, entries);
|
31
27
|
|
32
|
-
auto info = make_uniq<CopyDatabaseInfo>(
|
28
|
+
auto info = make_uniq<CopyDatabaseInfo>(target_database_name);
|
33
29
|
|
34
30
|
// get a list of all schemas to copy over
|
35
|
-
for (auto &schema_ref :
|
31
|
+
for (auto &schema_ref : source_schemas) {
|
36
32
|
auto &schema = schema_ref.get().Cast<SchemaCatalogEntry>();
|
37
33
|
if (schema.internal) {
|
38
34
|
continue;
|
39
35
|
}
|
40
36
|
auto create_info = schema.GetInfo();
|
41
|
-
create_info->catalog =
|
37
|
+
create_info->catalog = target_database_name;
|
42
38
|
create_info->on_conflict = OnCreateConflict::IGNORE_ON_CONFLICT;
|
43
39
|
info->entries.push_back(std::move(create_info));
|
44
40
|
}
|
@@ -49,7 +45,7 @@ unique_ptr<LogicalOperator> Binder::BindCopyDatabaseSchema(CopyDatabaseStatement
|
|
49
45
|
continue;
|
50
46
|
}
|
51
47
|
auto create_info = seq_entry.GetInfo();
|
52
|
-
create_info->catalog =
|
48
|
+
create_info->catalog = target_database_name;
|
53
49
|
create_info->on_conflict = OnCreateConflict::ERROR_ON_CONFLICT;
|
54
50
|
info->entries.push_back(std::move(create_info));
|
55
51
|
}
|
@@ -60,7 +56,7 @@ unique_ptr<LogicalOperator> Binder::BindCopyDatabaseSchema(CopyDatabaseStatement
|
|
60
56
|
continue;
|
61
57
|
}
|
62
58
|
auto create_info = type_entry.GetInfo();
|
63
|
-
create_info->catalog =
|
59
|
+
create_info->catalog = target_database_name;
|
64
60
|
create_info->on_conflict = OnCreateConflict::ERROR_ON_CONFLICT;
|
65
61
|
info->entries.push_back(std::move(create_info));
|
66
62
|
}
|
@@ -71,7 +67,7 @@ unique_ptr<LogicalOperator> Binder::BindCopyDatabaseSchema(CopyDatabaseStatement
|
|
71
67
|
continue;
|
72
68
|
}
|
73
69
|
auto create_info = table.GetInfo();
|
74
|
-
create_info->catalog =
|
70
|
+
create_info->catalog = target_database_name;
|
75
71
|
create_info->on_conflict = OnCreateConflict::ERROR_ON_CONFLICT;
|
76
72
|
info->entries.push_back(std::move(create_info));
|
77
73
|
}
|
@@ -81,7 +77,7 @@ unique_ptr<LogicalOperator> Binder::BindCopyDatabaseSchema(CopyDatabaseStatement
|
|
81
77
|
continue;
|
82
78
|
}
|
83
79
|
auto create_info = macro.GetInfo();
|
84
|
-
create_info->catalog =
|
80
|
+
create_info->catalog = target_database_name;
|
85
81
|
create_info->on_conflict = OnCreateConflict::ERROR_ON_CONFLICT;
|
86
82
|
info->entries.push_back(std::move(create_info));
|
87
83
|
}
|
@@ -92,7 +88,7 @@ unique_ptr<LogicalOperator> Binder::BindCopyDatabaseSchema(CopyDatabaseStatement
|
|
92
88
|
continue;
|
93
89
|
}
|
94
90
|
auto create_info = view.GetInfo();
|
95
|
-
create_info->catalog =
|
91
|
+
create_info->catalog = target_database_name;
|
96
92
|
create_info->on_conflict = OnCreateConflict::ERROR_ON_CONFLICT;
|
97
93
|
info->entries.push_back(std::move(create_info));
|
98
94
|
}
|
@@ -101,24 +97,23 @@ unique_ptr<LogicalOperator> Binder::BindCopyDatabaseSchema(CopyDatabaseStatement
|
|
101
97
|
return make_uniq<LogicalCopyDatabase>(std::move(info));
|
102
98
|
}
|
103
99
|
|
104
|
-
unique_ptr<LogicalOperator> Binder::BindCopyDatabaseData(
|
105
|
-
|
106
|
-
auto from_schemas = from_database.GetSchemas(context);
|
100
|
+
unique_ptr<LogicalOperator> Binder::BindCopyDatabaseData(Catalog &source_catalog, const string &target_database_name) {
|
101
|
+
auto source_schemas = source_catalog.GetSchemas(context);
|
107
102
|
|
108
103
|
ExportEntries entries;
|
109
|
-
PhysicalExport::ExtractEntries(context,
|
104
|
+
PhysicalExport::ExtractEntries(context, source_schemas, entries);
|
110
105
|
|
111
106
|
unique_ptr<LogicalOperator> result;
|
112
107
|
for (auto &table_ref : entries.tables) {
|
113
108
|
auto &table = table_ref.get();
|
114
109
|
// generate the insert statement
|
115
110
|
InsertStatement insert_stmt;
|
116
|
-
insert_stmt.catalog =
|
111
|
+
insert_stmt.catalog = target_database_name;
|
117
112
|
insert_stmt.schema = table.ParentSchema().name;
|
118
113
|
insert_stmt.table = table.name;
|
119
114
|
|
120
115
|
auto from_tbl = make_uniq<BaseTableRef>();
|
121
|
-
from_tbl->catalog_name =
|
116
|
+
from_tbl->catalog_name = source_catalog.GetName();
|
122
117
|
from_tbl->schema_name = table.ParentSchema().name;
|
123
118
|
from_tbl->table_name = table.name;
|
124
119
|
|
@@ -159,9 +154,9 @@ BoundStatement Binder::Bind(CopyDatabaseStatement &stmt) {
|
|
159
154
|
BoundStatement result;
|
160
155
|
|
161
156
|
unique_ptr<LogicalOperator> plan;
|
162
|
-
auto &
|
163
|
-
auto &
|
164
|
-
if (&
|
157
|
+
auto &source_catalog = Catalog::GetCatalog(context, stmt.from_database);
|
158
|
+
auto &target_catalog = Catalog::GetCatalog(context, stmt.to_database);
|
159
|
+
if (&source_catalog == &target_catalog) {
|
165
160
|
throw BinderException("Cannot copy from \"%s\" to \"%s\" - FROM and TO databases are the same",
|
166
161
|
stmt.from_database, stmt.to_database);
|
167
162
|
}
|
@@ -169,18 +164,18 @@ BoundStatement Binder::Bind(CopyDatabaseStatement &stmt) {
|
|
169
164
|
result.types = {LogicalType::BOOLEAN};
|
170
165
|
result.names = {"Success"};
|
171
166
|
|
172
|
-
plan = BindCopyDatabaseSchema(
|
167
|
+
plan = BindCopyDatabaseSchema(source_catalog, target_catalog.GetName());
|
173
168
|
} else {
|
174
169
|
result.types = {LogicalType::BIGINT};
|
175
170
|
result.names = {"Count"};
|
176
171
|
|
177
|
-
plan = BindCopyDatabaseData(
|
172
|
+
plan = BindCopyDatabaseData(source_catalog, target_catalog.GetName());
|
178
173
|
}
|
179
174
|
|
180
175
|
result.plan = std::move(plan);
|
181
176
|
properties.allow_stream_result = false;
|
182
177
|
properties.return_type = StatementReturnType::NOTHING;
|
183
|
-
properties.modified_databases.insert(
|
178
|
+
properties.modified_databases.insert(target_catalog.GetName());
|
184
179
|
return result;
|
185
180
|
}
|
186
181
|
|
@@ -42,6 +42,7 @@
|
|
42
42
|
#include "duckdb/catalog/duck_catalog.hpp"
|
43
43
|
#include "duckdb/function/table/table_scan.hpp"
|
44
44
|
#include "duckdb/parser/tableref/basetableref.hpp"
|
45
|
+
#include "duckdb/planner/expression_binder/select_bind_state.hpp"
|
45
46
|
|
46
47
|
namespace duckdb {
|
47
48
|
|
@@ -184,11 +185,10 @@ SchemaCatalogEntry &Binder::BindCreateFunctionInfo(CreateInfo &info) {
|
|
184
185
|
|
185
186
|
// bind it to verify the function was defined correctly
|
186
187
|
ErrorData error;
|
187
|
-
|
188
|
-
|
189
|
-
SelectBinder binder(*this, context,
|
188
|
+
BoundSelectNode sel_node;
|
189
|
+
BoundGroupInformation group_info;
|
190
|
+
SelectBinder binder(*this, context, sel_node, group_info);
|
190
191
|
error = binder.Bind(expression, 0, false);
|
191
|
-
|
192
192
|
if (error.HasError()) {
|
193
193
|
error.Throw();
|
194
194
|
}
|
@@ -272,16 +272,16 @@ static void FindMatchingPrimaryKeyColumns(const ColumnList &columns, const vecto
|
|
272
272
|
continue;
|
273
273
|
}
|
274
274
|
auto &unique = constr->Cast<UniqueConstraint>();
|
275
|
-
if (find_primary_key && !unique.
|
275
|
+
if (find_primary_key && !unique.IsPrimaryKey()) {
|
276
276
|
continue;
|
277
277
|
}
|
278
278
|
found_constraint = true;
|
279
279
|
|
280
280
|
vector<string> pk_names;
|
281
|
-
if (unique.
|
282
|
-
pk_names.push_back(columns.GetColumn(LogicalIndex(unique.
|
281
|
+
if (unique.HasIndex()) {
|
282
|
+
pk_names.push_back(columns.GetColumn(LogicalIndex(unique.GetIndex())).Name());
|
283
283
|
} else {
|
284
|
-
pk_names = unique.
|
284
|
+
pk_names = unique.GetColumnNames();
|
285
285
|
}
|
286
286
|
if (find_primary_key) {
|
287
287
|
// found matching primary key
|
@@ -414,15 +414,14 @@ static bool AnyConstraintReferencesGeneratedColumn(CreateTableInfo &table_info)
|
|
414
414
|
}
|
415
415
|
case ConstraintType::UNIQUE: {
|
416
416
|
auto &constraint = constr->Cast<UniqueConstraint>();
|
417
|
-
|
418
|
-
|
419
|
-
for (auto &col : constraint.columns) {
|
417
|
+
if (!constraint.HasIndex()) {
|
418
|
+
for (auto &col : constraint.GetColumnNames()) {
|
420
419
|
if (generated_columns.count(col)) {
|
421
420
|
return true;
|
422
421
|
}
|
423
422
|
}
|
424
423
|
} else {
|
425
|
-
if (table_info.columns.GetColumn(
|
424
|
+
if (table_info.columns.GetColumn(constraint.GetIndex()).Generated()) {
|
426
425
|
return true;
|
427
426
|
}
|
428
427
|
}
|
@@ -76,17 +76,16 @@ static void BindConstraints(Binder &binder, BoundCreateTableInfo &info) {
|
|
76
76
|
// have to resolve columns of the unique constraint
|
77
77
|
vector<LogicalIndex> keys;
|
78
78
|
logical_index_set_t key_set;
|
79
|
-
if (unique.
|
80
|
-
D_ASSERT(unique.
|
79
|
+
if (unique.HasIndex()) {
|
80
|
+
D_ASSERT(unique.GetIndex().index < base.columns.LogicalColumnCount());
|
81
81
|
// unique constraint is given by single index
|
82
|
-
unique.
|
83
|
-
keys.push_back(unique.
|
84
|
-
key_set.insert(unique.
|
82
|
+
unique.SetColumnName(base.columns.GetColumn(unique.GetIndex()).Name());
|
83
|
+
keys.push_back(unique.GetIndex());
|
84
|
+
key_set.insert(unique.GetIndex());
|
85
85
|
} else {
|
86
86
|
// unique constraint is given by list of names
|
87
87
|
// have to resolve names
|
88
|
-
|
89
|
-
for (auto &keyname : unique.columns) {
|
88
|
+
for (auto &keyname : unique.GetColumnNames()) {
|
90
89
|
if (!base.columns.ColumnExists(keyname)) {
|
91
90
|
throw ParserException("column \"%s\" named in key does not exist", keyname);
|
92
91
|
}
|
@@ -102,7 +101,7 @@ static void BindConstraints(Binder &binder, BoundCreateTableInfo &info) {
|
|
102
101
|
}
|
103
102
|
}
|
104
103
|
|
105
|
-
if (unique.
|
104
|
+
if (unique.IsPrimaryKey()) {
|
106
105
|
// we can only have one primary key per table
|
107
106
|
if (has_primary_key) {
|
108
107
|
throw ParserException("table \"%s\" has more than one primary key", base.table);
|
@@ -111,7 +110,7 @@ static void BindConstraints(Binder &binder, BoundCreateTableInfo &info) {
|
|
111
110
|
primary_keys = keys;
|
112
111
|
}
|
113
112
|
info.bound_constraints.push_back(
|
114
|
-
make_uniq<BoundUniqueConstraint>(std::move(keys), std::move(key_set), unique.
|
113
|
+
make_uniq<BoundUniqueConstraint>(std::move(keys), std::move(key_set), unique.IsPrimaryKey()));
|
115
114
|
break;
|
116
115
|
}
|
117
116
|
case ConstraintType::FOREIGN_KEY: {
|
@@ -202,7 +201,6 @@ void Binder::BindGeneratedColumns(BoundCreateTableInfo &info) {
|
|
202
201
|
col.SetType(bound_expression->return_type);
|
203
202
|
|
204
203
|
// Update the type in the binding, for future expansions
|
205
|
-
string ignore;
|
206
204
|
table_binding->types[i.index] = col.Type();
|
207
205
|
}
|
208
206
|
bound_indices.insert(i);
|
@@ -230,7 +228,7 @@ void Binder::BindDefaultValues(const ColumnList &columns, vector<unique_ptr<Expr
|
|
230
228
|
}
|
231
229
|
}
|
232
230
|
|
233
|
-
static void ExtractExpressionDependencies(Expression &expr,
|
231
|
+
static void ExtractExpressionDependencies(Expression &expr, LogicalDependencyList &dependencies) {
|
234
232
|
if (expr.type == ExpressionType::BOUND_FUNCTION) {
|
235
233
|
auto &function = expr.Cast<BoundFunctionExpression>();
|
236
234
|
if (function.function.dependency) {
|
@@ -305,25 +305,23 @@ void Binder::BindOnConflictClause(LogicalInsert &insert, TableCatalogEntry &tabl
|
|
305
305
|
}
|
306
306
|
|
307
307
|
auto bindings = insert.children[0]->GetColumnBindings();
|
308
|
-
|
309
|
-
vector<unique_ptr<LogicalOperator
|
310
|
-
|
311
|
-
|
312
|
-
if (insert_child_operators->empty()) {
|
308
|
+
optional_idx projection_index;
|
309
|
+
reference<vector<unique_ptr<LogicalOperator>>> insert_child_operators = insert.children;
|
310
|
+
while (!projection_index.IsValid()) {
|
311
|
+
if (insert_child_operators.get().empty()) {
|
313
312
|
// No further children to visit
|
314
313
|
break;
|
315
314
|
}
|
316
|
-
|
317
|
-
auto ¤t_child = (*insert_child_operators)[0];
|
315
|
+
auto ¤t_child = insert_child_operators.get()[0];
|
318
316
|
auto table_indices = current_child->GetTableIndex();
|
319
317
|
if (table_indices.empty()) {
|
320
318
|
// This operator does not have a table index to refer to, we have to visit its children
|
321
|
-
insert_child_operators =
|
319
|
+
insert_child_operators = current_child->children;
|
322
320
|
continue;
|
323
321
|
}
|
324
322
|
projection_index = table_indices[0];
|
325
323
|
}
|
326
|
-
if (projection_index
|
324
|
+
if (!projection_index.IsValid()) {
|
327
325
|
throw InternalException("Could not locate a table_index from the children of the insert");
|
328
326
|
}
|
329
327
|
|
@@ -335,7 +333,7 @@ void Binder::BindOnConflictClause(LogicalInsert &insert, TableCatalogEntry &tabl
|
|
335
333
|
|
336
334
|
// Replace any column bindings to refer to the projection table_index, rather than the source table
|
337
335
|
if (insert.on_conflict_condition) {
|
338
|
-
ReplaceColumnBindings(*insert.on_conflict_condition, table_index, projection_index);
|
336
|
+
ReplaceColumnBindings(*insert.on_conflict_condition, table_index, projection_index.GetIndex());
|
339
337
|
}
|
340
338
|
|
341
339
|
if (insert.action_type == OnConflictAction::REPLACE) {
|
@@ -387,11 +385,11 @@ void Binder::BindOnConflictClause(LogicalInsert &insert, TableCatalogEntry &tabl
|
|
387
385
|
// Replace the column bindings to refer to the child operator
|
388
386
|
for (auto &expr : insert.expressions) {
|
389
387
|
// Change the non-excluded column references to refer to the projection index
|
390
|
-
ReplaceColumnBindings(*expr, table_index, projection_index);
|
388
|
+
ReplaceColumnBindings(*expr, table_index, projection_index.GetIndex());
|
391
389
|
}
|
392
390
|
// Do the same for the (optional) DO UPDATE condition
|
393
391
|
if (insert.do_update_condition) {
|
394
|
-
ReplaceColumnBindings(*insert.do_update_condition, table_index, projection_index);
|
392
|
+
ReplaceColumnBindings(*insert.do_update_condition, table_index, projection_index.GetIndex());
|
395
393
|
}
|
396
394
|
}
|
397
395
|
|
@@ -442,7 +440,6 @@ BoundStatement Binder::Bind(InsertStatement &stmt) {
|
|
442
440
|
if (!entry.second) {
|
443
441
|
throw BinderException("Duplicate column name \"%s\" in INSERT", stmt.columns[i]);
|
444
442
|
}
|
445
|
-
column_name_map[stmt.columns[i]] = i;
|
446
443
|
auto column_index = table.GetColumnIndex(stmt.columns[i]);
|
447
444
|
if (column_index.index == COLUMN_IDENTIFIER_ROW_ID) {
|
448
445
|
throw BinderException("Cannot explicitly insert values into rowid column");
|
@@ -31,13 +31,13 @@ unique_ptr<BoundPragmaInfo> Binder::BindPragma(PragmaInfo &info, QueryErrorConte
|
|
31
31
|
auto &entry = Catalog::GetEntry<PragmaFunctionCatalogEntry>(context, INVALID_CATALOG, DEFAULT_SCHEMA, info.name);
|
32
32
|
FunctionBinder function_binder(context);
|
33
33
|
ErrorData error;
|
34
|
-
|
35
|
-
if (bound_idx
|
34
|
+
auto bound_idx = function_binder.BindFunction(entry.name, entry.functions, params, error);
|
35
|
+
if (!bound_idx.IsValid()) {
|
36
36
|
D_ASSERT(error.HasError());
|
37
37
|
error.AddQueryLocation(error_context);
|
38
38
|
error.Throw();
|
39
39
|
}
|
40
|
-
auto bound_function = entry.functions.GetFunctionByOffset(bound_idx);
|
40
|
+
auto bound_function = entry.functions.GetFunctionByOffset(bound_idx.GetIndex());
|
41
41
|
// bind and check named params
|
42
42
|
BindNamedParameters(bound_function.named_parameters, named_parameters, error_context, bound_function.name);
|
43
43
|
return make_uniq<BoundPragmaInfo>(std::move(bound_function), std::move(params), std::move(named_parameters));
|
@@ -15,6 +15,9 @@ BoundStatement Binder::Bind(SetVariableStatement &stmt) {
|
|
15
15
|
// evaluate the scalar value
|
16
16
|
ConstantBinder default_binder(*this, context, "SET value");
|
17
17
|
auto bound_value = default_binder.Bind(stmt.value);
|
18
|
+
if (bound_value->HasParameter()) {
|
19
|
+
throw NotImplementedException("SET statements cannot have parameters");
|
20
|
+
}
|
18
21
|
auto value = ExpressionExecutor::EvaluateScalar(context, *bound_value, true);
|
19
22
|
|
20
23
|
result.plan = make_uniq<LogicalSet>(stmt.name, std::move(value), stmt.scope);
|
@@ -3,84 +3,85 @@
|
|
3
3
|
#include "duckdb/planner/binder.hpp"
|
4
4
|
#include "duckdb/planner/operator/logical_get.hpp"
|
5
5
|
#include "duckdb/planner/operator/logical_projection.hpp"
|
6
|
-
#include "duckdb/planner/operator/
|
6
|
+
#include "duckdb/planner/operator/logical_vacuum.hpp"
|
7
7
|
#include "duckdb/catalog/catalog_entry/table_catalog_entry.hpp"
|
8
8
|
|
9
9
|
namespace duckdb {
|
10
10
|
|
11
|
-
|
12
|
-
|
11
|
+
void Binder::BindVacuumTable(LogicalVacuum &vacuum, unique_ptr<LogicalOperator> &root) {
|
12
|
+
auto &info = vacuum.GetInfo();
|
13
|
+
if (!info.has_table) {
|
14
|
+
return;
|
15
|
+
}
|
13
16
|
|
14
|
-
|
17
|
+
D_ASSERT(vacuum.column_id_map.empty());
|
18
|
+
auto bound_table = Bind(*info.ref);
|
19
|
+
if (bound_table->type != TableReferenceType::BASE_TABLE) {
|
20
|
+
throw InvalidInputException("Can only vacuum/analyze base tables!");
|
21
|
+
}
|
22
|
+
auto ref = unique_ptr_cast<BoundTableRef, BoundBaseTableRef>(std::move(bound_table));
|
23
|
+
auto &table = ref->table;
|
24
|
+
vacuum.SetTable(table);
|
15
25
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
auto ref = unique_ptr_cast<BoundTableRef, BoundBaseTableRef>(std::move(bound_table));
|
24
|
-
auto &table = ref->table;
|
25
|
-
stmt.info->table = &table;
|
26
|
+
vector<unique_ptr<Expression>> select_list;
|
27
|
+
auto &columns = info.columns;
|
28
|
+
if (columns.empty()) {
|
29
|
+
// Empty means ALL columns should be vacuumed/analyzed
|
30
|
+
auto &get = ref->get->Cast<LogicalGet>();
|
31
|
+
columns.insert(columns.end(), get.names.begin(), get.names.end());
|
32
|
+
}
|
26
33
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
columns.insert(columns.end(), get.names.begin(), get.names.end());
|
34
|
+
case_insensitive_set_t column_name_set;
|
35
|
+
vector<string> non_generated_column_names;
|
36
|
+
for (auto &col_name : columns) {
|
37
|
+
if (column_name_set.count(col_name) > 0) {
|
38
|
+
throw BinderException("Vacuum the same column twice(same name in column name list)");
|
33
39
|
}
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
for (auto &col_name : columns) {
|
38
|
-
if (column_name_set.count(col_name) > 0) {
|
39
|
-
throw BinderException("Vacuum the same column twice(same name in column name list)");
|
40
|
-
}
|
41
|
-
column_name_set.insert(col_name);
|
42
|
-
if (!table.ColumnExists(col_name)) {
|
43
|
-
throw BinderException("Column with name \"%s\" does not exist", col_name);
|
44
|
-
}
|
45
|
-
auto &col = table.GetColumn(col_name);
|
46
|
-
// ignore generated column
|
47
|
-
if (col.Generated()) {
|
48
|
-
continue;
|
49
|
-
}
|
50
|
-
non_generated_column_names.push_back(col_name);
|
51
|
-
ColumnRefExpression colref(col_name, table.name);
|
52
|
-
auto result = bind_context.BindColumn(colref, 0);
|
53
|
-
if (result.HasError()) {
|
54
|
-
result.error.Throw();
|
55
|
-
}
|
56
|
-
select_list.push_back(std::move(result.expression));
|
40
|
+
column_name_set.insert(col_name);
|
41
|
+
if (!table.ColumnExists(col_name)) {
|
42
|
+
throw BinderException("Column with name \"%s\" does not exist", col_name);
|
57
43
|
}
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
44
|
+
auto &col = table.GetColumn(col_name);
|
45
|
+
// ignore generated column
|
46
|
+
if (col.Generated()) {
|
47
|
+
continue;
|
48
|
+
}
|
49
|
+
non_generated_column_names.push_back(col_name);
|
50
|
+
ColumnRefExpression colref(col_name, table.name);
|
51
|
+
auto result = bind_context.BindColumn(colref, 0);
|
52
|
+
if (result.HasError()) {
|
53
|
+
result.error.Throw();
|
54
|
+
}
|
55
|
+
select_list.push_back(std::move(result.expression));
|
56
|
+
}
|
57
|
+
info.columns = std::move(non_generated_column_names);
|
58
|
+
// Creating a table without any physical columns is not supported
|
59
|
+
D_ASSERT(!select_list.empty());
|
64
60
|
|
65
|
-
|
66
|
-
|
67
|
-
for (idx_t i = 0; i < get.column_ids.size(); i++) {
|
68
|
-
stmt.info->column_id_map[i] =
|
69
|
-
table.GetColumns().LogicalToPhysical(LogicalIndex(get.column_ids[i])).index;
|
70
|
-
}
|
61
|
+
auto table_scan = CreatePlan(*ref);
|
62
|
+
D_ASSERT(table_scan->type == LogicalOperatorType::LOGICAL_GET);
|
71
63
|
|
72
|
-
|
73
|
-
projection->children.push_back(std::move(table_scan));
|
64
|
+
auto &get = table_scan->Cast<LogicalGet>();
|
74
65
|
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
// Make it not a SINK so it doesn't have to do anything
|
80
|
-
stmt.info->has_table = false;
|
81
|
-
}
|
66
|
+
D_ASSERT(select_list.size() == get.column_ids.size());
|
67
|
+
D_ASSERT(info.columns.size() == get.column_ids.size());
|
68
|
+
for (idx_t i = 0; i < get.column_ids.size(); i++) {
|
69
|
+
vacuum.column_id_map[i] = table.GetColumns().LogicalToPhysical(LogicalIndex(get.column_ids[i])).index;
|
82
70
|
}
|
83
|
-
|
71
|
+
|
72
|
+
auto projection = make_uniq<LogicalProjection>(GenerateTableIndex(), std::move(select_list));
|
73
|
+
projection->children.push_back(std::move(table_scan));
|
74
|
+
|
75
|
+
root = std::move(projection);
|
76
|
+
}
|
77
|
+
|
78
|
+
BoundStatement Binder::Bind(VacuumStatement &stmt) {
|
79
|
+
BoundStatement result;
|
80
|
+
|
81
|
+
unique_ptr<LogicalOperator> root;
|
82
|
+
|
83
|
+
auto vacuum = make_uniq<LogicalVacuum>(std::move(stmt.info));
|
84
|
+
BindVacuumTable(*vacuum, root);
|
84
85
|
if (root) {
|
85
86
|
vacuum->children.push_back(std::move(root));
|
86
87
|
}
|
@@ -80,62 +80,70 @@ unique_ptr<BoundTableRef> Binder::Bind(BaseTableRef &ref) {
|
|
80
80
|
// check if the table name refers to a CTE
|
81
81
|
|
82
82
|
// CTE name should never be qualified (i.e. schema_name should be empty)
|
83
|
-
|
83
|
+
vector<reference<CommonTableExpressionInfo>> found_ctes;
|
84
84
|
if (ref.schema_name.empty()) {
|
85
|
-
|
85
|
+
found_ctes = FindCTE(ref.table_name, ref.table_name == alias);
|
86
86
|
}
|
87
87
|
|
88
|
-
if (
|
88
|
+
if (!found_ctes.empty()) {
|
89
89
|
// Check if there is a CTE binding in the BindContext
|
90
|
-
|
91
|
-
auto
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
}
|
101
|
-
// Move CTE to subquery and bind recursively
|
102
|
-
SubqueryRef subquery(unique_ptr_cast<SQLStatement, SelectStatement>(cte.query->Copy()));
|
103
|
-
subquery.alias = ref.alias.empty() ? ref.table_name : ref.alias;
|
104
|
-
subquery.column_name_alias = cte.aliases;
|
105
|
-
for (idx_t i = 0; i < ref.column_name_alias.size(); i++) {
|
106
|
-
if (i < subquery.column_name_alias.size()) {
|
107
|
-
subquery.column_name_alias[i] = ref.column_name_alias[i];
|
108
|
-
} else {
|
109
|
-
subquery.column_name_alias.push_back(ref.column_name_alias[i]);
|
90
|
+
bool circular_cte = false;
|
91
|
+
for (auto found_cte : found_ctes) {
|
92
|
+
auto &cte = found_cte.get();
|
93
|
+
auto ctebinding = bind_context.GetCTEBinding(ref.table_name);
|
94
|
+
if (!ctebinding) {
|
95
|
+
if (CTEIsAlreadyBound(cte)) {
|
96
|
+
// remember error state
|
97
|
+
circular_cte = true;
|
98
|
+
// retry with next candidate CTE
|
99
|
+
continue;
|
110
100
|
}
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
101
|
+
// Move CTE to subquery and bind recursively
|
102
|
+
SubqueryRef subquery(unique_ptr_cast<SQLStatement, SelectStatement>(cte.query->Copy()));
|
103
|
+
subquery.alias = ref.alias.empty() ? ref.table_name : ref.alias;
|
104
|
+
subquery.column_name_alias = cte.aliases;
|
105
|
+
for (idx_t i = 0; i < ref.column_name_alias.size(); i++) {
|
106
|
+
if (i < subquery.column_name_alias.size()) {
|
107
|
+
subquery.column_name_alias[i] = ref.column_name_alias[i];
|
108
|
+
} else {
|
109
|
+
subquery.column_name_alias.push_back(ref.column_name_alias[i]);
|
110
|
+
}
|
111
|
+
}
|
112
|
+
return Bind(subquery, &found_cte.get());
|
113
|
+
} else {
|
114
|
+
// There is a CTE binding in the BindContext.
|
115
|
+
// This can only be the case if there is a recursive CTE,
|
116
|
+
// or a materialized CTE present.
|
117
|
+
auto index = GenerateTableIndex();
|
118
|
+
auto materialized = cte.materialized;
|
119
|
+
if (materialized == CTEMaterialize::CTE_MATERIALIZE_DEFAULT) {
|
120
120
|
#ifdef DUCKDB_ALTERNATIVE_VERIFY
|
121
|
-
|
121
|
+
materialized = CTEMaterialize::CTE_MATERIALIZE_ALWAYS;
|
122
122
|
#else
|
123
|
-
|
123
|
+
materialized = CTEMaterialize::CTE_MATERIALIZE_NEVER;
|
124
124
|
#endif
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
auto names = BindContext::AliasColumnNames(alias, b->names, ref.column_name_alias);
|
125
|
+
}
|
126
|
+
auto result = make_uniq<BoundCTERef>(index, ctebinding->index, materialized);
|
127
|
+
auto alias = ref.alias.empty() ? ref.table_name : ref.alias;
|
128
|
+
auto names = BindContext::AliasColumnNames(alias, ctebinding->names, ref.column_name_alias);
|
130
129
|
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
130
|
+
bind_context.AddGenericBinding(index, alias, names, ctebinding->types);
|
131
|
+
// Update references to CTE
|
132
|
+
auto cteref = bind_context.cte_references[ref.table_name];
|
133
|
+
(*cteref)++;
|
135
134
|
|
136
|
-
|
137
|
-
|
138
|
-
|
135
|
+
result->types = ctebinding->types;
|
136
|
+
result->bound_columns = std::move(names);
|
137
|
+
return std::move(result);
|
138
|
+
}
|
139
|
+
}
|
140
|
+
if (circular_cte) {
|
141
|
+
throw BinderException(
|
142
|
+
"Circular reference to CTE \"%s\", There are two possible solutions. \n1. use WITH RECURSIVE to "
|
143
|
+
"use recursive CTEs. \n2. If "
|
144
|
+
"you want to use the TABLE name \"%s\" the same as the CTE name, please explicitly add "
|
145
|
+
"\"SCHEMA\" before table name. You can try \"main.%s\" (main is the duckdb default schema)",
|
146
|
+
ref.table_name, ref.table_name, ref.table_name);
|
139
147
|
}
|
140
148
|
}
|
141
149
|
// not a CTE
|