duckdb 0.10.3-dev0.0 → 0.10.3-dev13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/NodeJS.yml +95 -4
- package/binding.gyp +4 -5
- package/examples/example.js +10 -0
- package/lib/duckdb.js +11 -0
- package/package.json +1 -1
- package/src/database.cpp +3 -3
- package/src/duckdb/extension/icu/icu_extension.cpp +44 -15
- package/src/duckdb/extension/icu/include/icu_extension.hpp +1 -0
- package/src/duckdb/extension/icu/third_party/icu/i18n/basictz.cpp +5 -5
- package/src/duckdb/extension/json/include/json_common.hpp +6 -1
- package/src/duckdb/extension/json/include/json_executors.hpp +5 -5
- package/src/duckdb/extension/json/include/json_extension.hpp +1 -0
- package/src/duckdb/extension/json/include/json_functions.hpp +2 -2
- package/src/duckdb/extension/json/include/json_serializer.hpp +2 -2
- package/src/duckdb/extension/json/json_common.cpp +69 -43
- package/src/duckdb/extension/json/json_extension.cpp +8 -0
- package/src/duckdb/extension/json/json_functions/copy_json.cpp +17 -16
- package/src/duckdb/extension/json/json_functions/json_create.cpp +3 -1
- package/src/duckdb/extension/json/json_functions/json_structure.cpp +18 -13
- package/src/duckdb/extension/json/json_functions/json_transform.cpp +4 -0
- package/src/duckdb/extension/json/json_functions/json_type.cpp +2 -2
- package/src/duckdb/extension/json/json_functions/read_json.cpp +14 -11
- package/src/duckdb/extension/json/json_functions/read_json_objects.cpp +11 -8
- package/src/duckdb/extension/json/json_functions.cpp +4 -3
- package/src/duckdb/extension/json/json_scan.cpp +21 -11
- package/src/duckdb/extension/parquet/column_reader.cpp +9 -5
- package/src/duckdb/extension/parquet/column_writer.cpp +31 -18
- package/src/duckdb/extension/parquet/include/column_writer.hpp +1 -0
- package/src/duckdb/extension/parquet/include/null_column_reader.hpp +54 -0
- package/src/duckdb/extension/parquet/include/parquet_extension.hpp +1 -0
- package/src/duckdb/extension/parquet/include/parquet_reader.hpp +1 -1
- package/src/duckdb/extension/parquet/include/parquet_writer.hpp +7 -2
- package/src/duckdb/extension/parquet/include/templated_column_reader.hpp +6 -1
- package/src/duckdb/extension/parquet/parquet_crypto.cpp +8 -6
- package/src/duckdb/extension/parquet/parquet_extension.cpp +278 -127
- package/src/duckdb/extension/parquet/parquet_metadata.cpp +39 -37
- package/src/duckdb/extension/parquet/parquet_reader.cpp +7 -4
- package/src/duckdb/extension/parquet/parquet_statistics.cpp +5 -4
- package/src/duckdb/extension/parquet/parquet_writer.cpp +55 -2
- package/src/duckdb/extension/parquet/serialize_parquet.cpp +2 -2
- package/src/duckdb/src/catalog/catalog.cpp +19 -39
- package/src/duckdb/src/catalog/catalog_entry/duck_index_entry.cpp +6 -6
- package/src/duckdb/src/catalog/catalog_entry/duck_schema_entry.cpp +47 -31
- package/src/duckdb/src/catalog/catalog_entry/duck_table_entry.cpp +84 -52
- package/src/duckdb/src/catalog/catalog_entry/index_catalog_entry.cpp +4 -2
- package/src/duckdb/src/catalog/catalog_entry/macro_catalog_entry.cpp +4 -0
- package/src/duckdb/src/catalog/catalog_entry/schema_catalog_entry.cpp +7 -0
- package/src/duckdb/src/catalog/catalog_entry/sequence_catalog_entry.cpp +4 -1
- package/src/duckdb/src/catalog/catalog_entry/table_catalog_entry.cpp +36 -15
- package/src/duckdb/src/catalog/catalog_entry/type_catalog_entry.cpp +7 -1
- package/src/duckdb/src/catalog/catalog_entry/view_catalog_entry.cpp +5 -1
- package/src/duckdb/src/catalog/catalog_entry.cpp +7 -0
- package/src/duckdb/src/catalog/catalog_entry_retriever.cpp +64 -0
- package/src/duckdb/src/catalog/catalog_set.cpp +32 -17
- package/src/duckdb/src/catalog/default/default_functions.cpp +2 -1
- package/src/duckdb/src/catalog/default/default_views.cpp +1 -1
- package/src/duckdb/src/catalog/dependency_manager.cpp +133 -9
- package/src/duckdb/src/catalog/duck_catalog.cpp +5 -0
- package/src/duckdb/src/common/adbc/nanoarrow/allocator.cpp +2 -2
- package/src/duckdb/src/common/adbc/nanoarrow/metadata.cpp +3 -3
- package/src/duckdb/src/common/adbc/nanoarrow/schema.cpp +7 -6
- package/src/duckdb/src/common/allocator.cpp +6 -2
- package/src/duckdb/src/common/arrow/appender/bool_data.cpp +1 -0
- package/src/duckdb/src/common/arrow/appender/struct_data.cpp +1 -1
- package/src/duckdb/src/common/arrow/appender/union_data.cpp +2 -1
- package/src/duckdb/src/common/arrow/arrow_appender.cpp +7 -5
- package/src/duckdb/src/common/arrow/arrow_converter.cpp +3 -5
- package/src/duckdb/src/common/arrow/arrow_wrapper.cpp +1 -1
- package/src/duckdb/src/common/box_renderer.cpp +6 -3
- package/src/duckdb/src/common/compressed_file_system.cpp +11 -7
- package/src/duckdb/src/common/enum_util.cpp +259 -17
- package/src/duckdb/src/common/enums/logical_operator_type.cpp +2 -0
- package/src/duckdb/src/common/enums/physical_operator_type.cpp +2 -0
- package/src/duckdb/src/common/enums/relation_type.cpp +2 -0
- package/src/duckdb/src/common/enums/statement_type.cpp +2 -0
- package/src/duckdb/src/common/error_data.cpp +17 -2
- package/src/duckdb/src/common/exception_format_value.cpp +1 -0
- package/src/duckdb/src/common/extra_type_info.cpp +86 -8
- package/src/duckdb/src/common/file_system.cpp +39 -7
- package/src/duckdb/src/common/gzip_file_system.cpp +38 -14
- package/src/duckdb/src/common/hive_partitioning.cpp +28 -76
- package/src/duckdb/src/common/http_state.cpp +4 -4
- package/src/duckdb/src/common/local_file_system.cpp +34 -12
- package/src/duckdb/src/common/multi_file_list.cpp +285 -0
- package/src/duckdb/src/common/multi_file_reader.cpp +115 -80
- package/src/duckdb/src/common/operator/cast_operators.cpp +27 -225
- package/src/duckdb/src/common/operator/string_cast.cpp +13 -14
- package/src/duckdb/src/common/pipe_file_system.cpp +3 -2
- package/src/duckdb/src/common/printer.cpp +1 -1
- package/src/duckdb/src/common/progress_bar/progress_bar.cpp +1 -1
- package/src/duckdb/src/common/random_engine.cpp +2 -1
- package/src/duckdb/src/common/re2_regex.cpp +6 -4
- package/src/duckdb/src/common/row_operations/row_aggregate.cpp +10 -10
- package/src/duckdb/src/common/row_operations/row_external.cpp +4 -3
- package/src/duckdb/src/common/row_operations/row_heap_gather.cpp +5 -3
- package/src/duckdb/src/common/row_operations/row_heap_scatter.cpp +17 -4
- package/src/duckdb/src/common/row_operations/row_radix_scatter.cpp +1 -1
- package/src/duckdb/src/common/serializer/buffered_file_reader.cpp +4 -4
- package/src/duckdb/src/common/serializer/buffered_file_writer.cpp +9 -8
- package/src/duckdb/src/common/serializer/memory_stream.cpp +6 -3
- package/src/duckdb/src/common/serializer/serializer.cpp +1 -1
- package/src/duckdb/src/common/sort/comparators.cpp +1 -1
- package/src/duckdb/src/common/sort/merge_sorter.cpp +2 -2
- package/src/duckdb/src/common/sort/partition_state.cpp +6 -6
- package/src/duckdb/src/common/sort/radix_sort.cpp +1 -1
- package/src/duckdb/src/common/sort/sort_state.cpp +3 -3
- package/src/duckdb/src/common/sort/sorted_block.cpp +5 -5
- package/src/duckdb/src/common/string_util.cpp +70 -163
- package/src/duckdb/src/common/types/bit.cpp +1 -1
- package/src/duckdb/src/common/types/blob.cpp +3 -3
- package/src/duckdb/src/common/types/cast_helpers.cpp +197 -0
- package/src/duckdb/src/common/types/column/column_data_collection.cpp +17 -9
- package/src/duckdb/src/common/types/column/column_data_collection_segment.cpp +1 -1
- package/src/duckdb/src/common/types/column/partitioned_column_data.cpp +13 -5
- package/src/duckdb/src/common/types/conflict_info.cpp +1 -1
- package/src/duckdb/src/common/types/conflict_manager.cpp +1 -1
- package/src/duckdb/src/common/types/data_chunk.cpp +1 -1
- package/src/duckdb/src/common/types/date.cpp +2 -2
- package/src/duckdb/src/common/types/decimal.cpp +12 -12
- package/src/duckdb/src/common/types/hash.cpp +1 -1
- package/src/duckdb/src/common/types/hugeint.cpp +10 -9
- package/src/duckdb/src/common/types/row/partitioned_tuple_data.cpp +4 -4
- package/src/duckdb/src/common/types/row/row_data_collection_scanner.cpp +6 -5
- package/src/duckdb/src/common/types/row/tuple_data_allocator.cpp +21 -18
- package/src/duckdb/src/common/types/row/tuple_data_collection.cpp +2 -2
- package/src/duckdb/src/common/types/row/tuple_data_segment.cpp +7 -0
- package/src/duckdb/src/common/types/string_heap.cpp +4 -0
- package/src/duckdb/src/common/types/timestamp.cpp +23 -1
- package/src/duckdb/src/common/types/uhugeint.cpp +1 -1
- package/src/duckdb/src/common/types/uuid.cpp +7 -6
- package/src/duckdb/src/common/types/value.cpp +54 -30
- package/src/duckdb/src/common/types/vector.cpp +71 -96
- package/src/duckdb/src/common/types/vector_buffer.cpp +4 -0
- package/src/duckdb/src/common/types/vector_cache.cpp +3 -3
- package/src/duckdb/src/common/types.cpp +124 -18
- package/src/duckdb/src/common/vector_operations/generators.cpp +4 -16
- package/src/duckdb/src/common/vector_operations/is_distinct_from.cpp +20 -0
- package/src/duckdb/src/common/vector_operations/null_operations.cpp +1 -1
- package/src/duckdb/src/common/vector_operations/numeric_inplace_operators.cpp +2 -2
- package/src/duckdb/src/core_functions/aggregate/distributive/approx_count.cpp +1 -1
- package/src/duckdb/src/core_functions/aggregate/distributive/arg_min_max.cpp +13 -6
- package/src/duckdb/src/core_functions/aggregate/distributive/bitagg.cpp +8 -5
- package/src/duckdb/src/core_functions/aggregate/distributive/bitstring_agg.cpp +2 -2
- package/src/duckdb/src/core_functions/aggregate/distributive/sum.cpp +2 -2
- package/src/duckdb/src/core_functions/aggregate/holistic/approximate_quantile.cpp +14 -3
- package/src/duckdb/src/core_functions/aggregate/holistic/mode.cpp +2 -2
- package/src/duckdb/src/core_functions/aggregate/holistic/quantile.cpp +19 -8
- package/src/duckdb/src/core_functions/aggregate/holistic/reservoir_quantile.cpp +14 -8
- package/src/duckdb/src/core_functions/function_list.cpp +2 -1
- package/src/duckdb/src/core_functions/lambda_functions.cpp +2 -2
- package/src/duckdb/src/core_functions/scalar/array/array_functions.cpp +5 -0
- package/src/duckdb/src/core_functions/scalar/bit/bitstring.cpp +4 -4
- package/src/duckdb/src/core_functions/scalar/blob/create_sort_key.cpp +3 -2
- package/src/duckdb/src/core_functions/scalar/date/date_part.cpp +2 -2
- package/src/duckdb/src/core_functions/scalar/date/epoch.cpp +17 -0
- package/src/duckdb/src/core_functions/scalar/date/strftime.cpp +1 -1
- package/src/duckdb/src/core_functions/scalar/date/to_interval.cpp +19 -0
- package/src/duckdb/src/core_functions/scalar/debug/vector_type.cpp +6 -5
- package/src/duckdb/src/core_functions/scalar/generic/current_setting.cpp +2 -3
- package/src/duckdb/src/core_functions/scalar/generic/system_functions.cpp +2 -2
- package/src/duckdb/src/core_functions/scalar/list/array_slice.cpp +30 -21
- package/src/duckdb/src/core_functions/scalar/list/list_reduce.cpp +1 -1
- package/src/duckdb/src/core_functions/scalar/list/list_sort.cpp +3 -3
- package/src/duckdb/src/core_functions/scalar/list/list_value.cpp +1 -1
- package/src/duckdb/src/core_functions/scalar/list/range.cpp +2 -2
- package/src/duckdb/src/core_functions/scalar/map/map.cpp +44 -14
- package/src/duckdb/src/core_functions/scalar/map/map_concat.cpp +17 -4
- package/src/duckdb/src/core_functions/scalar/map/map_entries.cpp +30 -13
- package/src/duckdb/src/core_functions/scalar/map/map_extract.cpp +25 -12
- package/src/duckdb/src/core_functions/scalar/map/map_keys_values.cpp +16 -4
- package/src/duckdb/src/core_functions/scalar/math/numeric.cpp +2 -2
- package/src/duckdb/src/core_functions/scalar/operators/bitwise.cpp +2 -2
- package/src/duckdb/src/core_functions/scalar/random/setseed.cpp +1 -1
- package/src/duckdb/src/core_functions/scalar/string/bar.cpp +1 -1
- package/src/duckdb/src/core_functions/scalar/string/chr.cpp +2 -2
- package/src/duckdb/src/core_functions/scalar/string/hex.cpp +13 -13
- package/src/duckdb/src/core_functions/scalar/string/instr.cpp +1 -1
- package/src/duckdb/src/core_functions/scalar/string/pad.cpp +8 -8
- package/src/duckdb/src/core_functions/scalar/string/repeat.cpp +15 -7
- package/src/duckdb/src/core_functions/scalar/string/string_split.cpp +1 -1
- package/src/duckdb/src/core_functions/scalar/string/to_base.cpp +1 -1
- package/src/duckdb/src/core_functions/scalar/string/translate.cpp +4 -4
- package/src/duckdb/src/core_functions/scalar/string/trim.cpp +13 -9
- package/src/duckdb/src/core_functions/scalar/string/unicode.cpp +1 -1
- package/src/duckdb/src/execution/adaptive_filter.cpp +1 -1
- package/src/duckdb/src/execution/aggregate_hashtable.cpp +17 -8
- package/src/duckdb/src/execution/index/art/art.cpp +6 -6
- package/src/duckdb/src/execution/index/bound_index.cpp +115 -0
- package/src/duckdb/src/execution/index/unbound_index.cpp +30 -0
- package/src/duckdb/src/execution/join_hashtable.cpp +2 -1
- package/src/duckdb/src/execution/operator/aggregate/aggregate_object.cpp +1 -1
- package/src/duckdb/src/execution/operator/aggregate/distinct_aggregate_data.cpp +1 -1
- package/src/duckdb/src/execution/operator/aggregate/physical_hash_aggregate.cpp +3 -3
- package/src/duckdb/src/execution/operator/aggregate/physical_streaming_window.cpp +40 -5
- package/src/duckdb/src/execution/operator/aggregate/physical_ungrouped_aggregate.cpp +2 -2
- package/src/duckdb/src/execution/operator/aggregate/physical_window.cpp +16 -3
- package/src/duckdb/src/execution/operator/csv_scanner/buffer_manager/csv_buffer.cpp +4 -4
- package/src/duckdb/src/execution/operator/csv_scanner/buffer_manager/csv_buffer_manager.cpp +2 -12
- package/src/duckdb/src/execution/operator/csv_scanner/buffer_manager/csv_file_handle.cpp +2 -1
- package/src/duckdb/src/execution/operator/csv_scanner/scanner/base_scanner.cpp +21 -5
- package/src/duckdb/src/execution/operator/csv_scanner/scanner/column_count_scanner.cpp +1 -1
- package/src/duckdb/src/execution/operator/csv_scanner/scanner/string_value_scanner.cpp +312 -260
- package/src/duckdb/src/execution/operator/csv_scanner/sniffer/csv_sniffer.cpp +2 -2
- package/src/duckdb/src/execution/operator/csv_scanner/sniffer/dialect_detection.cpp +45 -16
- package/src/duckdb/src/execution/operator/csv_scanner/sniffer/header_detection.cpp +19 -18
- package/src/duckdb/src/execution/operator/csv_scanner/sniffer/type_detection.cpp +200 -55
- package/src/duckdb/src/execution/operator/csv_scanner/table_function/csv_file_scanner.cpp +26 -23
- package/src/duckdb/src/execution/operator/csv_scanner/table_function/global_csv_state.cpp +12 -12
- package/src/duckdb/src/execution/operator/csv_scanner/util/csv_error.cpp +7 -7
- package/src/duckdb/src/execution/operator/csv_scanner/util/csv_reader_options.cpp +31 -22
- package/src/duckdb/src/execution/operator/helper/physical_buffered_collector.cpp +1 -1
- package/src/duckdb/src/execution/operator/helper/physical_execute.cpp +1 -1
- package/src/duckdb/src/execution/operator/helper/physical_load.cpp +24 -2
- package/src/duckdb/src/execution/operator/helper/physical_reservoir_sample.cpp +1 -1
- package/src/duckdb/src/execution/operator/helper/physical_update_extensions.cpp +57 -0
- package/src/duckdb/src/execution/operator/helper/physical_verify_vector.cpp +13 -8
- package/src/duckdb/src/execution/operator/join/physical_asof_join.cpp +2 -2
- package/src/duckdb/src/execution/operator/join/physical_hash_join.cpp +9 -9
- package/src/duckdb/src/execution/operator/join/physical_iejoin.cpp +4 -4
- package/src/duckdb/src/execution/operator/join/physical_left_delim_join.cpp +1 -1
- package/src/duckdb/src/execution/operator/join/physical_piecewise_merge_join.cpp +2 -2
- package/src/duckdb/src/execution/operator/join/physical_range_join.cpp +2 -2
- package/src/duckdb/src/execution/operator/order/physical_order.cpp +3 -2
- package/src/duckdb/src/execution/operator/persistent/physical_batch_copy_to_file.cpp +4 -4
- package/src/duckdb/src/execution/operator/persistent/physical_batch_insert.cpp +20 -13
- package/src/duckdb/src/execution/operator/persistent/physical_copy_database.cpp +3 -1
- package/src/duckdb/src/execution/operator/persistent/physical_copy_to_file.cpp +73 -60
- package/src/duckdb/src/execution/operator/persistent/physical_delete.cpp +18 -7
- package/src/duckdb/src/execution/operator/persistent/physical_export.cpp +88 -12
- package/src/duckdb/src/execution/operator/persistent/physical_insert.cpp +47 -27
- package/src/duckdb/src/execution/operator/persistent/physical_update.cpp +34 -9
- package/src/duckdb/src/execution/operator/projection/physical_unnest.cpp +3 -0
- package/src/duckdb/src/execution/operator/scan/physical_column_data_scan.cpp +2 -3
- package/src/duckdb/src/execution/operator/scan/physical_expression_scan.cpp +22 -7
- package/src/duckdb/src/execution/operator/schema/physical_attach.cpp +1 -1
- package/src/duckdb/src/execution/operator/schema/physical_create_art_index.cpp +9 -9
- package/src/duckdb/src/execution/operator/set/physical_recursive_cte.cpp +1 -1
- package/src/duckdb/src/execution/perfect_aggregate_hashtable.cpp +5 -4
- package/src/duckdb/src/execution/physical_operator.cpp +2 -2
- package/src/duckdb/src/execution/physical_plan/plan_column_data_get.cpp +2 -4
- package/src/duckdb/src/execution/physical_plan/plan_comparison_join.cpp +1 -1
- package/src/duckdb/src/execution/physical_plan/plan_copy_to_file.cpp +2 -2
- package/src/duckdb/src/execution/physical_plan/plan_create_table.cpp +2 -2
- package/src/duckdb/src/execution/physical_plan/plan_cte.cpp +1 -1
- package/src/duckdb/src/execution/physical_plan/plan_delete.cpp +2 -2
- package/src/duckdb/src/execution/physical_plan/plan_delim_get.cpp +2 -2
- package/src/duckdb/src/execution/physical_plan/plan_distinct.cpp +1 -0
- package/src/duckdb/src/execution/physical_plan/plan_expression_get.cpp +4 -5
- package/src/duckdb/src/execution/physical_plan/plan_insert.cpp +6 -5
- package/src/duckdb/src/execution/physical_plan/plan_recursive_cte.cpp +1 -1
- package/src/duckdb/src/execution/physical_plan/plan_simple.cpp +4 -0
- package/src/duckdb/src/execution/physical_plan/plan_top_n.cpp +2 -2
- package/src/duckdb/src/execution/physical_plan/plan_update.cpp +3 -3
- package/src/duckdb/src/execution/physical_plan/plan_window.cpp +1 -24
- package/src/duckdb/src/execution/physical_plan_generator.cpp +3 -0
- package/src/duckdb/src/execution/radix_partitioned_hashtable.cpp +38 -33
- package/src/duckdb/src/execution/reservoir_sample.cpp +42 -31
- package/src/duckdb/src/execution/window_executor.cpp +39 -39
- package/src/duckdb/src/execution/window_segment_tree.cpp +5 -2
- package/src/duckdb/src/function/aggregate/distributive/first.cpp +1 -1
- package/src/duckdb/src/function/cast/string_cast.cpp +3 -3
- package/src/duckdb/src/function/cast_rules.cpp +1 -0
- package/src/duckdb/src/function/function.cpp +2 -2
- package/src/duckdb/src/function/function_binder.cpp +9 -4
- package/src/duckdb/src/function/pragma/pragma_functions.cpp +2 -1
- package/src/duckdb/src/function/pragma/pragma_queries.cpp +4 -3
- package/src/duckdb/src/function/scalar/compressed_materialization/compress_string.cpp +1 -1
- package/src/duckdb/src/function/scalar/list/list_extract.cpp +3 -2
- package/src/duckdb/src/function/scalar/list/list_resize.cpp +1 -1
- package/src/duckdb/src/function/scalar/list/list_select.cpp +11 -4
- package/src/duckdb/src/function/scalar/list/list_zip.cpp +3 -1
- package/src/duckdb/src/function/scalar/operators/add.cpp +19 -9
- package/src/duckdb/src/function/scalar/sequence/nextval.cpp +77 -48
- package/src/duckdb/src/function/scalar/strftime_format.cpp +61 -39
- package/src/duckdb/src/function/scalar/string/caseconvert.cpp +12 -12
- package/src/duckdb/src/function/scalar/string/contains.cpp +2 -2
- package/src/duckdb/src/function/scalar/string/length.cpp +9 -9
- package/src/duckdb/src/function/scalar/string/regexp/regexp_extract_all.cpp +2 -2
- package/src/duckdb/src/function/scalar/string/strip_accents.cpp +2 -1
- package/src/duckdb/src/function/scalar/string/substring.cpp +11 -9
- package/src/duckdb/src/function/scalar/struct/struct_extract.cpp +2 -2
- package/src/duckdb/src/function/scalar_function.cpp +2 -1
- package/src/duckdb/src/function/table/arrow.cpp +18 -4
- package/src/duckdb/src/function/table/arrow_conversion.cpp +88 -66
- package/src/duckdb/src/function/table/copy_csv.cpp +94 -28
- package/src/duckdb/src/function/table/glob.cpp +17 -9
- package/src/duckdb/src/function/table/read_csv.cpp +37 -14
- package/src/duckdb/src/function/table/read_file.cpp +6 -2
- package/src/duckdb/src/function/table/repeat.cpp +5 -1
- package/src/duckdb/src/function/table/repeat_row.cpp +1 -1
- package/src/duckdb/src/function/table/sniff_csv.cpp +9 -3
- package/src/duckdb/src/function/table/system/duckdb_columns.cpp +3 -3
- package/src/duckdb/src/function/table/system/duckdb_constraints.cpp +31 -16
- package/src/duckdb/src/function/table/system/duckdb_databases.cpp +6 -1
- package/src/duckdb/src/function/table/system/duckdb_dependencies.cpp +2 -2
- package/src/duckdb/src/function/table/system/duckdb_extensions.cpp +50 -9
- package/src/duckdb/src/function/table/system/duckdb_functions.cpp +8 -2
- package/src/duckdb/src/function/table/system/duckdb_indexes.cpp +9 -4
- package/src/duckdb/src/function/table/system/duckdb_memory.cpp +2 -2
- package/src/duckdb/src/function/table/system/duckdb_schemas.cpp +7 -2
- package/src/duckdb/src/function/table/system/duckdb_sequences.cpp +8 -3
- package/src/duckdb/src/function/table/system/duckdb_tables.cpp +18 -10
- package/src/duckdb/src/function/table/system/duckdb_temporary_files.cpp +1 -1
- package/src/duckdb/src/function/table/system/duckdb_types.cpp +12 -5
- package/src/duckdb/src/function/table/system/duckdb_views.cpp +9 -4
- package/src/duckdb/src/function/table/system/duckdb_which_secret.cpp +75 -0
- package/src/duckdb/src/function/table/system/pragma_database_size.cpp +4 -4
- package/src/duckdb/src/function/table/system/pragma_metadata_info.cpp +3 -3
- package/src/duckdb/src/function/table/system/pragma_storage_info.cpp +6 -6
- package/src/duckdb/src/function/table/system_functions.cpp +1 -0
- package/src/duckdb/src/function/table/table_scan.cpp +11 -20
- package/src/duckdb/src/function/table/unnest.cpp +1 -1
- package/src/duckdb/src/function/table/version/pragma_version.cpp +5 -5
- package/src/duckdb/src/function/table_function.cpp +5 -4
- package/src/duckdb/src/include/duckdb/catalog/catalog.hpp +1 -10
- 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 +2 -2
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/duck_table_entry.hpp +6 -8
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/function_entry.hpp +1 -0
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/schema_catalog_entry.hpp +3 -2
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/sequence_catalog_entry.hpp +2 -5
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/table_catalog_entry.hpp +3 -4
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/type_catalog_entry.hpp +2 -0
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry.hpp +4 -0
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry_retriever.hpp +72 -0
- package/src/duckdb/src/include/duckdb/catalog/catalog_transaction.hpp +3 -0
- package/src/duckdb/src/include/duckdb/catalog/dependency.hpp +4 -0
- package/src/duckdb/src/include/duckdb/catalog/dependency_list.hpp +7 -1
- package/src/duckdb/src/include/duckdb/catalog/dependency_manager.hpp +2 -2
- package/src/duckdb/src/include/duckdb/catalog/standard_entry.hpp +2 -0
- package/src/duckdb/src/include/duckdb/common/arrow/appender/append_data.hpp +1 -0
- package/src/duckdb/src/include/duckdb/common/arrow/appender/enum_data.hpp +3 -3
- package/src/duckdb/src/include/duckdb/common/arrow/appender/map_data.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/arrow/appender/scalar_data.hpp +15 -0
- package/src/duckdb/src/include/duckdb/common/arrow/appender/varchar_data.hpp +3 -2
- package/src/duckdb/src/include/duckdb/common/bit_utils.hpp +63 -98
- package/src/duckdb/src/include/duckdb/common/bitpacking.hpp +4 -4
- package/src/duckdb/src/include/duckdb/common/constants.hpp +2 -0
- package/src/duckdb/src/include/duckdb/common/enable_shared_from_this_ipp.hpp +42 -0
- package/src/duckdb/src/include/duckdb/common/enum_util.hpp +51 -3
- package/src/duckdb/src/include/duckdb/common/enums/checkpoint_type.hpp +38 -0
- package/src/duckdb/src/include/duckdb/common/enums/copy_overwrite_mode.hpp +18 -0
- package/src/duckdb/src/include/duckdb/common/enums/logical_operator_type.hpp +1 -0
- package/src/duckdb/src/include/duckdb/common/enums/physical_operator_type.hpp +1 -0
- package/src/duckdb/src/include/duckdb/common/enums/relation_type.hpp +1 -0
- package/src/duckdb/src/include/duckdb/common/enums/scan_options.hpp +3 -1
- package/src/duckdb/src/include/duckdb/common/enums/scan_vector_type.hpp +17 -0
- package/src/duckdb/src/include/duckdb/common/enums/statement_type.hpp +1 -0
- package/src/duckdb/src/include/duckdb/common/enums/tableref_type.hpp +2 -1
- package/src/duckdb/src/include/duckdb/common/enums/undo_flags.hpp +2 -1
- package/src/duckdb/src/include/duckdb/common/exception.hpp +0 -1
- package/src/duckdb/src/include/duckdb/common/extra_type_info.hpp +15 -1
- package/src/duckdb/src/include/duckdb/common/file_opener.hpp +4 -0
- package/src/duckdb/src/include/duckdb/common/file_system.hpp +3 -0
- package/src/duckdb/src/include/duckdb/common/gzip_file_system.hpp +3 -0
- package/src/duckdb/src/include/duckdb/common/helper.hpp +22 -1
- package/src/duckdb/src/include/duckdb/common/hive_partitioning.hpp +3 -17
- package/src/duckdb/src/include/duckdb/common/http_state.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/insertion_order_preserving_map.hpp +129 -0
- package/src/duckdb/src/include/duckdb/common/multi_file_list.hpp +151 -0
- package/src/duckdb/src/include/duckdb/common/multi_file_reader.hpp +133 -56
- package/src/duckdb/src/include/duckdb/common/multi_file_reader_options.hpp +7 -3
- package/src/duckdb/src/include/duckdb/common/numeric_utils.hpp +3 -0
- package/src/duckdb/src/include/duckdb/common/operator/add.hpp +2 -0
- package/src/duckdb/src/include/duckdb/common/operator/decimal_cast_operators.hpp +233 -0
- package/src/duckdb/src/include/duckdb/common/operator/integer_cast_operator.hpp +5 -4
- package/src/duckdb/src/include/duckdb/common/operator/numeric_cast.hpp +2 -2
- package/src/duckdb/src/include/duckdb/common/optional_ptr.hpp +5 -0
- package/src/duckdb/src/include/duckdb/common/optionally_owned_ptr.hpp +91 -0
- package/src/duckdb/src/include/duckdb/common/platform.h +6 -1
- package/src/duckdb/src/include/duckdb/common/radix.hpp +12 -4
- package/src/duckdb/src/include/duckdb/common/re2_regex.hpp +3 -2
- package/src/duckdb/src/include/duckdb/common/row_operations/row_operations.hpp +2 -0
- package/src/duckdb/src/include/duckdb/common/serializer/binary_deserializer.hpp +2 -1
- package/src/duckdb/src/include/duckdb/common/serializer/binary_serializer.hpp +8 -6
- package/src/duckdb/src/include/duckdb/common/serializer/deserializer.hpp +36 -0
- package/src/duckdb/src/include/duckdb/common/serializer/serialization_traits.hpp +65 -0
- package/src/duckdb/src/include/duckdb/common/serializer/serializer.hpp +52 -6
- package/src/duckdb/src/include/duckdb/common/shared_ptr.hpp +36 -3
- package/src/duckdb/src/include/duckdb/common/shared_ptr_ipp.hpp +268 -0
- package/src/duckdb/src/include/duckdb/common/sort/duckdb_pdqsort.hpp +3 -3
- package/src/duckdb/src/include/duckdb/common/string.hpp +3 -2
- package/src/duckdb/src/include/duckdb/common/string_util.hpp +11 -7
- package/src/duckdb/src/include/duckdb/common/types/bit.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/types/cast_helpers.hpp +43 -215
- package/src/duckdb/src/include/duckdb/common/types/datetime.hpp +36 -11
- package/src/duckdb/src/include/duckdb/common/types/hash.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/types/row/tuple_data_segment.hpp +7 -1
- package/src/duckdb/src/include/duckdb/common/types/selection_vector.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/types/string_type.hpp +2 -0
- package/src/duckdb/src/include/duckdb/common/types/timestamp.hpp +2 -0
- package/src/duckdb/src/include/duckdb/common/types/validity_mask.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/types/value.hpp +4 -0
- package/src/duckdb/src/include/duckdb/common/types/vector.hpp +20 -15
- package/src/duckdb/src/include/duckdb/common/types.hpp +14 -2
- package/src/duckdb/src/include/duckdb/common/unique_ptr.hpp +7 -6
- package/src/duckdb/src/include/duckdb/common/vector.hpp +11 -0
- package/src/duckdb/src/include/duckdb/common/vector_size.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/weak_ptr_ipp.hpp +117 -0
- package/src/duckdb/src/include/duckdb/core_functions/aggregate/sum_helpers.hpp +3 -3
- package/src/duckdb/src/include/duckdb/core_functions/scalar/date_functions.hpp +18 -0
- package/src/duckdb/src/include/duckdb/execution/adaptive_filter.hpp +1 -0
- package/src/duckdb/src/include/duckdb/execution/expression_executor.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/index/art/art.hpp +4 -4
- package/src/duckdb/src/include/duckdb/execution/index/art/node.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/index/bound_index.hpp +145 -0
- package/src/duckdb/src/include/duckdb/execution/index/index_type.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/index/unbound_index.hpp +63 -0
- package/src/duckdb/src/include/duckdb/execution/merge_sort_tree.hpp +24 -18
- package/src/duckdb/src/include/duckdb/execution/operator/aggregate/physical_streaming_window.hpp +2 -0
- package/src/duckdb/src/include/duckdb/execution/operator/aggregate/physical_window.hpp +2 -0
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/base_scanner.hpp +10 -3
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/column_count_scanner.hpp +1 -0
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_error.hpp +6 -6
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_reader_options.hpp +7 -6
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_sniffer.hpp +24 -4
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/string_value_scanner.hpp +90 -20
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_update_extensions.hpp +52 -0
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_batch_insert.hpp +3 -1
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_copy_to_file.hpp +2 -1
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_delete.hpp +5 -5
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_export.hpp +1 -0
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_insert.hpp +8 -5
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_update.hpp +4 -1
- package/src/duckdb/src/include/duckdb/execution/operator/scan/physical_column_data_scan.hpp +4 -5
- package/src/duckdb/src/include/duckdb/execution/operator/scan/physical_expression_scan.hpp +6 -2
- package/src/duckdb/src/include/duckdb/execution/operator/set/physical_cte.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/set/physical_recursive_cte.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/physical_plan_generator.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/reservoir_sample.hpp +63 -8
- package/src/duckdb/src/include/duckdb/function/function.hpp +0 -5
- package/src/duckdb/src/include/duckdb/function/function_binder.hpp +6 -3
- package/src/duckdb/src/include/duckdb/function/replacement_scan.hpp +25 -2
- package/src/duckdb/src/include/duckdb/function/scalar/regexp.hpp +1 -1
- package/src/duckdb/src/include/duckdb/function/scalar/sequence_functions.hpp +3 -4
- package/src/duckdb/src/include/duckdb/function/scalar/strftime_format.hpp +5 -0
- package/src/duckdb/src/include/duckdb/function/scalar/string_functions.hpp +1 -1
- package/src/duckdb/src/include/duckdb/function/scalar_function.hpp +13 -0
- package/src/duckdb/src/include/duckdb/function/table/arrow.hpp +7 -3
- package/src/duckdb/src/include/duckdb/function/table/read_csv.hpp +3 -0
- package/src/duckdb/src/include/duckdb/function/table/system_functions.hpp +4 -0
- package/src/duckdb/src/include/duckdb/function/table_function.hpp +15 -2
- package/src/duckdb/src/include/duckdb/logging/http_logger.hpp +81 -0
- package/src/duckdb/src/include/duckdb/main/appender.hpp +1 -3
- package/src/duckdb/src/include/duckdb/main/attached_database.hpp +7 -1
- package/src/duckdb/src/include/duckdb/main/buffered_data/buffered_data.hpp +1 -0
- package/src/duckdb/src/include/duckdb/main/capi/cast/generic.hpp +2 -2
- package/src/duckdb/src/include/duckdb/main/client_config.hpp +8 -0
- package/src/duckdb/src/include/duckdb/main/client_context.hpp +1 -19
- package/src/duckdb/src/include/duckdb/main/client_context_state.hpp +11 -1
- package/src/duckdb/src/include/duckdb/main/client_context_wrapper.hpp +27 -0
- package/src/duckdb/src/include/duckdb/main/client_data.hpp +4 -0
- package/src/duckdb/src/include/duckdb/main/config.hpp +40 -3
- package/src/duckdb/src/include/duckdb/main/connection_manager.hpp +7 -17
- package/src/duckdb/src/include/duckdb/main/database.hpp +25 -20
- package/src/duckdb/src/include/duckdb/main/extension.hpp +25 -0
- package/src/duckdb/src/include/duckdb/main/extension_entries.hpp +155 -10
- package/src/duckdb/src/include/duckdb/main/extension_helper.hpp +79 -12
- package/src/duckdb/src/include/duckdb/main/extension_install_info.hpp +89 -0
- package/src/duckdb/src/include/duckdb/main/extension_util.hpp +3 -1
- package/src/duckdb/src/include/duckdb/main/external_dependencies.hpp +46 -4
- package/src/duckdb/src/include/duckdb/main/materialized_query_result.hpp +3 -0
- package/src/duckdb/src/include/duckdb/main/relation/materialized_relation.hpp +35 -0
- package/src/duckdb/src/include/duckdb/main/relation/query_relation.hpp +1 -1
- package/src/duckdb/src/include/duckdb/main/relation/table_function_relation.hpp +2 -2
- package/src/duckdb/src/include/duckdb/main/relation/table_relation.hpp +1 -1
- package/src/duckdb/src/include/duckdb/main/relation/value_relation.hpp +3 -3
- package/src/duckdb/src/include/duckdb/main/relation/view_relation.hpp +1 -1
- package/src/duckdb/src/include/duckdb/main/relation.hpp +5 -6
- package/src/duckdb/src/include/duckdb/main/settings.hpp +67 -0
- package/src/duckdb/src/include/duckdb/optimizer/filter_pushdown.hpp +4 -4
- 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 +8 -15
- package/src/duckdb/src/include/duckdb/optimizer/join_order/join_order_optimizer.hpp +0 -51
- package/src/duckdb/src/include/duckdb/optimizer/join_order/plan_enumerator.hpp +10 -17
- package/src/duckdb/src/include/duckdb/optimizer/join_order/query_graph_manager.hpp +5 -7
- package/src/duckdb/src/include/duckdb/optimizer/matcher/set_matcher.hpp +2 -1
- package/src/duckdb/src/include/duckdb/optimizer/optimizer_extension.hpp +10 -2
- package/src/duckdb/src/include/duckdb/optimizer/rule/list.hpp +1 -0
- package/src/duckdb/src/include/duckdb/optimizer/rule/timestamp_comparison.hpp +30 -0
- package/src/duckdb/src/include/duckdb/parallel/event.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parallel/interrupt.hpp +1 -0
- package/src/duckdb/src/include/duckdb/parallel/meta_pipeline.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parallel/pipeline.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parallel/task.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/base_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/column_definition.hpp +2 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/alter_info.hpp +1 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/alter_scalar_function_info.hpp +1 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/alter_table_function_info.hpp +1 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/alter_table_info.hpp +12 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/attach_info.hpp +1 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/comment_on_column_info.hpp +3 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/copy_info.hpp +10 -12
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_info.hpp +6 -2
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_schema_info.hpp +3 -30
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_sequence_info.hpp +2 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_type_info.hpp +12 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_view_info.hpp +1 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/detach_info.hpp +1 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/drop_info.hpp +1 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/exported_table_data.hpp +5 -2
- package/src/duckdb/src/include/duckdb/parser/parsed_data/load_info.hpp +4 -7
- package/src/duckdb/src/include/duckdb/parser/parsed_data/parse_info.hpp +7 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/pragma_info.hpp +2 -11
- package/src/duckdb/src/include/duckdb/parser/parsed_data/transaction_info.hpp +2 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/update_extensions_info.hpp +36 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/vacuum_info.hpp +1 -0
- package/src/duckdb/src/include/duckdb/parser/parser_extension.hpp +1 -0
- package/src/duckdb/src/include/duckdb/parser/query_node.hpp +2 -2
- package/src/duckdb/src/include/duckdb/parser/sql_statement.hpp +1 -4
- package/src/duckdb/src/include/duckdb/parser/statement/alter_statement.hpp +1 -0
- package/src/duckdb/src/include/duckdb/parser/statement/attach_statement.hpp +1 -0
- package/src/duckdb/src/include/duckdb/parser/statement/call_statement.hpp +1 -0
- package/src/duckdb/src/include/duckdb/parser/statement/copy_database_statement.hpp +1 -2
- package/src/duckdb/src/include/duckdb/parser/statement/copy_statement.hpp +1 -3
- package/src/duckdb/src/include/duckdb/parser/statement/detach_statement.hpp +1 -0
- package/src/duckdb/src/include/duckdb/parser/statement/drop_statement.hpp +1 -0
- package/src/duckdb/src/include/duckdb/parser/statement/execute_statement.hpp +1 -0
- package/src/duckdb/src/include/duckdb/parser/statement/explain_statement.hpp +1 -0
- package/src/duckdb/src/include/duckdb/parser/statement/export_statement.hpp +1 -0
- package/src/duckdb/src/include/duckdb/parser/statement/extension_statement.hpp +1 -0
- package/src/duckdb/src/include/duckdb/parser/statement/insert_statement.hpp +1 -0
- package/src/duckdb/src/include/duckdb/parser/statement/list.hpp +1 -0
- package/src/duckdb/src/include/duckdb/parser/statement/load_statement.hpp +1 -0
- package/src/duckdb/src/include/duckdb/parser/statement/logical_plan_statement.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/statement/multi_statement.hpp +1 -0
- package/src/duckdb/src/include/duckdb/parser/statement/pragma_statement.hpp +1 -0
- package/src/duckdb/src/include/duckdb/parser/statement/prepare_statement.hpp +1 -0
- package/src/duckdb/src/include/duckdb/parser/statement/relation_statement.hpp +1 -0
- package/src/duckdb/src/include/duckdb/parser/statement/select_statement.hpp +1 -0
- package/src/duckdb/src/include/duckdb/parser/statement/set_statement.hpp +6 -4
- package/src/duckdb/src/include/duckdb/parser/statement/transaction_statement.hpp +1 -0
- package/src/duckdb/src/include/duckdb/parser/statement/update_extensions_statement.hpp +36 -0
- package/src/duckdb/src/include/duckdb/parser/statement/vacuum_statement.hpp +1 -0
- package/src/duckdb/src/include/duckdb/parser/tableref/column_data_ref.hpp +46 -0
- package/src/duckdb/src/include/duckdb/parser/tableref/list.hpp +1 -0
- package/src/duckdb/src/include/duckdb/parser/tableref/table_function_ref.hpp +0 -4
- package/src/duckdb/src/include/duckdb/parser/tableref.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/tokens.hpp +2 -0
- package/src/duckdb/src/include/duckdb/parser/transformer.hpp +5 -0
- package/src/duckdb/src/include/duckdb/planner/bind_context.hpp +4 -4
- package/src/duckdb/src/include/duckdb/planner/binder.hpp +42 -16
- package/src/duckdb/src/include/duckdb/planner/bound_tokens.hpp +1 -0
- package/src/duckdb/src/include/duckdb/planner/expression_binder/alter_binder.hpp +7 -6
- package/src/duckdb/src/include/duckdb/planner/expression_binder/having_binder.hpp +2 -1
- package/src/duckdb/src/include/duckdb/planner/expression_binder/index_binder.hpp +5 -1
- package/src/duckdb/src/include/duckdb/planner/expression_binder.hpp +5 -0
- package/src/duckdb/src/include/duckdb/planner/logical_operator.hpp +0 -1
- package/src/duckdb/src/include/duckdb/planner/operator/logical_column_data_get.hpp +6 -2
- package/src/duckdb/src/include/duckdb/planner/operator/logical_comparison_join.hpp +7 -7
- package/src/duckdb/src/include/duckdb/planner/operator/logical_copy_to_file.hpp +2 -1
- package/src/duckdb/src/include/duckdb/planner/operator/logical_delete.hpp +2 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_export.hpp +7 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_insert.hpp +2 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_top_n.hpp +3 -3
- package/src/duckdb/src/include/duckdb/planner/operator/logical_update.hpp +2 -0
- package/src/duckdb/src/include/duckdb/planner/parsed_data/bound_create_table_info.hpp +0 -4
- package/src/duckdb/src/include/duckdb/planner/table_binding.hpp +4 -4
- package/src/duckdb/src/include/duckdb/planner/tableref/bound_column_data_ref.hpp +30 -0
- package/src/duckdb/src/include/duckdb/planner/tableref/list.hpp +1 -0
- package/src/duckdb/src/include/duckdb/storage/buffer/block_handle.hpp +6 -3
- package/src/duckdb/src/include/duckdb/storage/buffer/buffer_pool.hpp +16 -7
- package/src/duckdb/src/include/duckdb/storage/buffer_manager.hpp +15 -3
- package/src/duckdb/src/include/duckdb/storage/checkpoint/row_group_writer.hpp +10 -7
- package/src/duckdb/src/include/duckdb/storage/checkpoint/table_data_writer.hpp +2 -0
- package/src/duckdb/src/include/duckdb/storage/checkpoint_manager.hpp +24 -15
- package/src/duckdb/src/include/duckdb/storage/compression/alp/algorithm/alp.hpp +8 -7
- package/src/duckdb/src/include/duckdb/storage/compression/alp/alp_compress.hpp +2 -2
- package/src/duckdb/src/include/duckdb/storage/compression/alp/alp_constants.hpp +5 -4
- package/src/duckdb/src/include/duckdb/storage/compression/alp/alp_fetch.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/compression/alp/alp_utils.hpp +3 -3
- package/src/duckdb/src/include/duckdb/storage/compression/alprd/algorithm/alprd.hpp +2 -1
- package/src/duckdb/src/include/duckdb/storage/compression/alprd/alprd_analyze.hpp +5 -3
- package/src/duckdb/src/include/duckdb/storage/compression/alprd/alprd_compress.hpp +2 -2
- package/src/duckdb/src/include/duckdb/storage/compression/alprd/alprd_fetch.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/compression/chimp/algorithm/bit_reader.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/compression/chimp/chimp_fetch.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/compression/patas/patas_fetch.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/data_table.hpp +55 -16
- package/src/duckdb/src/include/duckdb/storage/index.hpp +33 -97
- 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 +3 -3
- package/src/duckdb/src/include/duckdb/storage/standard_buffer_manager.hpp +22 -9
- package/src/duckdb/src/include/duckdb/storage/storage_extension.hpp +7 -0
- package/src/duckdb/src/include/duckdb/storage/storage_info.hpp +6 -3
- package/src/duckdb/src/include/duckdb/storage/storage_lock.hpp +17 -13
- package/src/duckdb/src/include/duckdb/storage/storage_manager.hpp +27 -8
- package/src/duckdb/src/include/duckdb/storage/string_uncompressed.hpp +3 -2
- package/src/duckdb/src/include/duckdb/storage/table/append_state.hpp +12 -0
- package/src/duckdb/src/include/duckdb/storage/table/array_column_data.hpp +5 -4
- package/src/duckdb/src/include/duckdb/storage/table/column_data.hpp +29 -10
- package/src/duckdb/src/include/duckdb/storage/table/column_segment.hpp +2 -1
- package/src/duckdb/src/include/duckdb/storage/table/data_table_info.hpp +32 -6
- package/src/duckdb/src/include/duckdb/storage/table/delete_state.hpp +23 -0
- package/src/duckdb/src/include/duckdb/storage/table/list_column_data.hpp +5 -4
- package/src/duckdb/src/include/duckdb/storage/table/row_group.hpp +14 -3
- package/src/duckdb/src/include/duckdb/storage/table/row_group_collection.hpp +3 -2
- package/src/duckdb/src/include/duckdb/storage/table/scan_state.hpp +4 -0
- package/src/duckdb/src/include/duckdb/storage/table/segment_tree.hpp +5 -5
- package/src/duckdb/src/include/duckdb/storage/table/standard_column_data.hpp +6 -6
- package/src/duckdb/src/include/duckdb/storage/table/struct_column_data.hpp +5 -4
- package/src/duckdb/src/include/duckdb/storage/table/table_index_list.hpp +25 -1
- package/src/duckdb/src/include/duckdb/storage/table/table_statistics.hpp +5 -2
- package/src/duckdb/src/include/duckdb/storage/table/update_state.hpp +20 -0
- package/src/duckdb/src/include/duckdb/storage/table/validity_column_data.hpp +1 -0
- package/src/duckdb/src/include/duckdb/storage/temporary_file_manager.hpp +20 -4
- package/src/duckdb/src/include/duckdb/storage/write_ahead_log.hpp +10 -5
- package/src/duckdb/src/include/duckdb/transaction/duck_transaction.hpp +19 -4
- package/src/duckdb/src/include/duckdb/transaction/duck_transaction_manager.hpp +30 -7
- package/src/duckdb/src/include/duckdb/transaction/local_storage.hpp +8 -5
- package/src/duckdb/src/include/duckdb/transaction/meta_transaction.hpp +1 -0
- package/src/duckdb/src/include/duckdb/transaction/transaction.hpp +8 -0
- package/src/duckdb/src/include/duckdb/transaction/undo_buffer.hpp +9 -1
- package/src/duckdb/src/include/duckdb.h +141 -15
- package/src/duckdb/src/main/appender.cpp +3 -1
- package/src/duckdb/src/main/attached_database.cpp +12 -9
- package/src/duckdb/src/main/capi/appender-c.cpp +4 -3
- package/src/duckdb/src/main/capi/arrow-c.cpp +4 -4
- package/src/duckdb/src/main/capi/helper-c.cpp +3 -3
- package/src/duckdb/src/main/capi/replacement_scan-c.cpp +6 -5
- package/src/duckdb/src/main/capi/result-c.cpp +19 -5
- package/src/duckdb/src/main/capi/stream-c.cpp +17 -8
- package/src/duckdb/src/main/capi/table_function-c.cpp +11 -7
- package/src/duckdb/src/main/client_context.cpp +32 -23
- package/src/duckdb/src/main/client_context_file_opener.cpp +31 -0
- package/src/duckdb/src/main/client_context_wrapper.cpp +22 -0
- package/src/duckdb/src/main/client_data.cpp +5 -3
- package/src/duckdb/src/main/config.cpp +73 -2
- package/src/duckdb/src/main/connection.cpp +11 -10
- package/src/duckdb/src/main/connection_manager.cpp +9 -23
- package/src/duckdb/src/main/database.cpp +26 -30
- package/src/duckdb/src/main/db_instance_cache.cpp +1 -1
- package/src/duckdb/src/main/extension/extension_helper.cpp +378 -21
- package/src/duckdb/src/main/extension/extension_install.cpp +301 -89
- package/src/duckdb/src/main/extension/extension_load.cpp +137 -135
- package/src/duckdb/src/main/extension/extension_util.cpp +8 -2
- package/src/duckdb/src/main/extension.cpp +56 -0
- package/src/duckdb/src/main/extension_install_info.cpp +116 -0
- package/src/duckdb/src/main/materialized_query_result.cpp +11 -0
- package/src/duckdb/src/main/query_profiler.cpp +1 -1
- package/src/duckdb/src/main/relation/create_view_relation.cpp +6 -0
- package/src/duckdb/src/main/relation/materialized_relation.cpp +58 -0
- package/src/duckdb/src/main/relation/query_relation.cpp +20 -1
- package/src/duckdb/src/main/relation/read_csv_relation.cpp +5 -3
- package/src/duckdb/src/main/relation/table_relation.cpp +4 -4
- package/src/duckdb/src/main/relation/value_relation.cpp +2 -2
- package/src/duckdb/src/main/relation/view_relation.cpp +1 -1
- package/src/duckdb/src/main/relation/write_csv_relation.cpp +1 -1
- package/src/duckdb/src/main/relation/write_parquet_relation.cpp +1 -1
- package/src/duckdb/src/main/relation.cpp +36 -32
- package/src/duckdb/src/main/secret/secret.cpp +1 -1
- package/src/duckdb/src/main/settings/settings.cpp +169 -11
- package/src/duckdb/src/optimizer/common_aggregate_optimizer.cpp +1 -1
- package/src/duckdb/src/optimizer/filter_combiner.cpp +3 -3
- package/src/duckdb/src/optimizer/filter_pushdown.cpp +3 -2
- package/src/duckdb/src/optimizer/join_order/cardinality_estimator.cpp +3 -3
- package/src/duckdb/src/optimizer/join_order/cost_model.cpp +1 -1
- package/src/duckdb/src/optimizer/join_order/join_node.cpp +4 -27
- package/src/duckdb/src/optimizer/join_order/join_order_optimizer.cpp +5 -8
- package/src/duckdb/src/optimizer/join_order/plan_enumerator.cpp +32 -107
- package/src/duckdb/src/optimizer/join_order/query_graph_manager.cpp +68 -61
- package/src/duckdb/src/optimizer/join_order/relation_manager.cpp +4 -2
- package/src/duckdb/src/optimizer/join_order/relation_statistics_helper.cpp +3 -3
- package/src/duckdb/src/optimizer/optimizer.cpp +3 -1
- package/src/duckdb/src/optimizer/pushdown/pushdown_aggregate.cpp +2 -2
- package/src/duckdb/src/optimizer/pushdown/pushdown_cross_product.cpp +4 -4
- package/src/duckdb/src/optimizer/pushdown/pushdown_left_join.cpp +2 -2
- package/src/duckdb/src/optimizer/pushdown/pushdown_mark_join.cpp +6 -6
- package/src/duckdb/src/optimizer/pushdown/pushdown_projection.cpp +1 -1
- package/src/duckdb/src/optimizer/pushdown/pushdown_semi_anti_join.cpp +1 -1
- package/src/duckdb/src/optimizer/pushdown/pushdown_set_operation.cpp +1 -1
- package/src/duckdb/src/optimizer/pushdown/pushdown_single_join.cpp +2 -2
- package/src/duckdb/src/optimizer/remove_duplicate_groups.cpp +1 -1
- package/src/duckdb/src/optimizer/remove_unused_columns.cpp +1 -1
- package/src/duckdb/src/optimizer/rule/arithmetic_simplification.cpp +1 -1
- package/src/duckdb/src/optimizer/rule/case_simplification.cpp +2 -2
- package/src/duckdb/src/optimizer/rule/conjunction_simplification.cpp +2 -1
- package/src/duckdb/src/optimizer/rule/constant_folding.cpp +1 -0
- package/src/duckdb/src/optimizer/rule/distributivity.cpp +1 -1
- package/src/duckdb/src/optimizer/rule/empty_needle_removal.cpp +1 -0
- package/src/duckdb/src/optimizer/rule/enum_comparison.cpp +1 -0
- package/src/duckdb/src/optimizer/rule/in_clause_simplification_rule.cpp +1 -0
- package/src/duckdb/src/optimizer/rule/move_constants.cpp +4 -0
- package/src/duckdb/src/optimizer/rule/ordered_aggregate_optimizer.cpp +1 -2
- package/src/duckdb/src/optimizer/rule/timestamp_comparison.cpp +107 -0
- package/src/duckdb/src/optimizer/statistics/expression/propagate_conjunction.cpp +1 -1
- package/src/duckdb/src/optimizer/statistics/expression/propagate_operator.cpp +4 -4
- package/src/duckdb/src/optimizer/statistics/operator/propagate_filter.cpp +3 -3
- package/src/duckdb/src/optimizer/statistics/operator/propagate_get.cpp +1 -1
- package/src/duckdb/src/optimizer/statistics/operator/propagate_join.cpp +6 -3
- package/src/duckdb/src/optimizer/statistics/operator/propagate_set_operation.cpp +2 -1
- package/src/duckdb/src/optimizer/topn_optimizer.cpp +2 -2
- package/src/duckdb/src/parallel/executor.cpp +12 -9
- package/src/duckdb/src/parallel/meta_pipeline.cpp +2 -2
- package/src/duckdb/src/parallel/pipeline.cpp +2 -2
- package/src/duckdb/src/parallel/task_scheduler.cpp +9 -3
- package/src/duckdb/src/parser/column_definition.cpp +1 -0
- package/src/duckdb/src/parser/constraints/foreign_key_constraint.cpp +9 -7
- package/src/duckdb/src/parser/expression/star_expression.cpp +2 -2
- package/src/duckdb/src/parser/parsed_data/alter_scalar_function_info.cpp +4 -0
- package/src/duckdb/src/parser/parsed_data/alter_table_function_info.cpp +4 -0
- package/src/duckdb/src/parser/parsed_data/alter_table_info.cpp +183 -0
- package/src/duckdb/src/parser/parsed_data/attach_info.cpp +23 -0
- package/src/duckdb/src/parser/parsed_data/comment_on_column_info.cpp +15 -2
- package/src/duckdb/src/parser/parsed_data/copy_info.cpp +100 -0
- package/src/duckdb/src/parser/parsed_data/create_index_info.cpp +16 -2
- package/src/duckdb/src/parser/parsed_data/create_info.cpp +2 -0
- package/src/duckdb/src/parser/parsed_data/create_schema_info.cpp +40 -0
- package/src/duckdb/src/parser/parsed_data/create_sequence_info.cpp +22 -0
- package/src/duckdb/src/parser/parsed_data/create_table_info.cpp +12 -4
- package/src/duckdb/src/parser/parsed_data/create_type_info.cpp +37 -14
- package/src/duckdb/src/parser/parsed_data/create_view_info.cpp +4 -4
- package/src/duckdb/src/parser/parsed_data/detach_info.cpp +12 -0
- package/src/duckdb/src/parser/parsed_data/drop_info.cpp +21 -0
- package/src/duckdb/src/parser/parsed_data/load_info.cpp +46 -0
- package/src/duckdb/src/parser/parsed_data/parse_info.cpp +50 -0
- package/src/duckdb/src/parser/parsed_data/pragma_info.cpp +33 -0
- package/src/duckdb/src/parser/parsed_data/transaction_info.cpp +22 -0
- package/src/duckdb/src/parser/parsed_data/vacuum_info.cpp +20 -0
- package/src/duckdb/src/parser/parsed_expression_iterator.cpp +1 -0
- package/src/duckdb/src/parser/parser.cpp +5 -4
- package/src/duckdb/src/parser/query_node.cpp +6 -2
- package/src/duckdb/src/parser/statement/alter_statement.cpp +4 -0
- package/src/duckdb/src/parser/statement/attach_statement.cpp +4 -0
- package/src/duckdb/src/parser/statement/call_statement.cpp +8 -0
- package/src/duckdb/src/parser/statement/copy_statement.cpp +1 -91
- package/src/duckdb/src/parser/statement/detach_statement.cpp +4 -0
- package/src/duckdb/src/parser/statement/drop_statement.cpp +4 -0
- package/src/duckdb/src/parser/statement/execute_statement.cpp +15 -0
- package/src/duckdb/src/parser/statement/explain_statement.cpp +19 -0
- package/src/duckdb/src/parser/statement/export_statement.cpp +18 -0
- package/src/duckdb/src/parser/statement/extension_statement.cpp +4 -0
- package/src/duckdb/src/parser/statement/load_statement.cpp +4 -0
- package/src/duckdb/src/parser/statement/multi_statement.cpp +8 -0
- package/src/duckdb/src/parser/statement/pragma_statement.cpp +4 -0
- package/src/duckdb/src/parser/statement/prepare_statement.cpp +13 -0
- package/src/duckdb/src/parser/statement/relation_statement.cpp +4 -0
- package/src/duckdb/src/parser/statement/set_statement.cpp +33 -4
- package/src/duckdb/src/parser/statement/transaction_statement.cpp +4 -0
- package/src/duckdb/src/parser/statement/update_extensions_statement.cpp +34 -0
- package/src/duckdb/src/parser/statement/vacuum_statement.cpp +4 -0
- package/src/duckdb/src/parser/tableref/column_data_ref.cpp +81 -0
- package/src/duckdb/src/parser/tableref.cpp +1 -0
- package/src/duckdb/src/parser/transform/expression/transform_boolean_test.cpp +2 -2
- package/src/duckdb/src/parser/transform/expression/transform_cast.cpp +1 -1
- package/src/duckdb/src/parser/transform/expression/transform_interval.cpp +6 -1
- package/src/duckdb/src/parser/transform/expression/transform_param_ref.cpp +1 -1
- package/src/duckdb/src/parser/transform/expression/transform_positional_reference.cpp +1 -1
- package/src/duckdb/src/parser/transform/expression/transform_subquery.cpp +16 -0
- package/src/duckdb/src/parser/transform/helpers/nodetype_to_string.cpp +2 -0
- package/src/duckdb/src/parser/transform/helpers/transform_typename.cpp +97 -63
- package/src/duckdb/src/parser/transform/statement/transform_checkpoint.cpp +2 -0
- package/src/duckdb/src/parser/transform/statement/transform_copy.cpp +1 -1
- package/src/duckdb/src/parser/transform/statement/transform_load.cpp +4 -2
- package/src/duckdb/src/parser/transform/statement/transform_update.cpp +19 -0
- package/src/duckdb/src/parser/transformer.cpp +5 -2
- package/src/duckdb/src/planner/bind_context.cpp +2 -2
- package/src/duckdb/src/planner/binder/expression/bind_aggregate_expression.cpp +35 -8
- package/src/duckdb/src/planner/binder/expression/bind_cast_expression.cpp +1 -1
- package/src/duckdb/src/planner/binder/expression/bind_function_expression.cpp +13 -7
- package/src/duckdb/src/planner/binder/query_node/bind_select_node.cpp +1 -1
- package/src/duckdb/src/planner/binder/query_node/plan_setop.cpp +35 -2
- package/src/duckdb/src/planner/binder/query_node/plan_subquery.cpp +2 -4
- package/src/duckdb/src/planner/binder/statement/bind_attach.cpp +2 -0
- package/src/duckdb/src/planner/binder/statement/bind_call.cpp +2 -0
- package/src/duckdb/src/planner/binder/statement/bind_copy.cpp +24 -7
- package/src/duckdb/src/planner/binder/statement/bind_copy_database.cpp +21 -68
- package/src/duckdb/src/planner/binder/statement/bind_create.cpp +152 -28
- package/src/duckdb/src/planner/binder/statement/bind_create_table.cpp +115 -57
- package/src/duckdb/src/planner/binder/statement/bind_delete.cpp +4 -0
- package/src/duckdb/src/planner/binder/statement/bind_detach.cpp +2 -0
- package/src/duckdb/src/planner/binder/statement/bind_drop.cpp +2 -0
- package/src/duckdb/src/planner/binder/statement/bind_execute.cpp +4 -2
- package/src/duckdb/src/planner/binder/statement/bind_explain.cpp +2 -0
- package/src/duckdb/src/planner/binder/statement/bind_export.cpp +15 -4
- package/src/duckdb/src/planner/binder/statement/bind_extension.cpp +1 -0
- package/src/duckdb/src/planner/binder/statement/bind_insert.cpp +5 -1
- package/src/duckdb/src/planner/binder/statement/bind_load.cpp +13 -0
- package/src/duckdb/src/planner/binder/statement/bind_logical_plan.cpp +2 -0
- package/src/duckdb/src/planner/binder/statement/bind_pragma.cpp +2 -0
- package/src/duckdb/src/planner/binder/statement/bind_prepare.cpp +1 -0
- package/src/duckdb/src/planner/binder/statement/bind_select.cpp +1 -0
- package/src/duckdb/src/planner/binder/statement/bind_set.cpp +4 -0
- package/src/duckdb/src/planner/binder/statement/bind_simple.cpp +6 -4
- package/src/duckdb/src/planner/binder/statement/bind_update.cpp +5 -1
- package/src/duckdb/src/planner/binder/statement/bind_update_extensions.cpp +28 -0
- package/src/duckdb/src/planner/binder/statement/bind_vacuum.cpp +2 -0
- package/src/duckdb/src/planner/binder/tableref/bind_basetableref.cpp +32 -29
- package/src/duckdb/src/planner/binder/tableref/bind_column_data_ref.cpp +16 -0
- package/src/duckdb/src/planner/binder/tableref/bind_pivot.cpp +7 -4
- package/src/duckdb/src/planner/binder/tableref/bind_table_function.cpp +32 -22
- package/src/duckdb/src/planner/binder/tableref/plan_column_data_ref.cpp +15 -0
- package/src/duckdb/src/planner/binder/tableref/plan_joinref.cpp +29 -11
- package/src/duckdb/src/planner/binder.cpp +50 -30
- package/src/duckdb/src/planner/bound_parameter_map.cpp +1 -1
- package/src/duckdb/src/planner/bound_result_modifier.cpp +1 -1
- package/src/duckdb/src/planner/expression/bound_expression.cpp +3 -2
- package/src/duckdb/src/planner/expression_binder/alter_binder.cpp +24 -7
- package/src/duckdb/src/planner/expression_binder/base_select_binder.cpp +27 -2
- package/src/duckdb/src/planner/expression_binder/having_binder.cpp +34 -19
- package/src/duckdb/src/planner/expression_binder/index_binder.cpp +33 -0
- package/src/duckdb/src/planner/expression_binder/order_binder.cpp +10 -1
- package/src/duckdb/src/planner/expression_binder.cpp +4 -0
- package/src/duckdb/src/planner/expression_iterator.cpp +3 -1
- package/src/duckdb/src/planner/filter/constant_filter.cpp +1 -1
- package/src/duckdb/src/planner/operator/logical_column_data_get.cpp +16 -2
- package/src/duckdb/src/planner/operator/logical_copy_to_file.cpp +3 -3
- package/src/duckdb/src/planner/operator/logical_delete.cpp +2 -0
- package/src/duckdb/src/planner/operator/logical_get.cpp +4 -1
- package/src/duckdb/src/planner/operator/logical_insert.cpp +2 -0
- package/src/duckdb/src/planner/operator/logical_top_n.cpp +1 -1
- package/src/duckdb/src/planner/operator/logical_update.cpp +2 -0
- package/src/duckdb/src/planner/planner.cpp +35 -9
- package/src/duckdb/src/planner/subquery/flatten_dependent_join.cpp +34 -9
- package/src/duckdb/src/planner/table_binding.cpp +1 -1
- package/src/duckdb/src/storage/arena_allocator.cpp +5 -3
- package/src/duckdb/src/storage/buffer/block_handle.cpp +3 -3
- package/src/duckdb/src/storage/buffer/block_manager.cpp +1 -1
- package/src/duckdb/src/storage/buffer/buffer_pool.cpp +83 -22
- package/src/duckdb/src/storage/buffer/buffer_pool_reservation.cpp +2 -2
- package/src/duckdb/src/storage/buffer_manager.cpp +6 -2
- package/src/duckdb/src/storage/checkpoint/row_group_writer.cpp +9 -0
- package/src/duckdb/src/storage/checkpoint/table_data_writer.cpp +7 -2
- package/src/duckdb/src/storage/checkpoint_manager.cpp +68 -104
- package/src/duckdb/src/storage/compression/bitpacking.cpp +19 -13
- package/src/duckdb/src/storage/compression/dictionary_compression.cpp +9 -7
- package/src/duckdb/src/storage/compression/fixed_size_uncompressed.cpp +1 -1
- package/src/duckdb/src/storage/compression/fsst.cpp +11 -7
- package/src/duckdb/src/storage/compression/rle.cpp +1 -1
- package/src/duckdb/src/storage/compression/string_uncompressed.cpp +5 -4
- package/src/duckdb/src/storage/compression/validity_uncompressed.cpp +1 -1
- package/src/duckdb/src/storage/data_table.cpp +254 -101
- package/src/duckdb/src/storage/index.cpp +2 -106
- package/src/duckdb/src/storage/local_storage.cpp +38 -50
- package/src/duckdb/src/storage/metadata/metadata_manager.cpp +2 -2
- package/src/duckdb/src/storage/metadata/metadata_writer.cpp +1 -1
- package/src/duckdb/src/storage/optimistic_data_writer.cpp +9 -11
- package/src/duckdb/src/storage/partial_block_manager.cpp +6 -6
- package/src/duckdb/src/storage/serialization/serialize_create_info.cpp +8 -0
- package/src/duckdb/src/storage/serialization/serialize_dependency.cpp +49 -0
- package/src/duckdb/src/storage/serialization/serialize_extension_install_info.cpp +28 -0
- package/src/duckdb/src/storage/serialization/serialize_logical_operator.cpp +5 -2
- package/src/duckdb/src/storage/serialization/serialize_nodes.cpp +78 -2
- package/src/duckdb/src/storage/serialization/serialize_parse_info.cpp +21 -0
- package/src/duckdb/src/storage/serialization/serialize_tableref.cpp +16 -0
- package/src/duckdb/src/storage/serialization/serialize_types.cpp +6 -1
- package/src/duckdb/src/storage/single_file_block_manager.cpp +22 -19
- package/src/duckdb/src/storage/standard_buffer_manager.cpp +68 -40
- package/src/duckdb/src/storage/statistics/column_statistics.cpp +3 -3
- package/src/duckdb/src/storage/statistics/distinct_statistics.cpp +1 -1
- package/src/duckdb/src/storage/storage_info.cpp +67 -23
- package/src/duckdb/src/storage/storage_lock.cpp +77 -17
- package/src/duckdb/src/storage/storage_manager.cpp +73 -51
- package/src/duckdb/src/storage/table/array_column_data.cpp +13 -12
- package/src/duckdb/src/storage/table/column_data.cpp +80 -37
- package/src/duckdb/src/storage/table/column_data_checkpointer.cpp +1 -1
- package/src/duckdb/src/storage/table/column_segment.cpp +6 -5
- package/src/duckdb/src/storage/table/list_column_data.cpp +15 -14
- package/src/duckdb/src/storage/table/row_group.cpp +38 -23
- package/src/duckdb/src/storage/table/row_group_collection.cpp +52 -38
- package/src/duckdb/src/storage/table/row_version_manager.cpp +2 -2
- package/src/duckdb/src/storage/table/standard_column_data.cpp +28 -16
- package/src/duckdb/src/storage/table/struct_column_data.cpp +23 -16
- package/src/duckdb/src/storage/table/table_statistics.cpp +27 -8
- package/src/duckdb/src/storage/table/update_segment.cpp +6 -6
- package/src/duckdb/src/storage/table/validity_column_data.cpp +5 -0
- package/src/duckdb/src/storage/table_index_list.cpp +69 -42
- package/src/duckdb/src/storage/temporary_file_manager.cpp +111 -17
- package/src/duckdb/src/storage/temporary_memory_manager.cpp +4 -4
- package/src/duckdb/src/storage/wal_replay.cpp +27 -22
- package/src/duckdb/src/storage/write_ahead_log.cpp +42 -22
- package/src/duckdb/src/transaction/cleanup_state.cpp +4 -7
- package/src/duckdb/src/transaction/commit_state.cpp +17 -8
- package/src/duckdb/src/transaction/duck_transaction.cpp +60 -15
- package/src/duckdb/src/transaction/duck_transaction_manager.cpp +154 -121
- package/src/duckdb/src/transaction/meta_transaction.cpp +19 -1
- package/src/duckdb/src/transaction/rollback_state.cpp +2 -0
- package/src/duckdb/src/transaction/transaction.cpp +7 -7
- package/src/duckdb/src/transaction/undo_buffer.cpp +37 -17
- package/src/duckdb/third_party/concurrentqueue/concurrentqueue.h +5 -5
- package/src/duckdb/third_party/fsst/fsst.h +1 -1
- package/src/duckdb/third_party/jaro_winkler/details/common.hpp +9 -9
- package/src/duckdb/third_party/jaro_winkler/details/intrinsics.hpp +1 -1
- package/src/duckdb/third_party/jaro_winkler/details/jaro_impl.hpp +18 -18
- package/src/duckdb/third_party/libpg_query/include/nodes/nodes.hpp +1 -0
- package/src/duckdb/third_party/libpg_query/include/nodes/parsenodes.hpp +12 -0
- package/src/duckdb/third_party/libpg_query/include/parser/gram.hpp +555 -1032
- package/src/duckdb/third_party/libpg_query/include/parser/kwlist.hpp +3 -0
- package/src/duckdb/third_party/libpg_query/include/utils/datetime.hpp +1 -0
- package/src/duckdb/third_party/libpg_query/pg_functions.cpp +13 -6
- package/src/duckdb/third_party/libpg_query/src_backend_parser_gram.cpp +23925 -23444
- package/src/duckdb/third_party/mbedtls/library/constant_time.cpp +1 -1
- 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/compile.cc +2 -2
- package/src/duckdb/third_party/re2/re2/dfa.cc +3 -8
- package/src/duckdb/third_party/re2/re2/onepass.cc +4 -3
- package/src/duckdb/third_party/re2/re2/prog.cc +10 -10
- package/src/duckdb/third_party/re2/re2/prog.h +8 -8
- package/src/duckdb/third_party/tdigest/t_digest.hpp +6 -6
- package/src/duckdb/third_party/utf8proc/include/utf8proc.hpp +1 -1
- package/src/duckdb/third_party/yyjson/include/yyjson.hpp +7930 -0
- package/src/duckdb/third_party/yyjson/yyjson.cpp +9490 -0
- package/src/duckdb/ub_src_catalog.cpp +2 -0
- package/src/duckdb/ub_src_common.cpp +2 -0
- package/src/duckdb/ub_src_execution_index.cpp +3 -1
- package/src/duckdb/ub_src_execution_operator_helper.cpp +2 -0
- package/src/duckdb/ub_src_function_table_system.cpp +2 -0
- package/src/duckdb/ub_src_main.cpp +4 -0
- package/src/duckdb/ub_src_main_relation.cpp +2 -0
- package/src/duckdb/ub_src_optimizer.cpp +8 -8
- package/src/duckdb/ub_src_optimizer_join_order.cpp +0 -2
- package/src/duckdb/ub_src_optimizer_rule.cpp +4 -2
- package/src/duckdb/ub_src_parser_parsed_data.cpp +10 -0
- package/src/duckdb/ub_src_parser_statement.cpp +2 -0
- package/src/duckdb/ub_src_parser_tableref.cpp +2 -0
- package/src/duckdb/ub_src_planner_binder_statement.cpp +2 -0
- package/src/duckdb/ub_src_planner_binder_tableref.cpp +4 -0
- package/src/duckdb/ub_src_storage_serialization.cpp +4 -0
- package/test/query_result.test.ts +9 -0
- package/test/replacement_scan.test.ts +2 -0
- package/src/duckdb/src/catalog/catalog_entry/ub_duckdb_catalog_entries.cpp +0 -16
- package/src/duckdb/src/catalog/default/ub_duckdb_catalog_default_entries.cpp +0 -5
- package/src/duckdb/src/catalog/ub_duckdb_catalog.cpp +0 -10
- package/src/duckdb/src/common/adbc/nanoarrow/ub_duckdb_adbc_nanoarrow.cpp +0 -5
- package/src/duckdb/src/common/adbc/ub_duckdb_adbc.cpp +0 -3
- package/src/duckdb/src/common/arrow/appender/ub_duckdb_common_arrow_appender.cpp +0 -6
- package/src/duckdb/src/common/arrow/ub_duckdb_common_arrow.cpp +0 -4
- package/src/duckdb/src/common/crypto/ub_duckdb_common_crypto.cpp +0 -2
- package/src/duckdb/src/common/enums/ub_duckdb_common_enums.cpp +0 -12
- package/src/duckdb/src/common/operator/ub_duckdb_common_operators.cpp +0 -4
- package/src/duckdb/src/common/progress_bar/ub_duckdb_progress_bar.cpp +0 -3
- package/src/duckdb/src/common/row_operations/ub_duckdb_row_operations.cpp +0 -9
- package/src/duckdb/src/common/serializer/ub_duckdb_common_serializer.cpp +0 -7
- package/src/duckdb/src/common/sort/ub_duckdb_sort.cpp +0 -7
- package/src/duckdb/src/common/types/column/ub_duckdb_common_types_column.cpp +0 -6
- package/src/duckdb/src/common/types/row/ub_duckdb_common_types_row.cpp +0 -11
- package/src/duckdb/src/common/types/ub_duckdb_common_types.cpp +0 -28
- package/src/duckdb/src/common/ub_duckdb_common.cpp +0 -34
- package/src/duckdb/src/common/value_operations/ub_duckdb_value_operations.cpp +0 -2
- package/src/duckdb/src/core_functions/aggregate/algebraic/ub_duckdb_aggr_algebraic.cpp +0 -5
- package/src/duckdb/src/core_functions/aggregate/distributive/ub_duckdb_aggr_distributive.cpp +0 -13
- package/src/duckdb/src/core_functions/aggregate/holistic/ub_duckdb_aggr_holistic.cpp +0 -5
- package/src/duckdb/src/core_functions/aggregate/nested/ub_duckdb_aggr_nested.cpp +0 -3
- package/src/duckdb/src/core_functions/aggregate/regression/ub_duckdb_aggr_regr.cpp +0 -8
- package/src/duckdb/src/core_functions/scalar/bit/ub_duckdb_func_bit.cpp +0 -2
- package/src/duckdb/src/core_functions/scalar/blob/ub_duckdb_func_blob.cpp +0 -3
- package/src/duckdb/src/core_functions/scalar/date/ub_duckdb_func_date.cpp +0 -12
- package/src/duckdb/src/core_functions/scalar/debug/ub_duckdb_func_debug.cpp +0 -2
- package/src/duckdb/src/core_functions/scalar/enum/ub_duckdb_func_enum.cpp +0 -2
- package/src/duckdb/src/core_functions/scalar/generic/ub_duckdb_func_generic.cpp +0 -9
- package/src/duckdb/src/core_functions/scalar/list/ub_duckdb_func_list.cpp +0 -11
- package/src/duckdb/src/core_functions/scalar/map/ub_duckdb_func_map_nested.cpp +0 -8
- package/src/duckdb/src/core_functions/scalar/math/ub_duckdb_func_math.cpp +0 -1
- package/src/duckdb/src/core_functions/scalar/operators/ub_duckdb_func_ops.cpp +0 -1
- package/src/duckdb/src/core_functions/scalar/random/ub_duckdb_func_random.cpp +0 -3
- package/src/duckdb/src/core_functions/scalar/string/ub_duckdb_func_string.cpp +0 -26
- package/src/duckdb/src/core_functions/scalar/struct/ub_duckdb_func_struct.cpp +0 -3
- package/src/duckdb/src/core_functions/scalar/union/ub_duckdb_func_union.cpp +0 -4
- package/src/duckdb/src/core_functions/ub_duckdb_core_functions.cpp +0 -3
- package/src/duckdb/src/execution/expression_executor/ub_duckdb_expression_executor.cpp +0 -11
- package/src/duckdb/src/execution/index/art/ub_duckdb_art_index_execution.cpp +0 -12
- package/src/duckdb/src/execution/index/art/ub_duckdb_execution_index_art.cpp +0 -11
- package/src/duckdb/src/execution/index/ub_duckdb_execution_index.cpp +0 -3
- package/src/duckdb/src/execution/nested_loop_join/ub_duckdb_nested_loop_join.cpp +0 -3
- package/src/duckdb/src/execution/operator/aggregate/ub_duckdb_operator_aggregate.cpp +0 -9
- package/src/duckdb/src/execution/operator/csv_scanner/sniffer/ub_duckdb_operator_csv_sniffer.cpp +0 -7
- package/src/duckdb/src/execution/operator/csv_scanner/ub_duckdb_operator_csv_scanner.cpp +0 -10
- package/src/duckdb/src/execution/operator/filter/ub_duckdb_operator_filter.cpp +0 -2
- package/src/duckdb/src/execution/operator/helper/ub_duckdb_operator_helper.cpp +0 -18
- package/src/duckdb/src/execution/operator/join/ub_duckdb_operator_join.cpp +0 -16
- package/src/duckdb/src/execution/operator/order/ub_duckdb_operator_order.cpp +0 -3
- package/src/duckdb/src/execution/operator/persistent/ub_duckdb_operator_persistent.cpp +0 -10
- package/src/duckdb/src/execution/operator/projection/ub_duckdb_operator_projection.cpp +0 -5
- package/src/duckdb/src/execution/operator/scan/ub_duckdb_operator_scan.cpp +0 -7
- package/src/duckdb/src/execution/operator/schema/ub_duckdb_operator_schema.cpp +0 -12
- package/src/duckdb/src/execution/operator/set/ub_duckdb_operator_set.cpp +0 -4
- package/src/duckdb/src/execution/physical_plan/ub_duckdb_physical_plan.cpp +0 -44
- package/src/duckdb/src/execution/ub_duckdb_execution.cpp +0 -15
- package/src/duckdb/src/function/aggregate/algebraic/ub_duckdb_aggr_algebraic.cpp +0 -5
- package/src/duckdb/src/function/aggregate/distributive/ub_duckdb_aggr_distr.cpp +0 -3
- package/src/duckdb/src/function/aggregate/holistic/ub_duckdb_aggr_holistic.cpp +0 -5
- package/src/duckdb/src/function/aggregate/nested/ub_duckdb_aggr_nested.cpp +0 -3
- package/src/duckdb/src/function/aggregate/regression/ub_duckdb_aggr_regr.cpp +0 -8
- package/src/duckdb/src/function/aggregate/ub_duckdb_func_aggr.cpp +0 -3
- package/src/duckdb/src/function/cast/ub_duckdb_func_cast.cpp +0 -17
- package/src/duckdb/src/function/cast/union/ub_duckdb_union_cast.cpp +0 -2
- package/src/duckdb/src/function/pragma/ub_duckdb_func_pragma.cpp +0 -3
- package/src/duckdb/src/function/scalar/bit/ub_duckdb_func_bit.cpp +0 -2
- package/src/duckdb/src/function/scalar/blob/ub_duckdb_func_blob.cpp +0 -3
- package/src/duckdb/src/function/scalar/compressed_materialization/ub_duckdb_func_compressed_materialization.cpp +0 -3
- package/src/duckdb/src/function/scalar/date/ub_duckdb_func_date.cpp +0 -12
- package/src/duckdb/src/function/scalar/enum/ub_duckdb_func_enum.cpp +0 -2
- package/src/duckdb/src/function/scalar/generic/ub_duckdb_func_generic.cpp +0 -8
- package/src/duckdb/src/function/scalar/generic/ub_duckdb_func_generic_main.cpp +0 -2
- package/src/duckdb/src/function/scalar/list/ub_duckdb_func_list.cpp +0 -11
- package/src/duckdb/src/function/scalar/list/ub_duckdb_func_list_nested.cpp +0 -5
- package/src/duckdb/src/function/scalar/map/ub_duckdb_func_map_nested.cpp +0 -7
- package/src/duckdb/src/function/scalar/math/ub_duckdb_func_math.cpp +0 -4
- package/src/duckdb/src/function/scalar/operators/ub_duckdb_func_ops.cpp +0 -6
- package/src/duckdb/src/function/scalar/operators/ub_duckdb_func_ops_main.cpp +0 -5
- package/src/duckdb/src/function/scalar/sequence/ub_duckdb_func_seq.cpp +0 -2
- package/src/duckdb/src/function/scalar/string/regexp/ub_duckdb_func_string_regexp.cpp +0 -3
- package/src/duckdb/src/function/scalar/string/ub_duckdb_func_string.cpp +0 -31
- package/src/duckdb/src/function/scalar/string/ub_duckdb_func_string_main.cpp +0 -12
- package/src/duckdb/src/function/scalar/struct/ub_duckdb_func_struct.cpp +0 -4
- package/src/duckdb/src/function/scalar/struct/ub_duckdb_func_struct_main.cpp +0 -2
- package/src/duckdb/src/function/scalar/system/ub_duckdb_func_system.cpp +0 -2
- package/src/duckdb/src/function/scalar/ub_duckdb_func_scalar.cpp +0 -9
- package/src/duckdb/src/function/scalar/union/ub_duckdb_func_union.cpp +0 -4
- package/src/duckdb/src/function/table/arrow/ub_duckdb_arrow_conversion.cpp +0 -2
- package/src/duckdb/src/function/table/system/ub_duckdb_table_func_system.cpp +0 -23
- package/src/duckdb/src/function/table/ub_duckdb_func_table.cpp +0 -16
- package/src/duckdb/src/function/table/version/ub_duckdb_func_table_version.cpp +0 -2
- package/src/duckdb/src/function/ub_duckdb_function.cpp +0 -14
- package/src/duckdb/src/main/capi/cast/ub_duckdb_main_capi_cast.cpp +0 -3
- package/src/duckdb/src/main/capi/ub_duckdb_main_capi.cpp +0 -19
- package/src/duckdb/src/main/chunk_scan_state/ub_duckdb_main_chunk_scan_state.cpp +0 -2
- package/src/duckdb/src/main/extension/ub_duckdb_main_extension.cpp +0 -6
- package/src/duckdb/src/main/relation/ub_duckdb_main_relation.cpp +0 -26
- package/src/duckdb/src/main/settings/ub_duckdb_main_settings.cpp +0 -2
- package/src/duckdb/src/main/ub_duckdb_main.cpp +0 -25
- package/src/duckdb/src/optimizer/compressed_materialization/ub_duckdb_optimizer_compressed_materialization.cpp +0 -4
- package/src/duckdb/src/optimizer/join_order/ub_duckdb_optimizer_join_order.cpp +0 -12
- package/src/duckdb/src/optimizer/matcher/ub_duckdb_optimizer_matcher.cpp +0 -2
- package/src/duckdb/src/optimizer/pullup/ub_duckdb_optimizer_pullup.cpp +0 -6
- package/src/duckdb/src/optimizer/pushdown/ub_duckdb_optimizer_pushdown.cpp +0 -12
- package/src/duckdb/src/optimizer/rule/ub_duckdb_optimizer_rules.cpp +0 -16
- package/src/duckdb/src/optimizer/statistics/expression/ub_duckdb_optimizer_statistics_expr.cpp +0 -11
- package/src/duckdb/src/optimizer/statistics/operator/ub_duckdb_optimizer_statistics_op.cpp +0 -11
- package/src/duckdb/src/optimizer/ub_duckdb_optimizer.cpp +0 -20
- package/src/duckdb/src/parallel/ub_duckdb_parallel.cpp +0 -15
- package/src/duckdb/src/parser/constraints/ub_duckdb_constraints.cpp +0 -5
- package/src/duckdb/src/parser/expression/ub_duckdb_expression.cpp +0 -18
- package/src/duckdb/src/parser/parsed_data/ub_duckdb_parsed_data.cpp +0 -24
- package/src/duckdb/src/parser/query_node/ub_duckdb_query_node.cpp +0 -5
- package/src/duckdb/src/parser/statement/ub_duckdb_statement.cpp +0 -25
- package/src/duckdb/src/parser/tableref/ub_duckdb_parser_tableref.cpp +0 -8
- package/src/duckdb/src/parser/transform/constraint/ub_duckdb_transformer_constraint.cpp +0 -2
- package/src/duckdb/src/parser/transform/expression/ub_duckdb_transformer_expression.cpp +0 -20
- package/src/duckdb/src/parser/transform/helpers/ub_duckdb_transformer_helpers.cpp +0 -8
- package/src/duckdb/src/parser/transform/statement/ub_duckdb_transformer_statement.cpp +0 -37
- package/src/duckdb/src/parser/transform/tableref/ub_duckdb_transformer_tableref.cpp +0 -8
- package/src/duckdb/src/parser/ub_duckdb_parser.cpp +0 -15
- package/src/duckdb/src/planner/binder/expression/ub_duckdb_bind_expression.cpp +0 -20
- package/src/duckdb/src/planner/binder/query_node/ub_duckdb_bind_query_node.cpp +0 -12
- package/src/duckdb/src/planner/binder/statement/ub_duckdb_bind_statement.cpp +0 -26
- package/src/duckdb/src/planner/binder/tableref/ub_duckdb_bind_tableref.cpp +0 -17
- package/src/duckdb/src/planner/expression/ub_duckdb_planner_expression.cpp +0 -19
- package/src/duckdb/src/planner/expression_binder/ub_duckdb_expression_binders.cpp +0 -20
- package/src/duckdb/src/planner/filter/ub_duckdb_planner_filter.cpp +0 -4
- package/src/duckdb/src/planner/operator/ub_duckdb_planner_operator.cpp +0 -43
- package/src/duckdb/src/planner/parsed_data/ub_duckdb_planner_parsed_data.cpp +0 -2
- package/src/duckdb/src/planner/subquery/ub_duckdb_planner_subquery.cpp +0 -4
- package/src/duckdb/src/planner/ub_duckdb_planner.cpp +0 -15
- package/src/duckdb/src/storage/buffer/ub_duckdb_storage_buffer.cpp +0 -6
- package/src/duckdb/src/storage/checkpoint/ub_duckdb_storage_checkpoint.cpp +0 -5
- package/src/duckdb/src/storage/compression/chimp/ub_duckdb_storage_compression_chimp.cpp +0 -6
- package/src/duckdb/src/storage/compression/ub_duckdb_storage_compression.cpp +0 -12
- package/src/duckdb/src/storage/metadata/ub_duckdb_storage_metadata.cpp +0 -4
- package/src/duckdb/src/storage/serialization/ub_duckdb_storage_serialization.cpp +0 -16
- package/src/duckdb/src/storage/statistics/ub_duckdb_storage_statistics.cpp +0 -10
- package/src/duckdb/src/storage/table/ub_duckdb_storage_table.cpp +0 -17
- package/src/duckdb/src/storage/ub_duckdb_storage.cpp +0 -20
- package/src/duckdb/src/transaction/ub_duckdb_transaction.cpp +0 -11
@@ -1,26 +1,31 @@
|
|
1
1
|
#include "duckdb/execution/operator/csv_scanner/string_value_scanner.hpp"
|
2
|
+
|
3
|
+
#include "duckdb/common/operator/decimal_cast_operators.hpp"
|
4
|
+
#include "duckdb/common/operator/double_cast_operator.hpp"
|
5
|
+
#include "duckdb/common/operator/integer_cast_operator.hpp"
|
6
|
+
#include "duckdb/common/types/time.hpp"
|
2
7
|
#include "duckdb/execution/operator/csv_scanner/csv_casting.hpp"
|
3
|
-
#include "duckdb/execution/operator/csv_scanner/skip_scanner.hpp"
|
4
8
|
#include "duckdb/execution/operator/csv_scanner/csv_file_scanner.hpp"
|
9
|
+
#include "duckdb/execution/operator/csv_scanner/skip_scanner.hpp"
|
10
|
+
#include "duckdb/function/cast/cast_function_set.hpp"
|
5
11
|
#include "duckdb/main/client_data.hpp"
|
6
|
-
#include "duckdb/common/operator/integer_cast_operator.hpp"
|
7
|
-
#include "duckdb/common/operator/double_cast_operator.hpp"
|
8
|
-
#include <algorithm>
|
9
12
|
#include "utf8proc_wrapper.hpp"
|
10
13
|
|
14
|
+
#include <algorithm>
|
15
|
+
|
11
16
|
namespace duckdb {
|
12
17
|
|
13
18
|
StringValueResult::StringValueResult(CSVStates &states, CSVStateMachine &state_machine,
|
14
19
|
const shared_ptr<CSVBufferHandle> &buffer_handle, Allocator &buffer_allocator,
|
15
|
-
|
20
|
+
bool figure_out_new_line_p, idx_t buffer_position, CSVErrorHandler &error_hander_p,
|
16
21
|
CSVIterator &iterator_p, bool store_line_size_p,
|
17
22
|
shared_ptr<CSVFileScan> csv_file_scan_p, idx_t &lines_read_p, bool sniffing_p)
|
18
23
|
: ScannerResult(states, state_machine),
|
19
24
|
number_of_columns(NumericCast<uint32_t>(state_machine.dialect_options.num_cols)),
|
20
25
|
null_padding(state_machine.options.null_padding), ignore_errors(state_machine.options.ignore_errors.GetValue()),
|
21
|
-
|
26
|
+
figure_out_new_line(figure_out_new_line_p), error_handler(error_hander_p), iterator(iterator_p),
|
22
27
|
store_line_size(store_line_size_p), csv_file_scan(std::move(csv_file_scan_p)), lines_read(lines_read_p),
|
23
|
-
sniffing(sniffing_p) {
|
28
|
+
current_errors(state_machine.options.IgnoreErrors()), sniffing(sniffing_p) {
|
24
29
|
// Vector information
|
25
30
|
D_ASSERT(number_of_columns > 0);
|
26
31
|
buffer_handles[buffer_handle->buffer_idx] = buffer_handle;
|
@@ -29,16 +34,18 @@ StringValueResult::StringValueResult(CSVStates &states, CSVStateMachine &state_m
|
|
29
34
|
buffer_size = buffer_handle->actual_size;
|
30
35
|
last_position = {buffer_handle->buffer_idx, buffer_position, buffer_size};
|
31
36
|
requested_size = buffer_handle->requested_size;
|
37
|
+
result_size = figure_out_new_line ? 1 : STANDARD_VECTOR_SIZE;
|
32
38
|
|
33
39
|
// Current Result information
|
34
40
|
current_line_position.begin = {iterator.pos.buffer_idx, iterator.pos.buffer_pos, buffer_handle->actual_size};
|
35
41
|
current_line_position.end = current_line_position.begin;
|
36
42
|
// Fill out Parse Types
|
37
43
|
vector<LogicalType> logical_types;
|
38
|
-
parse_types = make_unsafe_uniq_array<
|
44
|
+
parse_types = make_unsafe_uniq_array<ParseTypeInfo>(number_of_columns);
|
45
|
+
LogicalType varchar_type = LogicalType::VARCHAR;
|
39
46
|
if (!csv_file_scan) {
|
40
47
|
for (idx_t i = 0; i < number_of_columns; i++) {
|
41
|
-
parse_types[i] =
|
48
|
+
parse_types[i] = ParseTypeInfo(varchar_type, true);
|
42
49
|
logical_types.emplace_back(LogicalType::VARCHAR);
|
43
50
|
string name = "Column_" + to_string(i);
|
44
51
|
names.emplace_back(name);
|
@@ -51,11 +58,11 @@ StringValueResult::StringValueResult(CSVStates &states, CSVStateMachine &state_m
|
|
51
58
|
}
|
52
59
|
for (idx_t i = 0; i < csv_file_scan->file_types.size(); i++) {
|
53
60
|
auto &type = csv_file_scan->file_types[i];
|
54
|
-
if (StringValueScanner::CanDirectlyCast(type
|
55
|
-
parse_types[i] =
|
61
|
+
if (StringValueScanner::CanDirectlyCast(type)) {
|
62
|
+
parse_types[i] = ParseTypeInfo(type, true);
|
56
63
|
logical_types.emplace_back(type);
|
57
64
|
} else {
|
58
|
-
parse_types[i] =
|
65
|
+
parse_types[i] = ParseTypeInfo(varchar_type, type.id() == LogicalTypeId::VARCHAR || type.IsNested());
|
59
66
|
logical_types.emplace_back(LogicalType::VARCHAR);
|
60
67
|
}
|
61
68
|
}
|
@@ -76,7 +83,7 @@ StringValueResult::StringValueResult(CSVStates &states, CSVStateMachine &state_m
|
|
76
83
|
if (!projecting_columns) {
|
77
84
|
for (idx_t j = logical_types.size(); j < number_of_columns; j++) {
|
78
85
|
// This can happen if we have sneaky null columns at the end that we wish to ignore
|
79
|
-
parse_types[j] =
|
86
|
+
parse_types[j] = ParseTypeInfo(varchar_type, true);
|
80
87
|
logical_types.emplace_back(LogicalType::VARCHAR);
|
81
88
|
}
|
82
89
|
}
|
@@ -97,6 +104,9 @@ StringValueResult::StringValueResult(CSVStates &states, CSVStateMachine &state_m
|
|
97
104
|
null_str_ptr[i] = state_machine.options.null_str[i].c_str();
|
98
105
|
null_str_size[i] = state_machine.options.null_str[i].size();
|
99
106
|
}
|
107
|
+
date_format = state_machine.options.dialect_options.date_format.at(LogicalTypeId::DATE).GetValue();
|
108
|
+
timestamp_format = state_machine.options.dialect_options.date_format.at(LogicalTypeId::TIMESTAMP).GetValue();
|
109
|
+
decimal_separator = state_machine.options.decimal_separator[0];
|
100
110
|
}
|
101
111
|
|
102
112
|
StringValueResult::~StringValueResult() {
|
@@ -118,7 +128,31 @@ inline bool IsValueNull(const char *null_str_ptr, const char *value_ptr, const i
|
|
118
128
|
return true;
|
119
129
|
}
|
120
130
|
|
131
|
+
bool StringValueResult::HandleTooManyColumnsError(const char *value_ptr, const idx_t size) {
|
132
|
+
if (cur_col_id >= number_of_columns) {
|
133
|
+
bool error = true;
|
134
|
+
if (cur_col_id == number_of_columns && ((quoted && state_machine.options.allow_quoted_nulls) || !quoted)) {
|
135
|
+
// we make an exception if the first over-value is null
|
136
|
+
bool is_value_null = false;
|
137
|
+
for (idx_t i = 0; i < null_str_count; i++) {
|
138
|
+
is_value_null = is_value_null || IsValueNull(null_str_ptr[i], value_ptr, size);
|
139
|
+
}
|
140
|
+
error = !is_value_null;
|
141
|
+
}
|
142
|
+
if (error) {
|
143
|
+
// We error pointing to the current value error.
|
144
|
+
current_errors.Insert(CSVErrorType::TOO_MANY_COLUMNS, cur_col_id, chunk_col_id, last_position);
|
145
|
+
cur_col_id++;
|
146
|
+
}
|
147
|
+
// We had an error
|
148
|
+
return true;
|
149
|
+
}
|
150
|
+
return false;
|
151
|
+
}
|
121
152
|
void StringValueResult::AddValueToVector(const char *value_ptr, const idx_t size, bool allocate) {
|
153
|
+
if (HandleTooManyColumnsError(value_ptr, size)) {
|
154
|
+
return;
|
155
|
+
}
|
122
156
|
if (cur_col_id >= number_of_columns) {
|
123
157
|
bool error = true;
|
124
158
|
if (cur_col_id == number_of_columns && ((quoted && state_machine.options.allow_quoted_nulls) || !quoted)) {
|
@@ -131,7 +165,7 @@ void StringValueResult::AddValueToVector(const char *value_ptr, const idx_t size
|
|
131
165
|
}
|
132
166
|
if (error) {
|
133
167
|
// We error pointing to the current value error.
|
134
|
-
current_errors.
|
168
|
+
current_errors.Insert(CSVErrorType::TOO_MANY_COLUMNS, cur_col_id, chunk_col_id, last_position);
|
135
169
|
cur_col_id++;
|
136
170
|
}
|
137
171
|
return;
|
@@ -152,9 +186,9 @@ void StringValueResult::AddValueToVector(const char *value_ptr, const idx_t size
|
|
152
186
|
empty = state_machine.options.force_not_null[chunk_col_id];
|
153
187
|
}
|
154
188
|
if (empty) {
|
155
|
-
if (parse_types[chunk_col_id].
|
189
|
+
if (parse_types[chunk_col_id].type_id != LogicalTypeId::VARCHAR) {
|
156
190
|
// If it is not a varchar, empty values are not accepted, we must error.
|
157
|
-
current_errors.
|
191
|
+
current_errors.Insert(CSVErrorType::CAST_ERROR, cur_col_id, chunk_col_id, last_position);
|
158
192
|
}
|
159
193
|
static_cast<string_t *>(vector_ptr[chunk_col_id])[number_of_rows] = string_t();
|
160
194
|
} else {
|
@@ -172,7 +206,7 @@ void StringValueResult::AddValueToVector(const char *value_ptr, const idx_t size
|
|
172
206
|
}
|
173
207
|
}
|
174
208
|
bool success = true;
|
175
|
-
switch (parse_types[chunk_col_id].
|
209
|
+
switch (parse_types[chunk_col_id].type_id) {
|
176
210
|
case LogicalTypeId::TINYINT:
|
177
211
|
success = TrySimpleIntegerCast(value_ptr, size, static_cast<int8_t *>(vector_ptr[chunk_col_id])[number_of_rows],
|
178
212
|
false);
|
@@ -215,29 +249,105 @@ void StringValueResult::AddValueToVector(const char *value_ptr, const idx_t size
|
|
215
249
|
false, state_machine.options.decimal_separator[0]);
|
216
250
|
break;
|
217
251
|
case LogicalTypeId::DATE: {
|
252
|
+
if (!date_format.Empty()) {
|
253
|
+
success = date_format.TryParseDate(value_ptr, size,
|
254
|
+
static_cast<date_t *>(vector_ptr[chunk_col_id])[number_of_rows]);
|
255
|
+
} else {
|
256
|
+
idx_t pos;
|
257
|
+
bool special;
|
258
|
+
success = Date::TryConvertDate(
|
259
|
+
value_ptr, size, pos, static_cast<date_t *>(vector_ptr[chunk_col_id])[number_of_rows], special, false);
|
260
|
+
}
|
261
|
+
break;
|
262
|
+
}
|
263
|
+
case LogicalTypeId::TIME: {
|
218
264
|
idx_t pos;
|
219
|
-
|
220
|
-
|
221
|
-
static_cast<date_t *>(vector_ptr[chunk_col_id])[number_of_rows], special, false);
|
265
|
+
success = Time::TryConvertTime(value_ptr, size, pos,
|
266
|
+
static_cast<dtime_t *>(vector_ptr[chunk_col_id])[number_of_rows], false);
|
222
267
|
break;
|
223
268
|
}
|
224
269
|
case LogicalTypeId::TIMESTAMP: {
|
225
|
-
|
226
|
-
|
227
|
-
|
270
|
+
if (!timestamp_format.Empty()) {
|
271
|
+
success = timestamp_format.TryParseTimestamp(
|
272
|
+
value_ptr, size, static_cast<timestamp_t *>(vector_ptr[chunk_col_id])[number_of_rows]);
|
273
|
+
} else {
|
274
|
+
success = Timestamp::TryConvertTimestamp(
|
275
|
+
value_ptr, size, static_cast<timestamp_t *>(vector_ptr[chunk_col_id])[number_of_rows]) ==
|
276
|
+
TimestampCastResult::SUCCESS;
|
277
|
+
}
|
278
|
+
break;
|
279
|
+
}
|
280
|
+
case LogicalTypeId::DECIMAL: {
|
281
|
+
if (decimal_separator == ',') {
|
282
|
+
switch (parse_types[chunk_col_id].internal_type) {
|
283
|
+
case PhysicalType::INT16:
|
284
|
+
success = TryDecimalStringCast<int16_t, ','>(
|
285
|
+
value_ptr, size, static_cast<int16_t *>(vector_ptr[chunk_col_id])[number_of_rows],
|
286
|
+
parse_types[chunk_col_id].width, parse_types[chunk_col_id].scale);
|
287
|
+
break;
|
288
|
+
case PhysicalType::INT32:
|
289
|
+
success = TryDecimalStringCast<int32_t, ','>(
|
290
|
+
value_ptr, size, static_cast<int32_t *>(vector_ptr[chunk_col_id])[number_of_rows],
|
291
|
+
parse_types[chunk_col_id].width, parse_types[chunk_col_id].scale);
|
292
|
+
break;
|
293
|
+
case PhysicalType::INT64:
|
294
|
+
success = TryDecimalStringCast<int64_t, ','>(
|
295
|
+
value_ptr, size, static_cast<int64_t *>(vector_ptr[chunk_col_id])[number_of_rows],
|
296
|
+
parse_types[chunk_col_id].width, parse_types[chunk_col_id].scale);
|
297
|
+
break;
|
298
|
+
case PhysicalType::INT128:
|
299
|
+
success = TryDecimalStringCast<hugeint_t, ','>(
|
300
|
+
value_ptr, size, static_cast<hugeint_t *>(vector_ptr[chunk_col_id])[number_of_rows],
|
301
|
+
parse_types[chunk_col_id].width, parse_types[chunk_col_id].scale);
|
302
|
+
break;
|
303
|
+
default:
|
304
|
+
throw InternalException("Invalid Physical Type for Decimal Value. Physical Type: " +
|
305
|
+
TypeIdToString(parse_types[chunk_col_id].internal_type));
|
306
|
+
}
|
307
|
+
|
308
|
+
} else if (decimal_separator == '.') {
|
309
|
+
switch (parse_types[chunk_col_id].internal_type) {
|
310
|
+
case PhysicalType::INT16:
|
311
|
+
success = TryDecimalStringCast(value_ptr, size,
|
312
|
+
static_cast<int16_t *>(vector_ptr[chunk_col_id])[number_of_rows],
|
313
|
+
parse_types[chunk_col_id].width, parse_types[chunk_col_id].scale);
|
314
|
+
break;
|
315
|
+
case PhysicalType::INT32:
|
316
|
+
success = TryDecimalStringCast(value_ptr, size,
|
317
|
+
static_cast<int32_t *>(vector_ptr[chunk_col_id])[number_of_rows],
|
318
|
+
parse_types[chunk_col_id].width, parse_types[chunk_col_id].scale);
|
319
|
+
break;
|
320
|
+
case PhysicalType::INT64:
|
321
|
+
success = TryDecimalStringCast(value_ptr, size,
|
322
|
+
static_cast<int64_t *>(vector_ptr[chunk_col_id])[number_of_rows],
|
323
|
+
parse_types[chunk_col_id].width, parse_types[chunk_col_id].scale);
|
324
|
+
break;
|
325
|
+
case PhysicalType::INT128:
|
326
|
+
success = TryDecimalStringCast(value_ptr, size,
|
327
|
+
static_cast<hugeint_t *>(vector_ptr[chunk_col_id])[number_of_rows],
|
328
|
+
parse_types[chunk_col_id].width, parse_types[chunk_col_id].scale);
|
329
|
+
break;
|
330
|
+
default:
|
331
|
+
throw InternalException("Invalid Physical Type for Decimal Value. Physical Type: " +
|
332
|
+
TypeIdToString(parse_types[chunk_col_id].internal_type));
|
333
|
+
}
|
334
|
+
} else {
|
335
|
+
throw InvalidInputException("Decimals can only have ',' and '.' as decimal separators");
|
336
|
+
}
|
228
337
|
break;
|
229
338
|
}
|
230
339
|
default: {
|
231
340
|
// By default, we add a string
|
232
341
|
// We only evaluate if a string is utf8 valid, if it's actually a varchar
|
233
|
-
if (parse_types[chunk_col_id].
|
342
|
+
if (parse_types[chunk_col_id].validate_utf8 &&
|
343
|
+
!Utf8Proc::IsValid(value_ptr, UnsafeNumericCast<uint32_t>(size))) {
|
234
344
|
bool force_error = !state_machine.options.ignore_errors.GetValue() && sniffing;
|
235
345
|
// Invalid unicode, we must error
|
236
346
|
if (force_error) {
|
237
347
|
HandleUnicodeError(cur_col_id, last_position);
|
238
348
|
}
|
239
349
|
// If we got here, we are ingoring errors, hence we must ignore this line.
|
240
|
-
current_errors.
|
350
|
+
current_errors.Insert(CSVErrorType::INVALID_UNICODE, cur_col_id, chunk_col_id, last_position);
|
241
351
|
break;
|
242
352
|
}
|
243
353
|
if (allocate) {
|
@@ -252,29 +362,20 @@ void StringValueResult::AddValueToVector(const char *value_ptr, const idx_t size
|
|
252
362
|
}
|
253
363
|
}
|
254
364
|
if (!success) {
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
365
|
+
current_errors.Insert(CSVErrorType::CAST_ERROR, cur_col_id, chunk_col_id, last_position);
|
366
|
+
if (!state_machine.options.IgnoreErrors()) {
|
367
|
+
// We have to write the cast error message.
|
368
|
+
std::ostringstream error;
|
369
|
+
// Casting Error Message
|
370
|
+
error << "Could not convert string \"" << std::string(value_ptr, size) << "\" to \'"
|
371
|
+
<< LogicalTypeIdToString(parse_types[chunk_col_id].type_id) << "\'";
|
372
|
+
current_errors.ModifyErrorMessageOfLastError(error.str());
|
373
|
+
}
|
262
374
|
}
|
263
375
|
cur_col_id++;
|
264
376
|
chunk_col_id++;
|
265
377
|
}
|
266
378
|
|
267
|
-
Value StringValueResult::GetValue(idx_t row_idx, idx_t col_idx) {
|
268
|
-
if (validity_mask[col_idx]->AllValid()) {
|
269
|
-
return Value(static_cast<string_t *>(vector_ptr[col_idx])[row_idx]);
|
270
|
-
} else {
|
271
|
-
if (validity_mask[col_idx]->RowIsValid(row_idx)) {
|
272
|
-
return Value(static_cast<string_t *>(vector_ptr[col_idx])[row_idx]);
|
273
|
-
} else {
|
274
|
-
return Value();
|
275
|
-
}
|
276
|
-
}
|
277
|
-
}
|
278
379
|
DataChunk &StringValueResult::ToChunk() {
|
279
380
|
parse_chunk.SetCardinality(number_of_rows);
|
280
381
|
return parse_chunk;
|
@@ -299,7 +400,8 @@ void StringValueResult::Reset() {
|
|
299
400
|
if (cur_buffer) {
|
300
401
|
buffer_handles[cur_buffer->buffer_idx] = cur_buffer;
|
301
402
|
}
|
302
|
-
current_errors.
|
403
|
+
current_errors.Reset();
|
404
|
+
borked_rows.clear();
|
303
405
|
}
|
304
406
|
|
305
407
|
void StringValueResult::AddQuotedValue(StringValueResult &result, const idx_t buffer_pos) {
|
@@ -312,12 +414,15 @@ void StringValueResult::AddQuotedValue(StringValueResult &result, const idx_t bu
|
|
312
414
|
return;
|
313
415
|
}
|
314
416
|
}
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
417
|
+
if (!result.HandleTooManyColumnsError(result.buffer_ptr + result.quoted_position + 1,
|
418
|
+
buffer_pos - result.quoted_position - 2)) {
|
419
|
+
// If it's an escaped value we have to remove all the escapes, this is not really great
|
420
|
+
auto value = StringValueScanner::RemoveEscape(
|
421
|
+
result.buffer_ptr + result.quoted_position + 1, buffer_pos - result.quoted_position - 2,
|
422
|
+
result.state_machine.dialect_options.state_machine_options.escape.GetValue(),
|
423
|
+
result.parse_chunk.data[result.chunk_col_id]);
|
424
|
+
result.AddValueToVector(value.GetData(), value.GetSize());
|
425
|
+
}
|
321
426
|
} else {
|
322
427
|
if (buffer_pos < result.last_position.buffer_pos + 2) {
|
323
428
|
// empty value
|
@@ -346,6 +451,7 @@ void StringValueResult::AddValue(StringValueResult &result, const idx_t buffer_p
|
|
346
451
|
}
|
347
452
|
|
348
453
|
void StringValueResult::HandleUnicodeError(idx_t col_idx, LinePosition &error_position) {
|
454
|
+
|
349
455
|
bool first_nl;
|
350
456
|
auto borked_line = current_line_position.ReconstructCurrentLine(first_nl, buffer_handles);
|
351
457
|
LinesPerBoundary lines_per_batch(iterator.GetBoundaryIdx(), lines_read);
|
@@ -362,12 +468,19 @@ void StringValueResult::HandleUnicodeError(idx_t col_idx, LinePosition &error_po
|
|
362
468
|
}
|
363
469
|
}
|
364
470
|
|
365
|
-
bool
|
471
|
+
bool LineError::HandleErrors(StringValueResult &result) {
|
472
|
+
if (ignore_errors && is_error_in_line && !result.figure_out_new_line) {
|
473
|
+
result.cur_col_id = 0;
|
474
|
+
result.chunk_col_id = 0;
|
475
|
+
result.number_of_rows--;
|
476
|
+
Reset();
|
477
|
+
return true;
|
478
|
+
}
|
366
479
|
// Reconstruct CSV Line
|
367
480
|
for (auto &cur_error : current_errors) {
|
368
|
-
LinesPerBoundary lines_per_batch(iterator.GetBoundaryIdx(), lines_read);
|
481
|
+
LinesPerBoundary lines_per_batch(result.iterator.GetBoundaryIdx(), result.lines_read);
|
369
482
|
bool first_nl;
|
370
|
-
auto borked_line = current_line_position.ReconstructCurrentLine(first_nl, buffer_handles);
|
483
|
+
auto borked_line = result.current_line_position.ReconstructCurrentLine(first_nl, result.buffer_handles);
|
371
484
|
CSVError csv_error;
|
372
485
|
auto col_idx = cur_error.col_idx;
|
373
486
|
auto &line_pos = cur_error.error_position;
|
@@ -375,74 +488,76 @@ bool StringValueResult::HandleError() {
|
|
375
488
|
switch (cur_error.type) {
|
376
489
|
case CSVErrorType::TOO_MANY_COLUMNS:
|
377
490
|
case CSVErrorType::TOO_FEW_COLUMNS:
|
378
|
-
if (current_line_position.begin == line_pos) {
|
491
|
+
if (result.current_line_position.begin == line_pos) {
|
379
492
|
csv_error = CSVError::IncorrectColumnAmountError(
|
380
|
-
state_machine.options, col_idx, lines_per_batch, borked_line,
|
381
|
-
current_line_position.begin.GetGlobalPosition(requested_size, first_nl),
|
382
|
-
line_pos.GetGlobalPosition(requested_size, first_nl));
|
493
|
+
result.state_machine.options, col_idx, lines_per_batch, borked_line,
|
494
|
+
result.current_line_position.begin.GetGlobalPosition(result.requested_size, first_nl),
|
495
|
+
line_pos.GetGlobalPosition(result.requested_size, first_nl));
|
383
496
|
} else {
|
384
497
|
csv_error = CSVError::IncorrectColumnAmountError(
|
385
|
-
state_machine.options, col_idx, lines_per_batch, borked_line,
|
386
|
-
current_line_position.begin.GetGlobalPosition(requested_size, first_nl),
|
387
|
-
line_pos.GetGlobalPosition(requested_size));
|
498
|
+
result.state_machine.options, col_idx, lines_per_batch, borked_line,
|
499
|
+
result.current_line_position.begin.GetGlobalPosition(result.requested_size, first_nl),
|
500
|
+
line_pos.GetGlobalPosition(result.requested_size));
|
388
501
|
}
|
389
502
|
break;
|
390
503
|
case CSVErrorType::INVALID_UNICODE: {
|
391
|
-
if (current_line_position.begin == line_pos) {
|
392
|
-
csv_error =
|
393
|
-
|
394
|
-
|
395
|
-
|
504
|
+
if (result.current_line_position.begin == line_pos) {
|
505
|
+
csv_error = CSVError::InvalidUTF8(
|
506
|
+
result.state_machine.options, col_idx, lines_per_batch, borked_line,
|
507
|
+
result.current_line_position.begin.GetGlobalPosition(result.requested_size, first_nl),
|
508
|
+
line_pos.GetGlobalPosition(result.requested_size, first_nl));
|
396
509
|
} else {
|
397
|
-
csv_error =
|
398
|
-
|
399
|
-
|
400
|
-
|
510
|
+
csv_error = CSVError::InvalidUTF8(
|
511
|
+
result.state_machine.options, col_idx, lines_per_batch, borked_line,
|
512
|
+
result.current_line_position.begin.GetGlobalPosition(result.requested_size, first_nl),
|
513
|
+
line_pos.GetGlobalPosition(result.requested_size));
|
401
514
|
}
|
402
515
|
break;
|
403
516
|
}
|
404
517
|
case CSVErrorType::UNTERMINATED_QUOTES:
|
405
|
-
if (current_line_position.begin == line_pos) {
|
518
|
+
if (result.current_line_position.begin == line_pos) {
|
406
519
|
csv_error = CSVError::UnterminatedQuotesError(
|
407
|
-
state_machine.options, col_idx, lines_per_batch, borked_line,
|
408
|
-
current_line_position.begin.GetGlobalPosition(requested_size, first_nl),
|
409
|
-
line_pos.GetGlobalPosition(requested_size, first_nl));
|
520
|
+
result.state_machine.options, col_idx, lines_per_batch, borked_line,
|
521
|
+
result.current_line_position.begin.GetGlobalPosition(result.requested_size, first_nl),
|
522
|
+
line_pos.GetGlobalPosition(result.requested_size, first_nl));
|
410
523
|
} else {
|
411
524
|
csv_error = CSVError::UnterminatedQuotesError(
|
412
|
-
state_machine.options, col_idx, lines_per_batch, borked_line,
|
413
|
-
current_line_position.begin.GetGlobalPosition(requested_size, first_nl),
|
414
|
-
line_pos.GetGlobalPosition(requested_size));
|
525
|
+
result.state_machine.options, col_idx, lines_per_batch, borked_line,
|
526
|
+
result.current_line_position.begin.GetGlobalPosition(result.requested_size, first_nl),
|
527
|
+
line_pos.GetGlobalPosition(result.requested_size));
|
415
528
|
}
|
416
529
|
break;
|
417
530
|
case CSVErrorType::CAST_ERROR:
|
418
|
-
if (current_line_position.begin == line_pos) {
|
531
|
+
if (result.current_line_position.begin == line_pos) {
|
419
532
|
csv_error = CSVError::CastError(
|
420
|
-
state_machine.options, names[cur_error.col_idx], cur_error.error_message,
|
421
|
-
borked_line, lines_per_batch,
|
422
|
-
current_line_position.begin.GetGlobalPosition(requested_size, first_nl),
|
423
|
-
line_pos.GetGlobalPosition(requested_size, first_nl),
|
533
|
+
result.state_machine.options, result.names[cur_error.col_idx], cur_error.error_message,
|
534
|
+
cur_error.col_idx, borked_line, lines_per_batch,
|
535
|
+
result.current_line_position.begin.GetGlobalPosition(result.requested_size, first_nl),
|
536
|
+
line_pos.GetGlobalPosition(result.requested_size, first_nl),
|
537
|
+
result.parse_types[cur_error.chunk_idx].type_id);
|
424
538
|
} else {
|
425
539
|
csv_error = CSVError::CastError(
|
426
|
-
state_machine.options, names[cur_error.col_idx], cur_error.error_message,
|
427
|
-
borked_line, lines_per_batch,
|
428
|
-
current_line_position.begin.GetGlobalPosition(requested_size, first_nl),
|
429
|
-
line_pos.GetGlobalPosition(requested_size), parse_types[cur_error.
|
540
|
+
result.state_machine.options, result.names[cur_error.col_idx], cur_error.error_message,
|
541
|
+
cur_error.col_idx, borked_line, lines_per_batch,
|
542
|
+
result.current_line_position.begin.GetGlobalPosition(result.requested_size, first_nl),
|
543
|
+
line_pos.GetGlobalPosition(result.requested_size), result.parse_types[cur_error.chunk_idx].type_id);
|
430
544
|
}
|
431
545
|
break;
|
432
546
|
case CSVErrorType::MAXIMUM_LINE_SIZE:
|
433
547
|
csv_error = CSVError::LineSizeError(
|
434
|
-
state_machine.options, cur_error.current_line_size, lines_per_batch, borked_line,
|
435
|
-
current_line_position.begin.GetGlobalPosition(requested_size, first_nl));
|
548
|
+
result.state_machine.options, cur_error.current_line_size, lines_per_batch, borked_line,
|
549
|
+
result.current_line_position.begin.GetGlobalPosition(result.requested_size, first_nl));
|
436
550
|
break;
|
437
551
|
default:
|
438
552
|
throw InvalidInputException("CSV Error not allowed when inserting row");
|
439
553
|
}
|
440
|
-
error_handler.Error(csv_error);
|
554
|
+
result.error_handler.Error(csv_error);
|
441
555
|
}
|
442
|
-
if (
|
443
|
-
|
444
|
-
cur_col_id = 0;
|
445
|
-
chunk_col_id = 0;
|
556
|
+
if (is_error_in_line) {
|
557
|
+
result.borked_rows.insert(result.number_of_rows);
|
558
|
+
result.cur_col_id = 0;
|
559
|
+
result.chunk_col_id = 0;
|
560
|
+
Reset();
|
446
561
|
return true;
|
447
562
|
}
|
448
563
|
return false;
|
@@ -510,16 +625,21 @@ bool StringValueResult::AddRowInternal() {
|
|
510
625
|
current_line_position.begin = current_line_position.end;
|
511
626
|
current_line_position.end = current_line_start;
|
512
627
|
if (current_line_size > state_machine.options.maximum_line_size) {
|
513
|
-
current_errors.
|
514
|
-
current_errors.back().current_line_size = current_line_size;
|
628
|
+
current_errors.Insert(CSVErrorType::MAXIMUM_LINE_SIZE, 1, chunk_col_id, last_position, current_line_size);
|
515
629
|
}
|
516
|
-
if (!
|
517
|
-
// We need to add a few columns error
|
630
|
+
if (!state_machine.options.null_padding) {
|
518
631
|
for (idx_t col_idx = cur_col_id; col_idx < number_of_columns; col_idx++) {
|
519
|
-
current_errors.
|
632
|
+
current_errors.Insert(CSVErrorType::TOO_FEW_COLUMNS, col_idx - 1, chunk_col_id, last_position);
|
520
633
|
}
|
521
634
|
}
|
522
|
-
|
635
|
+
|
636
|
+
if (current_errors.HandleErrors(*this)) {
|
637
|
+
line_positions_per_row[number_of_rows] = current_line_position;
|
638
|
+
number_of_rows++;
|
639
|
+
if (number_of_rows >= result_size) {
|
640
|
+
// We have a full chunk
|
641
|
+
return true;
|
642
|
+
}
|
523
643
|
return false;
|
524
644
|
}
|
525
645
|
NullPaddingQuotedNewlineCheck();
|
@@ -550,21 +670,23 @@ bool StringValueResult::AddRowInternal() {
|
|
550
670
|
}
|
551
671
|
} else {
|
552
672
|
// If we are not null-padding this is an error
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
673
|
+
if (!state_machine.options.IgnoreErrors()) {
|
674
|
+
bool first_nl;
|
675
|
+
auto borked_line = current_line_position.ReconstructCurrentLine(first_nl, buffer_handles);
|
676
|
+
LinesPerBoundary lines_per_batch(iterator.GetBoundaryIdx(), lines_read);
|
677
|
+
if (current_line_position.begin == last_position) {
|
678
|
+
auto csv_error = CSVError::IncorrectColumnAmountError(
|
679
|
+
state_machine.options, cur_col_id - 1, lines_per_batch, borked_line,
|
680
|
+
current_line_position.begin.GetGlobalPosition(requested_size, first_nl),
|
681
|
+
last_position.GetGlobalPosition(requested_size, first_nl));
|
682
|
+
error_handler.Error(csv_error);
|
683
|
+
} else {
|
684
|
+
auto csv_error = CSVError::IncorrectColumnAmountError(
|
685
|
+
state_machine.options, cur_col_id - 1, lines_per_batch, borked_line,
|
686
|
+
current_line_position.begin.GetGlobalPosition(requested_size, first_nl),
|
687
|
+
last_position.GetGlobalPosition(requested_size));
|
688
|
+
error_handler.Error(csv_error);
|
689
|
+
}
|
568
690
|
}
|
569
691
|
// If we are here we ignore_errors, so we delete this line
|
570
692
|
number_of_rows--;
|
@@ -612,7 +734,8 @@ void StringValueResult::InvalidState(StringValueResult &result) {
|
|
612
734
|
if (force_error) {
|
613
735
|
result.HandleUnicodeError(result.cur_col_id, result.last_position);
|
614
736
|
}
|
615
|
-
result.current_errors.
|
737
|
+
result.current_errors.Insert(CSVErrorType::UNTERMINATED_QUOTES, result.cur_col_id, result.chunk_col_id,
|
738
|
+
result.last_position);
|
616
739
|
}
|
617
740
|
|
618
741
|
bool StringValueResult::EmptyLine(StringValueResult &result, const idx_t buffer_pos) {
|
@@ -649,10 +772,10 @@ StringValueScanner::StringValueScanner(idx_t scanner_idx_p, const shared_ptr<CSV
|
|
649
772
|
const shared_ptr<CSVStateMachine> &state_machine,
|
650
773
|
const shared_ptr<CSVErrorHandler> &error_handler,
|
651
774
|
const shared_ptr<CSVFileScan> &csv_file_scan, bool sniffing,
|
652
|
-
CSVIterator boundary,
|
775
|
+
CSVIterator boundary, bool figure_out_nl)
|
653
776
|
: BaseScanner(buffer_manager, state_machine, error_handler, sniffing, csv_file_scan, boundary),
|
654
777
|
scanner_idx(scanner_idx_p),
|
655
|
-
result(states, *state_machine, cur_buffer_handle, BufferAllocator::Get(buffer_manager->context),
|
778
|
+
result(states, *state_machine, cur_buffer_handle, BufferAllocator::Get(buffer_manager->context), figure_out_nl,
|
656
779
|
iterator.pos.buffer_pos, *error_handler, iterator,
|
657
780
|
buffer_manager->context.client_data->debug_set_max_line_length, csv_file_scan, lines_read, sniffing) {
|
658
781
|
}
|
@@ -661,20 +784,20 @@ StringValueScanner::StringValueScanner(const shared_ptr<CSVBufferManager> &buffe
|
|
661
784
|
const shared_ptr<CSVStateMachine> &state_machine,
|
662
785
|
const shared_ptr<CSVErrorHandler> &error_handler)
|
663
786
|
: BaseScanner(buffer_manager, state_machine, error_handler, false, nullptr, {}), scanner_idx(0),
|
664
|
-
result(states, *state_machine, cur_buffer_handle, Allocator::DefaultAllocator(),
|
665
|
-
|
666
|
-
|
787
|
+
result(states, *state_machine, cur_buffer_handle, Allocator::DefaultAllocator(), false, iterator.pos.buffer_pos,
|
788
|
+
*error_handler, iterator, buffer_manager->context.client_data->debug_set_max_line_length, csv_file_scan,
|
789
|
+
lines_read, sniffing) {
|
667
790
|
}
|
668
791
|
|
669
792
|
unique_ptr<StringValueScanner> StringValueScanner::GetCSVScanner(ClientContext &context, CSVReaderOptions &options) {
|
670
|
-
auto state_machine =
|
671
|
-
|
793
|
+
auto state_machine = make_shared_ptr<CSVStateMachine>(options, options.dialect_options.state_machine_options,
|
794
|
+
CSVStateMachineCache::Get(context));
|
672
795
|
|
673
796
|
state_machine->dialect_options.num_cols = options.dialect_options.num_cols;
|
674
797
|
state_machine->dialect_options.header = options.dialect_options.header;
|
675
|
-
auto buffer_manager =
|
676
|
-
auto scanner = make_uniq<StringValueScanner>(buffer_manager, state_machine,
|
677
|
-
scanner->csv_file_scan =
|
798
|
+
auto buffer_manager = make_shared_ptr<CSVBufferManager>(context, options, options.file_path, 0);
|
799
|
+
auto scanner = make_uniq<StringValueScanner>(buffer_manager, state_machine, make_shared_ptr<CSVErrorHandler>());
|
800
|
+
scanner->csv_file_scan = make_shared_ptr<CSVFileScan>(context, options.file_path, options);
|
678
801
|
scanner->csv_file_scan->InitializeProjection();
|
679
802
|
return scanner;
|
680
803
|
}
|
@@ -695,7 +818,6 @@ void StringValueScanner::Flush(DataChunk &insert_chunk) {
|
|
695
818
|
auto &parse_chunk = process_result.ToChunk();
|
696
819
|
// We have to check if we got to error
|
697
820
|
error_handler->ErrorIfNeeded();
|
698
|
-
|
699
821
|
if (parse_chunk.size() == 0) {
|
700
822
|
return;
|
701
823
|
}
|
@@ -703,7 +825,6 @@ void StringValueScanner::Flush(DataChunk &insert_chunk) {
|
|
703
825
|
insert_chunk.SetCardinality(parse_chunk);
|
704
826
|
|
705
827
|
// We keep track of the borked lines, in case we are ignoring errors
|
706
|
-
unordered_set<idx_t> borked_lines;
|
707
828
|
D_ASSERT(csv_file_scan);
|
708
829
|
|
709
830
|
auto &reader_data = csv_file_scan->reader_data;
|
@@ -726,41 +847,9 @@ void StringValueScanner::Flush(DataChunk &insert_chunk) {
|
|
726
847
|
result_vector.Reinterpret(parse_vector);
|
727
848
|
} else {
|
728
849
|
string error_message;
|
729
|
-
CastParameters parameters(false, &error_message);
|
730
|
-
bool success;
|
731
850
|
idx_t line_error = 0;
|
732
|
-
|
733
|
-
|
734
|
-
if (!state_machine->options.dialect_options.date_format.at(LogicalTypeId::DATE).GetValue().Empty() &&
|
735
|
-
type.id() == LogicalTypeId::DATE) {
|
736
|
-
// use the date format to cast the chunk
|
737
|
-
success = CSVCast::TryCastDateVector(state_machine->options.dialect_options.date_format, parse_vector,
|
738
|
-
result_vector, parse_chunk.size(), parameters, line_error, true);
|
739
|
-
} else if (!state_machine->options.dialect_options.date_format.at(LogicalTypeId::TIMESTAMP)
|
740
|
-
.GetValue()
|
741
|
-
.Empty() &&
|
742
|
-
type.id() == LogicalTypeId::TIMESTAMP) {
|
743
|
-
// use the date format to cast the chunk
|
744
|
-
success =
|
745
|
-
CSVCast::TryCastTimestampVector(state_machine->options.dialect_options.date_format, parse_vector,
|
746
|
-
result_vector, parse_chunk.size(), parameters, true);
|
747
|
-
} else if (state_machine->options.decimal_separator != "." &&
|
748
|
-
(type.id() == LogicalTypeId::FLOAT || type.id() == LogicalTypeId::DOUBLE)) {
|
749
|
-
success =
|
750
|
-
CSVCast::TryCastFloatingVectorCommaSeparated(state_machine->options, parse_vector, result_vector,
|
751
|
-
parse_chunk.size(), parameters, type, line_error);
|
752
|
-
} else if (state_machine->options.decimal_separator != "." && type.id() == LogicalTypeId::DECIMAL) {
|
753
|
-
success =
|
754
|
-
CSVCast::TryCastDecimalVectorCommaSeparated(state_machine->options, parse_vector, result_vector,
|
755
|
-
parse_chunk.size(), parameters, type, line_error);
|
756
|
-
|
757
|
-
} else {
|
758
|
-
// target type is not varchar: perform a cast
|
759
|
-
success = VectorOperations::TryCast(buffer_manager->context, parse_vector, result_vector,
|
760
|
-
parse_chunk.size(), &error_message, false, true);
|
761
|
-
line_error_set = false;
|
762
|
-
}
|
763
|
-
if (success) {
|
851
|
+
if (VectorOperations::TryCast(buffer_manager->context, parse_vector, result_vector, parse_chunk.size(),
|
852
|
+
&error_message, false, true)) {
|
764
853
|
continue;
|
765
854
|
}
|
766
855
|
// An error happened, to propagate it we need to figure out the exact line where the casting failed.
|
@@ -768,12 +857,11 @@ void StringValueScanner::Flush(DataChunk &insert_chunk) {
|
|
768
857
|
result_vector.ToUnifiedFormat(parse_chunk.size(), inserted_column_data);
|
769
858
|
UnifiedVectorFormat parse_column_data;
|
770
859
|
parse_vector.ToUnifiedFormat(parse_chunk.size(), parse_column_data);
|
771
|
-
|
772
|
-
|
773
|
-
|
774
|
-
|
775
|
-
|
776
|
-
}
|
860
|
+
|
861
|
+
for (; line_error < parse_chunk.size(); line_error++) {
|
862
|
+
if (!inserted_column_data.validity.RowIsValid(line_error) &&
|
863
|
+
parse_column_data.validity.RowIsValid(line_error)) {
|
864
|
+
break;
|
777
865
|
}
|
778
866
|
}
|
779
867
|
{
|
@@ -784,52 +872,64 @@ void StringValueScanner::Flush(DataChunk &insert_chunk) {
|
|
784
872
|
row.push_back(parse_chunk.GetValue(col, line_error));
|
785
873
|
}
|
786
874
|
}
|
787
|
-
|
788
|
-
|
789
|
-
|
790
|
-
|
791
|
-
|
792
|
-
|
793
|
-
|
794
|
-
|
795
|
-
|
796
|
-
|
797
|
-
|
798
|
-
|
799
|
-
|
875
|
+
if (!state_machine->options.IgnoreErrors()) {
|
876
|
+
LinesPerBoundary lines_per_batch(iterator.GetBoundaryIdx(),
|
877
|
+
lines_read - parse_chunk.size() + line_error);
|
878
|
+
bool first_nl;
|
879
|
+
auto borked_line = result.line_positions_per_row[line_error].ReconstructCurrentLine(
|
880
|
+
first_nl, result.buffer_handles);
|
881
|
+
std::ostringstream error;
|
882
|
+
error << "Could not convert string \"" << parse_vector.GetValue(line_error) << "\" to \'"
|
883
|
+
<< LogicalTypeIdToString(type.id()) << "\'";
|
884
|
+
string error_msg = error.str();
|
885
|
+
auto csv_error = CSVError::CastError(
|
886
|
+
state_machine->options, csv_file_scan->names[col_idx], error_msg, col_idx, borked_line,
|
887
|
+
lines_per_batch,
|
888
|
+
result.line_positions_per_row[line_error].begin.GetGlobalPosition(result.result_size, first_nl),
|
889
|
+
optional_idx::Invalid(), result_vector.GetType().id());
|
890
|
+
error_handler->Error(csv_error);
|
891
|
+
}
|
800
892
|
}
|
801
|
-
|
893
|
+
result.borked_rows.insert(line_error++);
|
802
894
|
D_ASSERT(state_machine->options.ignore_errors.GetValue());
|
803
895
|
// We are ignoring errors. We must continue but ignoring borked rows
|
804
896
|
for (; line_error < parse_chunk.size(); line_error++) {
|
805
897
|
if (!inserted_column_data.validity.RowIsValid(line_error) &&
|
806
898
|
parse_column_data.validity.RowIsValid(line_error)) {
|
807
|
-
|
899
|
+
result.borked_rows.insert(line_error);
|
808
900
|
vector<Value> row;
|
809
901
|
for (idx_t col = 0; col < parse_chunk.ColumnCount(); col++) {
|
810
902
|
row.push_back(parse_chunk.GetValue(col, line_error));
|
811
903
|
}
|
812
|
-
|
813
|
-
|
814
|
-
|
815
|
-
|
816
|
-
|
817
|
-
|
818
|
-
|
819
|
-
|
820
|
-
|
821
|
-
|
822
|
-
|
904
|
+
if (!state_machine->options.IgnoreErrors()) {
|
905
|
+
LinesPerBoundary lines_per_batch(iterator.GetBoundaryIdx(),
|
906
|
+
lines_read - parse_chunk.size() + line_error);
|
907
|
+
bool first_nl;
|
908
|
+
auto borked_line = result.line_positions_per_row[line_error].ReconstructCurrentLine(
|
909
|
+
first_nl, result.buffer_handles);
|
910
|
+
std::ostringstream error;
|
911
|
+
// Casting Error Message
|
912
|
+
error << "Could not convert string \"" << parse_vector.GetValue(line_error) << "\" to \'"
|
913
|
+
<< LogicalTypeIdToString(type.id()) << "\'";
|
914
|
+
string error_msg = error.str();
|
915
|
+
auto csv_error =
|
916
|
+
CSVError::CastError(state_machine->options, csv_file_scan->names[col_idx], error_msg,
|
917
|
+
col_idx, borked_line, lines_per_batch,
|
918
|
+
result.line_positions_per_row[line_error].begin.GetGlobalPosition(
|
919
|
+
result.result_size, first_nl),
|
920
|
+
optional_idx::Invalid(), result_vector.GetType().id());
|
921
|
+
error_handler->Error(csv_error);
|
922
|
+
}
|
823
923
|
}
|
824
924
|
}
|
825
925
|
}
|
826
926
|
}
|
827
|
-
if (!
|
927
|
+
if (!result.borked_rows.empty()) {
|
828
928
|
// We must remove the borked lines from our chunk
|
829
|
-
SelectionVector succesful_rows(parse_chunk.size()
|
929
|
+
SelectionVector succesful_rows(parse_chunk.size());
|
830
930
|
idx_t sel_idx = 0;
|
831
931
|
for (idx_t row_idx = 0; row_idx < parse_chunk.size(); row_idx++) {
|
832
|
-
if (
|
932
|
+
if (result.borked_rows.find(row_idx) == result.borked_rows.end()) {
|
833
933
|
succesful_rows.set_index(sel_idx++, row_idx);
|
834
934
|
}
|
835
935
|
}
|
@@ -1131,26 +1231,6 @@ void StringValueScanner::SkipBOM() {
|
|
1131
1231
|
}
|
1132
1232
|
}
|
1133
1233
|
|
1134
|
-
void StringValueScanner::SkipCSVRows() {
|
1135
|
-
idx_t rows_to_skip =
|
1136
|
-
state_machine->dialect_options.skip_rows.GetValue() + state_machine->dialect_options.header.GetValue();
|
1137
|
-
if (rows_to_skip == 0) {
|
1138
|
-
return;
|
1139
|
-
}
|
1140
|
-
SkipScanner row_skipper(buffer_manager, state_machine, error_handler, rows_to_skip);
|
1141
|
-
row_skipper.ParseChunk();
|
1142
|
-
iterator.pos.buffer_pos = row_skipper.GetIteratorPosition();
|
1143
|
-
if (row_skipper.state_machine->options.dialect_options.state_machine_options.new_line ==
|
1144
|
-
NewLineIdentifier::CARRY_ON &&
|
1145
|
-
row_skipper.states.states[1] == CSVState::CARRIAGE_RETURN) {
|
1146
|
-
iterator.pos.buffer_pos++;
|
1147
|
-
}
|
1148
|
-
if (result.store_line_size) {
|
1149
|
-
result.error_handler.NewMaxLineSize(iterator.pos.buffer_pos);
|
1150
|
-
}
|
1151
|
-
lines_read += row_skipper.GetLinesRead();
|
1152
|
-
}
|
1153
|
-
|
1154
1234
|
void StringValueScanner::SkipUntilNewLine() {
|
1155
1235
|
// Now skip until next newline
|
1156
1236
|
if (state_machine->options.dialect_options.state_machine_options.new_line.GetValue() ==
|
@@ -1181,11 +1261,9 @@ void StringValueScanner::SkipUntilNewLine() {
|
|
1181
1261
|
}
|
1182
1262
|
}
|
1183
1263
|
|
1184
|
-
bool StringValueScanner::CanDirectlyCast(const LogicalType &type
|
1185
|
-
const map<LogicalTypeId, CSVOption<StrpTimeFormat>> &format_options) {
|
1264
|
+
bool StringValueScanner::CanDirectlyCast(const LogicalType &type) {
|
1186
1265
|
|
1187
1266
|
switch (type.id()) {
|
1188
|
-
// All Integers (Except HugeInt)
|
1189
1267
|
case LogicalTypeId::TINYINT:
|
1190
1268
|
case LogicalTypeId::SMALLINT:
|
1191
1269
|
case LogicalTypeId::INTEGER:
|
@@ -1196,20 +1274,10 @@ bool StringValueScanner::CanDirectlyCast(const LogicalType &type,
|
|
1196
1274
|
case LogicalTypeId::UBIGINT:
|
1197
1275
|
case LogicalTypeId::DOUBLE:
|
1198
1276
|
case LogicalTypeId::FLOAT:
|
1199
|
-
return true;
|
1200
1277
|
case LogicalTypeId::DATE:
|
1201
|
-
// We can only internally cast YYYY-MM-DD
|
1202
|
-
if (format_options.at(LogicalTypeId::DATE).GetValue().format_specifier == "%Y-%m-%d") {
|
1203
|
-
return true;
|
1204
|
-
} else {
|
1205
|
-
return false;
|
1206
|
-
}
|
1207
1278
|
case LogicalTypeId::TIMESTAMP:
|
1208
|
-
|
1209
|
-
|
1210
|
-
} else {
|
1211
|
-
return false;
|
1212
|
-
}
|
1279
|
+
case LogicalTypeId::TIME:
|
1280
|
+
case LogicalTypeId::DECIMAL:
|
1213
1281
|
case LogicalType::VARCHAR:
|
1214
1282
|
return true;
|
1215
1283
|
default:
|
@@ -1223,7 +1291,11 @@ void StringValueScanner::SetStart() {
|
|
1223
1291
|
// This CSV is not from auto-detect, so we don't know where exactly it starts
|
1224
1292
|
// Hence we potentially have to skip empty lines and headers.
|
1225
1293
|
SkipBOM();
|
1226
|
-
SkipCSVRows()
|
1294
|
+
SkipCSVRows(state_machine->dialect_options.skip_rows.GetValue() +
|
1295
|
+
state_machine->dialect_options.header.GetValue());
|
1296
|
+
if (result.store_line_size) {
|
1297
|
+
result.error_handler.NewMaxLineSize(iterator.pos.buffer_pos);
|
1298
|
+
}
|
1227
1299
|
return;
|
1228
1300
|
}
|
1229
1301
|
// We have to look for a new line that fits our schema
|
@@ -1236,12 +1308,13 @@ void StringValueScanner::SetStart() {
|
|
1236
1308
|
// When Null Padding, we assume we start from the correct new-line
|
1237
1309
|
return;
|
1238
1310
|
}
|
1239
|
-
|
1240
|
-
|
1241
|
-
|
1311
|
+
scan_finder =
|
1312
|
+
make_uniq<StringValueScanner>(0U, buffer_manager, state_machine, make_shared_ptr<CSVErrorHandler>(true),
|
1313
|
+
csv_file_scan, false, iterator, true);
|
1242
1314
|
auto &tuples = scan_finder->ParseChunk();
|
1243
1315
|
line_found = true;
|
1244
|
-
if (tuples.number_of_rows != 1
|
1316
|
+
if (tuples.number_of_rows != 1 ||
|
1317
|
+
(!tuples.borked_rows.empty() && !state_machine->options.ignore_errors.GetValue())) {
|
1245
1318
|
line_found = false;
|
1246
1319
|
// If no tuples were parsed, this is not the correct start, we need to skip until the next new line
|
1247
1320
|
// Or if columns don't match, this is not the correct start, we need to skip until the next new line
|
@@ -1256,16 +1329,7 @@ void StringValueScanner::SetStart() {
|
|
1256
1329
|
}
|
1257
1330
|
}
|
1258
1331
|
if (iterator.pos.buffer_pos == cur_buffer_handle->actual_size ||
|
1259
|
-
scan_finder->iterator.GetBufferIdx()
|
1260
|
-
// Propagate any errors
|
1261
|
-
if (!scan_finder->error_handler->errors.empty() && state_machine->options.ignore_errors.GetValue()) {
|
1262
|
-
for (auto &error_vector : scan_finder->error_handler->errors) {
|
1263
|
-
for (auto &error : error_vector.second) {
|
1264
|
-
error_handler->Error(error);
|
1265
|
-
}
|
1266
|
-
}
|
1267
|
-
result.lines_read++;
|
1268
|
-
}
|
1332
|
+
scan_finder->iterator.GetBufferIdx() > iterator.GetBufferIdx()) {
|
1269
1333
|
// If things go terribly wrong, we never loop indefinetly.
|
1270
1334
|
iterator.pos.buffer_idx = scan_finder->iterator.pos.buffer_idx;
|
1271
1335
|
iterator.pos.buffer_pos = scan_finder->iterator.pos.buffer_pos;
|
@@ -1275,15 +1339,6 @@ void StringValueScanner::SetStart() {
|
|
1275
1339
|
}
|
1276
1340
|
}
|
1277
1341
|
} while (!line_found);
|
1278
|
-
// Propagate any errors
|
1279
|
-
if (!scan_finder->error_handler->errors.empty() && state_machine->options.ignore_errors.GetValue()) {
|
1280
|
-
for (auto &error_vector : scan_finder->error_handler->errors) {
|
1281
|
-
for (auto &error : error_vector.second) {
|
1282
|
-
error_handler->Error(error);
|
1283
|
-
}
|
1284
|
-
}
|
1285
|
-
result.lines_read++;
|
1286
|
-
}
|
1287
1342
|
iterator.pos.buffer_idx = scan_finder->result.current_line_position.begin.buffer_idx;
|
1288
1343
|
iterator.pos.buffer_pos = scan_finder->result.current_line_position.begin.buffer_pos;
|
1289
1344
|
result.last_position = {iterator.pos.buffer_idx, iterator.pos.buffer_pos, result.buffer_size};
|
@@ -1303,12 +1358,9 @@ void StringValueScanner::FinalizeChunkProcess() {
|
|
1303
1358
|
// If we are not done we have two options.
|
1304
1359
|
// 1) If a boundary is set.
|
1305
1360
|
if (iterator.IsBoundarySet()) {
|
1306
|
-
|
1307
|
-
|
1308
|
-
iterator.done = true;
|
1309
|
-
}
|
1361
|
+
if (!result.current_errors.HasErrorType(CSVErrorType::UNTERMINATED_QUOTES)) {
|
1362
|
+
iterator.done = true;
|
1310
1363
|
}
|
1311
|
-
|
1312
1364
|
// We read until the next line or until we have nothing else to read.
|
1313
1365
|
// Move to next buffer
|
1314
1366
|
if (!cur_buffer_handle) {
|
@@ -1325,7 +1377,7 @@ void StringValueScanner::FinalizeChunkProcess() {
|
|
1325
1377
|
MoveToNextBuffer();
|
1326
1378
|
}
|
1327
1379
|
} else {
|
1328
|
-
result.
|
1380
|
+
result.current_errors.HandleErrors(result);
|
1329
1381
|
}
|
1330
1382
|
if (!iterator.done) {
|
1331
1383
|
if (iterator.pos.buffer_pos >= iterator.GetEndPos() || iterator.pos.buffer_idx > iterator.GetBufferIdx() ||
|