duckdb 0.10.2-dev0.0 → 0.10.2-dev5.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
- package/test/jsdoc.test.ts +3 -0
@@ -1,5 +1,7 @@
|
|
1
1
|
#include "duckdb/execution/operator/csv_scanner/csv_error.hpp"
|
2
2
|
#include "duckdb/common/exception/conversion_exception.hpp"
|
3
|
+
#include "duckdb/common/string_util.hpp"
|
4
|
+
|
3
5
|
#include <sstream>
|
4
6
|
|
5
7
|
namespace duckdb {
|
@@ -16,9 +18,17 @@ CSVErrorHandler::CSVErrorHandler(bool ignore_errors_p) : ignore_errors(ignore_er
|
|
16
18
|
void CSVErrorHandler::ThrowError(CSVError csv_error) {
|
17
19
|
std::ostringstream error;
|
18
20
|
if (PrintLineNumber(csv_error)) {
|
19
|
-
error << "CSV Error on Line: " << GetLine(csv_error.error_info) <<
|
21
|
+
error << "CSV Error on Line: " << GetLine(csv_error.error_info) << '\n';
|
22
|
+
if (!csv_error.csv_row.empty()) {
|
23
|
+
error << "Original Line: " << csv_error.csv_row << '\n';
|
24
|
+
}
|
25
|
+
}
|
26
|
+
if (csv_error.full_error_message.empty()) {
|
27
|
+
error << csv_error.error_message;
|
28
|
+
} else {
|
29
|
+
error << csv_error.full_error_message;
|
20
30
|
}
|
21
|
-
|
31
|
+
|
22
32
|
switch (csv_error.type) {
|
23
33
|
case CSVErrorType::CAST_ERROR:
|
24
34
|
throw ConversionException(error.str());
|
@@ -76,10 +86,21 @@ CSVError::CSVError(string error_message_p, CSVErrorType type_p, LinesPerBoundary
|
|
76
86
|
: error_message(std::move(error_message_p)), type(type_p), error_info(error_info_p) {
|
77
87
|
}
|
78
88
|
|
79
|
-
CSVError::CSVError(string error_message_p, CSVErrorType type_p, idx_t column_idx_p,
|
80
|
-
LinesPerBoundary error_info_p
|
81
|
-
|
82
|
-
|
89
|
+
CSVError::CSVError(string error_message_p, CSVErrorType type_p, idx_t column_idx_p, string csv_row_p,
|
90
|
+
LinesPerBoundary error_info_p, idx_t row_byte_position, int64_t byte_position_p,
|
91
|
+
const CSVReaderOptions &reader_options, const string &fixes)
|
92
|
+
: error_message(std::move(error_message_p)), type(type_p), column_idx(column_idx_p), csv_row(std::move(csv_row_p)),
|
93
|
+
error_info(error_info_p), row_byte_position(row_byte_position), byte_position(byte_position_p) {
|
94
|
+
// What were the options
|
95
|
+
std::ostringstream error;
|
96
|
+
if (reader_options.ignore_errors.GetValue()) {
|
97
|
+
RemoveNewLine(error_message);
|
98
|
+
}
|
99
|
+
error << error_message << '\n';
|
100
|
+
error << fixes << '\n';
|
101
|
+
error << reader_options.ToString();
|
102
|
+
error << '\n';
|
103
|
+
full_error_message = error.str();
|
83
104
|
}
|
84
105
|
|
85
106
|
CSVError CSVError::ColumnTypesError(case_insensitive_map_t<idx_t> sql_types_per_column, const vector<string> &names) {
|
@@ -102,47 +123,60 @@ CSVError CSVError::ColumnTypesError(case_insensitive_map_t<idx_t> sql_types_per_
|
|
102
123
|
return CSVError(exception, CSVErrorType::COLUMN_NAME_TYPE_MISMATCH, {});
|
103
124
|
}
|
104
125
|
|
126
|
+
void CSVError::RemoveNewLine(string &error) {
|
127
|
+
error = StringUtil::Split(error, "\n")[0];
|
128
|
+
}
|
129
|
+
|
105
130
|
CSVError CSVError::CastError(const CSVReaderOptions &options, string &column_name, string &cast_error, idx_t column_idx,
|
106
|
-
|
131
|
+
string &csv_row, LinesPerBoundary error_info, idx_t row_byte_position,
|
132
|
+
int64_t byte_position, LogicalTypeId type) {
|
107
133
|
std::ostringstream error;
|
108
134
|
// Which column
|
109
|
-
error << "Error when converting column \"" << column_name << "\"."
|
135
|
+
error << "Error when converting column \"" << column_name << "\". ";
|
110
136
|
// What was the cast error
|
111
|
-
error << cast_error <<
|
112
|
-
|
113
|
-
|
137
|
+
error << cast_error << '\n';
|
138
|
+
std::ostringstream how_to_fix_it;
|
139
|
+
how_to_fix_it << "Column " << column_name << " is being converted as type " << LogicalTypeIdToString(type) << '\n';
|
114
140
|
if (!options.WasTypeManuallySet(column_idx)) {
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
141
|
+
how_to_fix_it << "This type was auto-detected from the CSV file." << '\n';
|
142
|
+
how_to_fix_it << "Possible solutions:" << '\n';
|
143
|
+
how_to_fix_it << "* Override the type for this column manually by setting the type explicitly, e.g. types={'"
|
144
|
+
<< column_name << "': 'VARCHAR'}" << '\n';
|
145
|
+
how_to_fix_it
|
146
|
+
<< "* Set the sample size to a larger value to enable the auto-detection to scan more values, e.g. "
|
147
|
+
"sample_size=-1"
|
148
|
+
<< '\n';
|
149
|
+
how_to_fix_it << "* Use a COPY statement to automatically derive types from an existing table." << '\n';
|
123
150
|
} else {
|
124
|
-
|
125
|
-
|
126
|
-
|
151
|
+
how_to_fix_it
|
152
|
+
<< "This type was either manually set or derived from an existing table. Select a different type to "
|
153
|
+
"correctly parse this column."
|
154
|
+
<< '\n';
|
127
155
|
}
|
128
|
-
error << options.ToString();
|
129
156
|
|
130
|
-
return CSVError(error.str(), CSVErrorType::CAST_ERROR, column_idx,
|
157
|
+
return CSVError(error.str(), CSVErrorType::CAST_ERROR, column_idx, csv_row, error_info, row_byte_position,
|
158
|
+
byte_position, options, how_to_fix_it.str());
|
131
159
|
}
|
132
160
|
|
133
|
-
CSVError CSVError::LineSizeError(const CSVReaderOptions &options, idx_t actual_size, LinesPerBoundary error_info
|
161
|
+
CSVError CSVError::LineSizeError(const CSVReaderOptions &options, idx_t actual_size, LinesPerBoundary error_info,
|
162
|
+
string &csv_row, idx_t byte_position) {
|
134
163
|
std::ostringstream error;
|
135
164
|
error << "Maximum line size of " << options.maximum_line_size << " bytes exceeded. ";
|
136
|
-
error << "Actual Size:" << actual_size << " bytes." <<
|
137
|
-
|
138
|
-
|
165
|
+
error << "Actual Size:" << actual_size << " bytes." << '\n';
|
166
|
+
|
167
|
+
std::ostringstream how_to_fix_it;
|
168
|
+
how_to_fix_it << "Possible Solution: Change the maximum length size, e.g., max_line_size=" << actual_size + 1
|
169
|
+
<< "\n";
|
170
|
+
|
171
|
+
return CSVError(error.str(), CSVErrorType::MAXIMUM_LINE_SIZE, 0, csv_row, error_info, byte_position, byte_position,
|
172
|
+
options, how_to_fix_it.str());
|
139
173
|
}
|
140
174
|
|
141
175
|
CSVError CSVError::SniffingError(string &file_path) {
|
142
176
|
std::ostringstream error;
|
143
177
|
// Which column
|
144
|
-
error << "Error when sniffing file \"" << file_path << "\"." <<
|
145
|
-
error << "CSV options could not be auto-detected. Consider setting parser options manually." <<
|
178
|
+
error << "Error when sniffing file \"" << file_path << "\"." << '\n';
|
179
|
+
error << "CSV options could not be auto-detected. Consider setting parser options manually." << '\n';
|
146
180
|
return CSVError(error.str(), CSVErrorType::SNIFFING, {});
|
147
181
|
}
|
148
182
|
|
@@ -150,49 +184,56 @@ CSVError CSVError::NullPaddingFail(const CSVReaderOptions &options, LinesPerBoun
|
|
150
184
|
std::ostringstream error;
|
151
185
|
error << " The parallel scanner does not support null_padding in conjunction with quoted new lines. Please "
|
152
186
|
"disable the parallel csv reader with parallel=false"
|
153
|
-
<<
|
187
|
+
<< '\n';
|
154
188
|
// What were the options
|
155
189
|
error << options.ToString();
|
156
190
|
return CSVError(error.str(), CSVErrorType::NULLPADDED_QUOTED_NEW_VALUE, error_info);
|
157
191
|
}
|
158
192
|
|
159
|
-
CSVError CSVError::UnterminatedQuotesError(const CSVReaderOptions &options,
|
160
|
-
|
193
|
+
CSVError CSVError::UnterminatedQuotesError(const CSVReaderOptions &options, idx_t current_column,
|
194
|
+
LinesPerBoundary error_info, string &csv_row, idx_t row_byte_position,
|
195
|
+
int64_t byte_position) {
|
161
196
|
std::ostringstream error;
|
162
|
-
error << "Value with unterminated quote found." <<
|
163
|
-
|
164
|
-
|
165
|
-
error
|
166
|
-
|
197
|
+
error << "Value with unterminated quote found." << '\n';
|
198
|
+
std::ostringstream how_to_fix_it;
|
199
|
+
how_to_fix_it << "Possible Solution: Enable ignore errors (ignore_errors=true) to skip this row" << '\n';
|
200
|
+
return CSVError(error.str(), CSVErrorType::UNTERMINATED_QUOTES, current_column, csv_row, error_info,
|
201
|
+
row_byte_position, byte_position, options, how_to_fix_it.str());
|
167
202
|
}
|
168
203
|
|
169
|
-
CSVError CSVError::IncorrectColumnAmountError(const CSVReaderOptions &options,
|
170
|
-
|
171
|
-
|
204
|
+
CSVError CSVError::IncorrectColumnAmountError(const CSVReaderOptions &options, idx_t actual_columns,
|
205
|
+
LinesPerBoundary error_info, string &csv_row, idx_t row_byte_position,
|
206
|
+
int64_t byte_position) {
|
172
207
|
std::ostringstream error;
|
173
|
-
//
|
174
|
-
|
175
|
-
|
176
|
-
error << std::endl << "Possible fixes:" << std::endl;
|
208
|
+
// We don't have a fix for this
|
209
|
+
std::ostringstream how_to_fix_it;
|
210
|
+
how_to_fix_it << "Possible fixes:" << '\n';
|
177
211
|
if (!options.null_padding) {
|
178
|
-
|
212
|
+
how_to_fix_it << "* Enable null padding (null_padding=true) to replace missing values with NULL" << '\n';
|
179
213
|
}
|
180
|
-
if (!options.ignore_errors) {
|
181
|
-
|
214
|
+
if (!options.ignore_errors.GetValue()) {
|
215
|
+
how_to_fix_it << "* Enable ignore errors (ignore_errors=true) to skip this row" << '\n';
|
216
|
+
}
|
217
|
+
// How many columns were expected and how many were found
|
218
|
+
error << "Expected Number of Columns: " << options.dialect_options.num_cols << " Found: " << actual_columns + 1;
|
219
|
+
if (actual_columns >= options.dialect_options.num_cols) {
|
220
|
+
return CSVError(error.str(), CSVErrorType::TOO_MANY_COLUMNS, actual_columns, csv_row, error_info,
|
221
|
+
row_byte_position, byte_position - 1, options, how_to_fix_it.str());
|
222
|
+
} else {
|
223
|
+
return CSVError(error.str(), CSVErrorType::TOO_FEW_COLUMNS, actual_columns, csv_row, error_info,
|
224
|
+
row_byte_position, byte_position - 1, options, how_to_fix_it.str());
|
182
225
|
}
|
183
|
-
error << std::endl;
|
184
|
-
// What were the options
|
185
|
-
error << options.ToString();
|
186
|
-
return CSVError(error.str(), CSVErrorType::INCORRECT_COLUMN_AMOUNT, error_info);
|
187
226
|
}
|
188
227
|
|
189
|
-
CSVError CSVError::InvalidUTF8(const CSVReaderOptions &options, LinesPerBoundary error_info
|
228
|
+
CSVError CSVError::InvalidUTF8(const CSVReaderOptions &options, idx_t current_column, LinesPerBoundary error_info,
|
229
|
+
string &csv_row, idx_t row_byte_position, int64_t byte_position) {
|
190
230
|
std::ostringstream error;
|
191
231
|
// How many columns were expected and how many were found
|
192
|
-
error << "Invalid unicode (byte sequence mismatch) detected." <<
|
193
|
-
|
194
|
-
|
195
|
-
return CSVError(error.str(), CSVErrorType::INVALID_UNICODE, error_info
|
232
|
+
error << "Invalid unicode (byte sequence mismatch) detected." << '\n';
|
233
|
+
std::ostringstream how_to_fix_it;
|
234
|
+
how_to_fix_it << "Possible Solution: Enable ignore errors (ignore_errors=true) to skip this row" << '\n';
|
235
|
+
return CSVError(error.str(), CSVErrorType::INVALID_UNICODE, current_column, csv_row, error_info, row_byte_position,
|
236
|
+
byte_position, options, how_to_fix_it.str());
|
196
237
|
}
|
197
238
|
|
198
239
|
bool CSVErrorHandler::PrintLineNumber(CSVError &error) {
|
@@ -202,7 +243,8 @@ bool CSVErrorHandler::PrintLineNumber(CSVError &error) {
|
|
202
243
|
switch (error.type) {
|
203
244
|
case CSVErrorType::CAST_ERROR:
|
204
245
|
case CSVErrorType::UNTERMINATED_QUOTES:
|
205
|
-
case CSVErrorType::
|
246
|
+
case CSVErrorType::TOO_FEW_COLUMNS:
|
247
|
+
case CSVErrorType::TOO_MANY_COLUMNS:
|
206
248
|
case CSVErrorType::MAXIMUM_LINE_SIZE:
|
207
249
|
case CSVErrorType::NULLPADDED_QUOTED_NEW_VALUE:
|
208
250
|
case CSVErrorType::INVALID_UNICODE:
|
@@ -180,8 +180,6 @@ void CSVReaderOptions::SetReadOption(const string &loption, const Value &value,
|
|
180
180
|
SetSkipRows(ParseInteger(value, loption));
|
181
181
|
} else if (loption == "max_line_size" || loption == "maximum_line_size") {
|
182
182
|
maximum_line_size = ParseInteger(value, loption);
|
183
|
-
} else if (loption == "force_not_null") {
|
184
|
-
force_not_null = ParseColumnList(value, expected_names, loption);
|
185
183
|
} else if (loption == "date_format" || loption == "dateformat") {
|
186
184
|
string format = ParseString(value, loption);
|
187
185
|
SetDateFormat(LogicalTypeId::DATE, format, true);
|
@@ -189,7 +187,7 @@ void CSVReaderOptions::SetReadOption(const string &loption, const Value &value,
|
|
189
187
|
string format = ParseString(value, loption);
|
190
188
|
SetDateFormat(LogicalTypeId::TIMESTAMP, format, true);
|
191
189
|
} else if (loption == "ignore_errors") {
|
192
|
-
ignore_errors
|
190
|
+
ignore_errors.Set(ParseBoolean(value, loption));
|
193
191
|
} else if (loption == "buffer_size") {
|
194
192
|
buffer_size = ParseInteger(value, loption);
|
195
193
|
if (buffer_size == 0) {
|
@@ -206,20 +204,34 @@ void CSVReaderOptions::SetReadOption(const string &loption, const Value &value,
|
|
206
204
|
parallel = ParseBoolean(value, loption);
|
207
205
|
} else if (loption == "allow_quoted_nulls") {
|
208
206
|
allow_quoted_nulls = ParseBoolean(value, loption);
|
207
|
+
} else if (loption == "store_rejects") {
|
208
|
+
store_rejects.Set(ParseBoolean(value, loption));
|
209
|
+
} else if (loption == "force_not_null") {
|
210
|
+
if (!expected_names.empty()) {
|
211
|
+
force_not_null = ParseColumnList(value, expected_names, loption);
|
212
|
+
} else {
|
213
|
+
// Get the list of columns to use as a recovery key
|
214
|
+
auto &children = ListValue::GetChildren(value);
|
215
|
+
for (auto &child : children) {
|
216
|
+
auto col_name = child.GetValue<string>();
|
217
|
+
force_not_null_names.insert(col_name);
|
218
|
+
}
|
219
|
+
}
|
220
|
+
|
209
221
|
} else if (loption == "rejects_table") {
|
210
222
|
// skip, handled in SetRejectsOptions
|
211
223
|
auto table_name = ParseString(value, loption);
|
212
224
|
if (table_name.empty()) {
|
213
225
|
throw BinderException("REJECTS_TABLE option cannot be empty");
|
214
226
|
}
|
215
|
-
rejects_table_name
|
216
|
-
} else if (loption == "
|
217
|
-
//
|
218
|
-
auto
|
219
|
-
|
220
|
-
|
221
|
-
rejects_recovery_columns.push_back(col_name);
|
227
|
+
rejects_table_name.Set(table_name);
|
228
|
+
} else if (loption == "rejects_scan") {
|
229
|
+
// skip, handled in SetRejectsOptions
|
230
|
+
auto table_name = ParseString(value, loption);
|
231
|
+
if (table_name.empty()) {
|
232
|
+
throw BinderException("rejects_scan option cannot be empty");
|
222
233
|
}
|
234
|
+
rejects_scan_name.Set(table_name);
|
223
235
|
} else if (loption == "rejects_limit") {
|
224
236
|
int64_t limit = ParseInteger(value, loption);
|
225
237
|
if (limit < 0) {
|
@@ -238,7 +250,7 @@ void CSVReaderOptions::SetWriteOption(const string &loption, const Value &value)
|
|
238
250
|
return;
|
239
251
|
}
|
240
252
|
|
241
|
-
if (SetBaseOption(loption, value)) {
|
253
|
+
if (SetBaseOption(loption, value, true)) {
|
242
254
|
return;
|
243
255
|
}
|
244
256
|
|
@@ -263,7 +275,7 @@ void CSVReaderOptions::SetWriteOption(const string &loption, const Value &value)
|
|
263
275
|
}
|
264
276
|
}
|
265
277
|
|
266
|
-
bool CSVReaderOptions::SetBaseOption(const string &loption, const Value &value) {
|
278
|
+
bool CSVReaderOptions::SetBaseOption(const string &loption, const Value &value, bool write_option) {
|
267
279
|
// Make sure this function was only called after the option was turned into lowercase
|
268
280
|
D_ASSERT(!std::any_of(loption.begin(), loption.end(), ::isupper));
|
269
281
|
|
@@ -277,8 +289,50 @@ bool CSVReaderOptions::SetBaseOption(const string &loption, const Value &value)
|
|
277
289
|
SetEscape(ParseString(value, loption));
|
278
290
|
} else if (loption == "header") {
|
279
291
|
SetHeader(ParseBoolean(value, loption));
|
280
|
-
} else if (loption == "
|
281
|
-
|
292
|
+
} else if (loption == "nullstr" || loption == "null") {
|
293
|
+
auto &child_type = value.type();
|
294
|
+
null_str.clear();
|
295
|
+
if (child_type.id() != LogicalTypeId::LIST && child_type.id() != LogicalTypeId::VARCHAR) {
|
296
|
+
throw BinderException("CSV Reader function option %s requires a string or a list as input", loption);
|
297
|
+
}
|
298
|
+
if (!null_str.empty()) {
|
299
|
+
throw BinderException("CSV Reader function option nullstr can only be supplied once");
|
300
|
+
}
|
301
|
+
if (child_type.id() == LogicalTypeId::LIST) {
|
302
|
+
auto &list_child = ListType::GetChildType(child_type);
|
303
|
+
const vector<Value> *children = nullptr;
|
304
|
+
if (list_child.id() == LogicalTypeId::LIST) {
|
305
|
+
// This can happen if it comes from a copy FROM/TO
|
306
|
+
auto &list_grandchild = ListType::GetChildType(list_child);
|
307
|
+
auto &children_ref = ListValue::GetChildren(value);
|
308
|
+
if (list_grandchild.id() != LogicalTypeId::VARCHAR || children_ref.size() != 1) {
|
309
|
+
throw BinderException("CSV Reader function option %s requires a non-empty list of possible null "
|
310
|
+
"strings (varchar) as input",
|
311
|
+
loption);
|
312
|
+
}
|
313
|
+
children = &ListValue::GetChildren(children_ref.back());
|
314
|
+
} else if (list_child.id() != LogicalTypeId::VARCHAR) {
|
315
|
+
throw BinderException("CSV Reader function option %s requires a non-empty list of possible null "
|
316
|
+
"strings (varchar) as input",
|
317
|
+
loption);
|
318
|
+
}
|
319
|
+
if (!children) {
|
320
|
+
children = &ListValue::GetChildren(value);
|
321
|
+
}
|
322
|
+
for (auto &child : *children) {
|
323
|
+
if (child.IsNull()) {
|
324
|
+
throw BinderException(
|
325
|
+
"CSV Reader function option %s does not accept NULL values as a valid nullstr option", loption);
|
326
|
+
}
|
327
|
+
null_str.push_back(StringValue::Get(child));
|
328
|
+
}
|
329
|
+
} else {
|
330
|
+
null_str.push_back(StringValue::Get(ParseString(value, loption)));
|
331
|
+
}
|
332
|
+
if (null_str.size() > 1 && write_option) {
|
333
|
+
throw BinderException("CSV Writer function option %s only accepts one nullstr value.", loption);
|
334
|
+
}
|
335
|
+
|
282
336
|
} else if (loption == "encoding") {
|
283
337
|
auto encoding = StringUtil::Lower(ParseString(value, loption));
|
284
338
|
if (encoding != "utf8" && encoding != "utf-8") {
|
@@ -337,7 +391,7 @@ string CSVReaderOptions::ToString() const {
|
|
337
391
|
// sample_size
|
338
392
|
error += "sample_size=" + std::to_string(sample_size_chunks * STANDARD_VECTOR_SIZE) + "\n ";
|
339
393
|
// ignore_errors
|
340
|
-
error += "ignore_errors=" +
|
394
|
+
error += "ignore_errors=" + ignore_errors.FormatValue() + "\n ";
|
341
395
|
// all_varchar
|
342
396
|
error += "all_varchar=" + std::to_string(all_varchar) + "\n";
|
343
397
|
|
@@ -361,9 +415,10 @@ static uint8_t GetCandidateSpecificity(const LogicalType &candidate_type) {
|
|
361
415
|
{(uint8_t)LogicalTypeId::VARCHAR, 0}, {(uint8_t)LogicalTypeId::TIMESTAMP, 1},
|
362
416
|
{(uint8_t)LogicalTypeId::DATE, 2}, {(uint8_t)LogicalTypeId::TIME, 3},
|
363
417
|
{(uint8_t)LogicalTypeId::DOUBLE, 4}, {(uint8_t)LogicalTypeId::FLOAT, 5},
|
364
|
-
{(uint8_t)LogicalTypeId::
|
365
|
-
{(uint8_t)LogicalTypeId::
|
366
|
-
{(uint8_t)LogicalTypeId::
|
418
|
+
{(uint8_t)LogicalTypeId::DECIMAL, 6}, {(uint8_t)LogicalTypeId::BIGINT, 7},
|
419
|
+
{(uint8_t)LogicalTypeId::INTEGER, 8}, {(uint8_t)LogicalTypeId::SMALLINT, 9},
|
420
|
+
{(uint8_t)LogicalTypeId::TINYINT, 10}, {(uint8_t)LogicalTypeId::BOOLEAN, 11},
|
421
|
+
{(uint8_t)LogicalTypeId::SQLNULL, 12}};
|
367
422
|
|
368
423
|
auto id = (uint8_t)candidate_type.id();
|
369
424
|
auto it = auto_type_candidates_specificity.find(id);
|
@@ -373,17 +428,26 @@ static uint8_t GetCandidateSpecificity(const LogicalType &candidate_type) {
|
|
373
428
|
}
|
374
429
|
return it->second;
|
375
430
|
}
|
376
|
-
|
431
|
+
bool StoreUserDefinedParameter(string &option) {
|
432
|
+
if (option == "column_types" || option == "types" || option == "dtypes" || option == "auto_detect" ||
|
433
|
+
option == "auto_type_candidates" || option == "columns" || option == "names") {
|
434
|
+
// We don't store options related to types, names and auto-detection since these are either irrelevant to our
|
435
|
+
// prompt or are covered by the columns option.
|
436
|
+
return false;
|
437
|
+
}
|
438
|
+
return true;
|
439
|
+
}
|
377
440
|
void CSVReaderOptions::FromNamedParameters(named_parameter_map_t &in, ClientContext &context,
|
378
441
|
vector<LogicalType> &return_types, vector<string> &names) {
|
442
|
+
map<string, string> ordered_user_defined_parameters;
|
379
443
|
for (auto &kv : in) {
|
380
444
|
if (MultiFileReader::ParseOption(kv.first, kv.second, file_options, context)) {
|
381
445
|
continue;
|
382
446
|
}
|
383
447
|
auto loption = StringUtil::Lower(kv.first);
|
384
448
|
// skip variables that are specific to auto detection
|
385
|
-
if (loption
|
386
|
-
|
449
|
+
if (StoreUserDefinedParameter(loption)) {
|
450
|
+
ordered_user_defined_parameters[loption] = kv.second.ToSQLString();
|
387
451
|
}
|
388
452
|
if (loption == "columns") {
|
389
453
|
auto &child_type = kv.second.type();
|
@@ -489,6 +553,9 @@ void CSVReaderOptions::FromNamedParameters(named_parameter_map_t &in, ClientCont
|
|
489
553
|
SetReadOption(loption, kv.second, names);
|
490
554
|
}
|
491
555
|
}
|
556
|
+
for (auto &udf_parameter : ordered_user_defined_parameters) {
|
557
|
+
user_defined_parameters += udf_parameter.first + "=" + udf_parameter.second + ", ";
|
558
|
+
}
|
492
559
|
if (user_defined_parameters.size() >= 2) {
|
493
560
|
user_defined_parameters.erase(user_defined_parameters.size() - 2);
|
494
561
|
}
|
@@ -7,16 +7,17 @@
|
|
7
7
|
|
8
8
|
namespace duckdb {
|
9
9
|
|
10
|
-
PhysicalVacuum::PhysicalVacuum(unique_ptr<VacuumInfo> info_p,
|
10
|
+
PhysicalVacuum::PhysicalVacuum(unique_ptr<VacuumInfo> info_p, optional_ptr<TableCatalogEntry> table,
|
11
|
+
unordered_map<idx_t, idx_t> column_id_map, idx_t estimated_cardinality)
|
11
12
|
: PhysicalOperator(PhysicalOperatorType::VACUUM, {LogicalType::BOOLEAN}, estimated_cardinality),
|
12
|
-
info(std::move(info_p)) {
|
13
|
+
info(std::move(info_p)), table(table), column_id_map(std::move(column_id_map)) {
|
13
14
|
}
|
14
15
|
|
15
16
|
class VacuumLocalSinkState : public LocalSinkState {
|
16
17
|
public:
|
17
|
-
explicit VacuumLocalSinkState(VacuumInfo &info) {
|
18
|
+
explicit VacuumLocalSinkState(VacuumInfo &info, optional_ptr<TableCatalogEntry> table) {
|
18
19
|
for (const auto &column_name : info.columns) {
|
19
|
-
auto &column =
|
20
|
+
auto &column = table->GetColumn(column_name);
|
20
21
|
if (DistinctStatistics::TypeIsSupported(column.GetType())) {
|
21
22
|
column_distinct_stats.push_back(make_uniq<DistinctStatistics>());
|
22
23
|
} else {
|
@@ -29,15 +30,14 @@ public:
|
|
29
30
|
};
|
30
31
|
|
31
32
|
unique_ptr<LocalSinkState> PhysicalVacuum::GetLocalSinkState(ExecutionContext &context) const {
|
32
|
-
return make_uniq<VacuumLocalSinkState>(*info);
|
33
|
+
return make_uniq<VacuumLocalSinkState>(*info, table);
|
33
34
|
}
|
34
35
|
|
35
36
|
class VacuumGlobalSinkState : public GlobalSinkState {
|
36
37
|
public:
|
37
|
-
explicit VacuumGlobalSinkState(VacuumInfo &info) {
|
38
|
-
|
38
|
+
explicit VacuumGlobalSinkState(VacuumInfo &info, optional_ptr<TableCatalogEntry> table) {
|
39
39
|
for (const auto &column_name : info.columns) {
|
40
|
-
auto &column =
|
40
|
+
auto &column = table->GetColumn(column_name);
|
41
41
|
if (DistinctStatistics::TypeIsSupported(column.GetType())) {
|
42
42
|
column_distinct_stats.push_back(make_uniq<DistinctStatistics>());
|
43
43
|
} else {
|
@@ -51,12 +51,12 @@ public:
|
|
51
51
|
};
|
52
52
|
|
53
53
|
unique_ptr<GlobalSinkState> PhysicalVacuum::GetGlobalSinkState(ClientContext &context) const {
|
54
|
-
return make_uniq<VacuumGlobalSinkState>(*info);
|
54
|
+
return make_uniq<VacuumGlobalSinkState>(*info, table);
|
55
55
|
}
|
56
56
|
|
57
57
|
SinkResultType PhysicalVacuum::Sink(ExecutionContext &context, DataChunk &chunk, OperatorSinkInput &input) const {
|
58
58
|
auto &lstate = input.local_state.Cast<VacuumLocalSinkState>();
|
59
|
-
D_ASSERT(lstate.column_distinct_stats.size() ==
|
59
|
+
D_ASSERT(lstate.column_distinct_stats.size() == column_id_map.size());
|
60
60
|
|
61
61
|
for (idx_t col_idx = 0; col_idx < chunk.data.size(); col_idx++) {
|
62
62
|
if (!DistinctStatistics::TypeIsSupported(chunk.data[col_idx].GetType())) {
|
@@ -89,10 +89,9 @@ SinkFinalizeType PhysicalVacuum::Finalize(Pipeline &pipeline, Event &event, Clie
|
|
89
89
|
OperatorSinkFinalizeInput &input) const {
|
90
90
|
auto &sink = input.global_state.Cast<VacuumGlobalSinkState>();
|
91
91
|
|
92
|
-
auto
|
92
|
+
auto tbl = table;
|
93
93
|
for (idx_t col_idx = 0; col_idx < sink.column_distinct_stats.size(); col_idx++) {
|
94
|
-
|
95
|
-
std::move(sink.column_distinct_stats[col_idx]));
|
94
|
+
tbl->GetStorage().SetDistinct(column_id_map.at(col_idx), std::move(sink.column_distinct_stats[col_idx]));
|
96
95
|
}
|
97
96
|
|
98
97
|
return SinkFinalizeType::READY;
|
@@ -220,6 +220,7 @@ struct IEJoinUnion {
|
|
220
220
|
DataChunk payload;
|
221
221
|
payload.Initialize(Allocator::DefaultAllocator(), gstate.payload_layout.GetTypes());
|
222
222
|
for (;;) {
|
223
|
+
payload.Reset();
|
223
224
|
scanner.Scan(payload);
|
224
225
|
const auto count = payload.size();
|
225
226
|
if (!count) {
|
@@ -301,6 +302,7 @@ idx_t IEJoinUnion::AppendKey(SortedTable &table, ExpressionExecutor &executor, S
|
|
301
302
|
|
302
303
|
idx_t inserted = 0;
|
303
304
|
for (auto rid = base; table_idx < valid;) {
|
305
|
+
scanned.Reset();
|
304
306
|
scanner.Scan(scanned);
|
305
307
|
|
306
308
|
// NULLs are at the end, so stop when we reach them
|