duckdb 0.10.3-dev3.0 → 0.10.3-dev8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/binding.gyp +4 -5
- 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 +271 -126
- 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 +129 -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 +230 -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 +12 -0
- 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 +29 -12
- package/src/duckdb/src/common/multi_file_list.cpp +285 -0
- package/src/duckdb/src/common/multi_file_reader.cpp +112 -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/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 +69 -162
- 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 +2 -0
- package/src/duckdb/src/core_functions/aggregate/holistic/mode.cpp +2 -2
- package/src/duckdb/src/core_functions/aggregate/holistic/quantile.cpp +8 -5
- 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_to_file.cpp +70 -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_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 +48 -6
- 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 +3 -3
- 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 +42 -0
- package/src/duckdb/src/include/duckdb/common/enum_util.hpp +43 -3
- package/src/duckdb/src/include/duckdb/common/enums/checkpoint_type.hpp +38 -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 +132 -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 +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 +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_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 +1 -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 +36 -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 +47 -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_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_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 +15 -11
- package/src/duckdb/src/main/appender.cpp +3 -1
- package/src/duckdb/src/main/attached_database.cpp +5 -3
- 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/table_function-c.cpp +1 -1
- 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 +71 -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 +396 -17
- package/src/duckdb/src/main/extension/extension_install.cpp +297 -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 +137 -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 +1 -1
- 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/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 +0 -2
- 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 +7 -3
- package/src/duckdb/src/planner/binder/statement/bind_copy_database.cpp +21 -68
- package/src/duckdb/src/planner/binder/statement/bind_create.cpp +141 -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.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_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 +56 -43
- 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/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
@@ -1142,7 +1142,7 @@ timestamp_t CastTimestampUsToMs::Operation(timestamp_t input) {
|
|
1142
1142
|
if (!Timestamp::IsFinite(input)) {
|
1143
1143
|
return input;
|
1144
1144
|
}
|
1145
|
-
timestamp_t cast_timestamp(Timestamp::
|
1145
|
+
timestamp_t cast_timestamp(Timestamp::GetEpochRounded(input, Interval::MICROS_PER_MSEC));
|
1146
1146
|
return cast_timestamp;
|
1147
1147
|
}
|
1148
1148
|
|
@@ -1160,7 +1160,7 @@ timestamp_t CastTimestampUsToSec::Operation(timestamp_t input) {
|
|
1160
1160
|
if (!Timestamp::IsFinite(input)) {
|
1161
1161
|
return input;
|
1162
1162
|
}
|
1163
|
-
timestamp_t cast_timestamp(Timestamp::
|
1163
|
+
timestamp_t cast_timestamp(Timestamp::GetEpochRounded(input, Interval::MICROS_PER_SEC));
|
1164
1164
|
return cast_timestamp;
|
1165
1165
|
}
|
1166
1166
|
|
@@ -1279,10 +1279,7 @@ bool TryCastToTimestampMS::Operation(string_t input, timestamp_t &result, bool s
|
|
1279
1279
|
if (!TryCast::Operation<string_t, timestamp_t>(input, result, strict)) {
|
1280
1280
|
return false;
|
1281
1281
|
}
|
1282
|
-
|
1283
|
-
return true;
|
1284
|
-
}
|
1285
|
-
result = Timestamp::GetEpochMs(result);
|
1282
|
+
result = CastTimestampUsToMs::Operation<timestamp_t, timestamp_t>(result);
|
1286
1283
|
return true;
|
1287
1284
|
}
|
1288
1285
|
|
@@ -1291,10 +1288,7 @@ bool TryCastToTimestampSec::Operation(string_t input, timestamp_t &result, bool
|
|
1291
1288
|
if (!TryCast::Operation<string_t, timestamp_t>(input, result, strict)) {
|
1292
1289
|
return false;
|
1293
1290
|
}
|
1294
|
-
|
1295
|
-
return true;
|
1296
|
-
}
|
1297
|
-
result = Timestamp::GetEpochSeconds(result);
|
1291
|
+
result = CastTimestampUsToSec::Operation<timestamp_t, timestamp_t>(result);
|
1298
1292
|
return true;
|
1299
1293
|
}
|
1300
1294
|
|
@@ -1588,17 +1582,18 @@ bool TryCastErrorMessage::Operation(string_t input, interval_t &result, CastPara
|
|
1588
1582
|
// when that value is full, we perform a HUGEINT multiplication to flush it into the hugeint
|
1589
1583
|
// this takes the number of HUGEINT multiplications down from [0-38] to [0-2]
|
1590
1584
|
|
1591
|
-
template <typename T, typename OP>
|
1585
|
+
template <typename T, typename OP, typename INTERMEDIATE_T>
|
1592
1586
|
struct HugeIntCastData {
|
1593
1587
|
using ResultType = T;
|
1588
|
+
using IntermediateType = INTERMEDIATE_T;
|
1594
1589
|
using Operation = OP;
|
1595
1590
|
ResultType result;
|
1596
|
-
|
1591
|
+
IntermediateType intermediate;
|
1597
1592
|
uint8_t digits;
|
1598
1593
|
|
1599
1594
|
ResultType decimal;
|
1600
1595
|
uint16_t decimal_total_digits;
|
1601
|
-
|
1596
|
+
ResultType decimal_intermediate;
|
1602
1597
|
uint16_t decimal_intermediate_digits;
|
1603
1598
|
|
1604
1599
|
bool Flush() {
|
@@ -1647,7 +1642,8 @@ struct HugeIntegerCastOperation {
|
|
1647
1642
|
template <class T, bool NEGATIVE>
|
1648
1643
|
static bool HandleDigit(T &state, uint8_t digit) {
|
1649
1644
|
if (NEGATIVE) {
|
1650
|
-
if (DUCKDB_UNLIKELY(state.intermediate <
|
1645
|
+
if (DUCKDB_UNLIKELY(state.intermediate <
|
1646
|
+
(NumericLimits<typename T::IntermediateType>::Minimum() + digit) / 10)) {
|
1651
1647
|
// intermediate is full: need to flush it
|
1652
1648
|
if (!state.Flush()) {
|
1653
1649
|
return false;
|
@@ -1655,7 +1651,8 @@ struct HugeIntegerCastOperation {
|
|
1655
1651
|
}
|
1656
1652
|
state.intermediate = state.intermediate * 10 - digit;
|
1657
1653
|
} else {
|
1658
|
-
if (DUCKDB_UNLIKELY(state.intermediate >
|
1654
|
+
if (DUCKDB_UNLIKELY(state.intermediate >
|
1655
|
+
(NumericLimits<typename T::IntermediateType>::Maximum() - digit) / 10)) {
|
1659
1656
|
if (!state.Flush()) {
|
1660
1657
|
return false;
|
1661
1658
|
}
|
@@ -1694,10 +1691,14 @@ struct HugeIntegerCastOperation {
|
|
1694
1691
|
if (e < 0) {
|
1695
1692
|
state.result = T::Operation::DivMod(state.result, T::Operation::POWERS_OF_TEN[-e], remainder);
|
1696
1693
|
if (remainder < 0) {
|
1697
|
-
|
1694
|
+
result_t negate_result;
|
1695
|
+
if (!T::Operation::TryNegate(remainder, negate_result)) {
|
1696
|
+
return false;
|
1697
|
+
}
|
1698
|
+
remainder = negate_result;
|
1698
1699
|
}
|
1699
1700
|
state.decimal = remainder;
|
1700
|
-
state.decimal_total_digits =
|
1701
|
+
state.decimal_total_digits = static_cast<uint16_t>(-e);
|
1701
1702
|
state.decimal_intermediate = 0;
|
1702
1703
|
state.decimal_intermediate_digits = 0;
|
1703
1704
|
return Finalize<T, NEGATIVE>(state);
|
@@ -1785,8 +1786,8 @@ struct HugeIntegerCastOperation {
|
|
1785
1786
|
|
1786
1787
|
template <>
|
1787
1788
|
bool TryCast::Operation(string_t input, hugeint_t &result, bool strict) {
|
1788
|
-
HugeIntCastData<hugeint_t, Hugeint> state {};
|
1789
|
-
if (!TryIntegerCast<HugeIntCastData<hugeint_t, Hugeint>, true, true, HugeIntegerCastOperation>(
|
1789
|
+
HugeIntCastData<hugeint_t, Hugeint, int64_t> state {};
|
1790
|
+
if (!TryIntegerCast<HugeIntCastData<hugeint_t, Hugeint, int64_t>, true, true, HugeIntegerCastOperation>(
|
1790
1791
|
input.GetData(), input.GetSize(), state, strict)) {
|
1791
1792
|
return false;
|
1792
1793
|
}
|
@@ -1796,8 +1797,8 @@ bool TryCast::Operation(string_t input, hugeint_t &result, bool strict) {
|
|
1796
1797
|
|
1797
1798
|
template <>
|
1798
1799
|
bool TryCast::Operation(string_t input, uhugeint_t &result, bool strict) {
|
1799
|
-
HugeIntCastData<uhugeint_t, Uhugeint> state {};
|
1800
|
-
if (!TryIntegerCast<HugeIntCastData<uhugeint_t, Uhugeint>, false, true, HugeIntegerCastOperation>(
|
1800
|
+
HugeIntCastData<uhugeint_t, Uhugeint, uint64_t> state {};
|
1801
|
+
if (!TryIntegerCast<HugeIntCastData<uhugeint_t, Uhugeint, uint64_t>, false, true, HugeIntegerCastOperation>(
|
1801
1802
|
input.GetData(), input.GetSize(), state, strict)) {
|
1802
1803
|
return false;
|
1803
1804
|
}
|
@@ -1809,205 +1810,6 @@ bool TryCast::Operation(string_t input, uhugeint_t &result, bool strict) {
|
|
1809
1810
|
// Decimal String Cast
|
1810
1811
|
//===--------------------------------------------------------------------===//
|
1811
1812
|
|
1812
|
-
template <class T>
|
1813
|
-
struct DecimalCastData {
|
1814
|
-
using StoreType = T;
|
1815
|
-
StoreType result;
|
1816
|
-
uint8_t width;
|
1817
|
-
uint8_t scale;
|
1818
|
-
uint8_t digit_count;
|
1819
|
-
uint8_t decimal_count;
|
1820
|
-
//! Whether we have determined if the result should be rounded
|
1821
|
-
bool round_set;
|
1822
|
-
//! If the result should be rounded
|
1823
|
-
bool should_round;
|
1824
|
-
//! Only set when ALLOW_EXPONENT is enabled
|
1825
|
-
enum class ExponentType : uint8_t { NONE, POSITIVE, NEGATIVE };
|
1826
|
-
uint8_t excessive_decimals;
|
1827
|
-
ExponentType exponent_type;
|
1828
|
-
};
|
1829
|
-
|
1830
|
-
struct DecimalCastOperation {
|
1831
|
-
template <class T, bool NEGATIVE>
|
1832
|
-
static bool HandleDigit(T &state, uint8_t digit) {
|
1833
|
-
if (state.result == 0 && digit == 0) {
|
1834
|
-
// leading zero's don't count towards the digit count
|
1835
|
-
return true;
|
1836
|
-
}
|
1837
|
-
if (state.digit_count == state.width - state.scale) {
|
1838
|
-
// width of decimal type is exceeded!
|
1839
|
-
return false;
|
1840
|
-
}
|
1841
|
-
state.digit_count++;
|
1842
|
-
if (NEGATIVE) {
|
1843
|
-
if (state.result < (NumericLimits<typename T::StoreType>::Minimum() / 10)) {
|
1844
|
-
return false;
|
1845
|
-
}
|
1846
|
-
state.result = state.result * 10 - digit;
|
1847
|
-
} else {
|
1848
|
-
if (state.result > (NumericLimits<typename T::StoreType>::Maximum() / 10)) {
|
1849
|
-
return false;
|
1850
|
-
}
|
1851
|
-
state.result = state.result * 10 + digit;
|
1852
|
-
}
|
1853
|
-
return true;
|
1854
|
-
}
|
1855
|
-
|
1856
|
-
template <class T, bool NEGATIVE>
|
1857
|
-
static bool HandleHexDigit(T &state, uint8_t digit) {
|
1858
|
-
return false;
|
1859
|
-
}
|
1860
|
-
|
1861
|
-
template <class T, bool NEGATIVE>
|
1862
|
-
static bool HandleBinaryDigit(T &state, uint8_t digit) {
|
1863
|
-
return false;
|
1864
|
-
}
|
1865
|
-
|
1866
|
-
template <class T, bool NEGATIVE>
|
1867
|
-
static void RoundUpResult(T &state) {
|
1868
|
-
if (NEGATIVE) {
|
1869
|
-
state.result -= 1;
|
1870
|
-
} else {
|
1871
|
-
state.result += 1;
|
1872
|
-
}
|
1873
|
-
}
|
1874
|
-
|
1875
|
-
template <class T, bool NEGATIVE>
|
1876
|
-
static bool HandleExponent(T &state, int32_t exponent) {
|
1877
|
-
auto decimal_excess = (state.decimal_count > state.scale) ? state.decimal_count - state.scale : 0;
|
1878
|
-
if (exponent > 0) {
|
1879
|
-
state.exponent_type = T::ExponentType::POSITIVE;
|
1880
|
-
// Positive exponents need up to 'exponent' amount of digits
|
1881
|
-
// Everything beyond that amount needs to be truncated
|
1882
|
-
if (decimal_excess > exponent) {
|
1883
|
-
// We've allowed too many decimals
|
1884
|
-
state.excessive_decimals = UnsafeNumericCast<uint8_t>(decimal_excess - exponent);
|
1885
|
-
exponent = 0;
|
1886
|
-
} else {
|
1887
|
-
exponent -= decimal_excess;
|
1888
|
-
}
|
1889
|
-
D_ASSERT(exponent >= 0);
|
1890
|
-
} else if (exponent < 0) {
|
1891
|
-
state.exponent_type = T::ExponentType::NEGATIVE;
|
1892
|
-
}
|
1893
|
-
if (!Finalize<T, NEGATIVE>(state)) {
|
1894
|
-
return false;
|
1895
|
-
}
|
1896
|
-
if (exponent < 0) {
|
1897
|
-
bool round_up = false;
|
1898
|
-
for (idx_t i = 0; i < idx_t(-int64_t(exponent)); i++) {
|
1899
|
-
auto mod = state.result % 10;
|
1900
|
-
round_up = NEGATIVE ? mod <= -5 : mod >= 5;
|
1901
|
-
state.result /= 10;
|
1902
|
-
if (state.result == 0) {
|
1903
|
-
break;
|
1904
|
-
}
|
1905
|
-
}
|
1906
|
-
if (round_up) {
|
1907
|
-
RoundUpResult<T, NEGATIVE>(state);
|
1908
|
-
}
|
1909
|
-
return true;
|
1910
|
-
} else {
|
1911
|
-
// positive exponent: append 0's
|
1912
|
-
for (idx_t i = 0; i < idx_t(exponent); i++) {
|
1913
|
-
if (!HandleDigit<T, NEGATIVE>(state, 0)) {
|
1914
|
-
return false;
|
1915
|
-
}
|
1916
|
-
}
|
1917
|
-
return true;
|
1918
|
-
}
|
1919
|
-
}
|
1920
|
-
|
1921
|
-
template <class T, bool NEGATIVE, bool ALLOW_EXPONENT>
|
1922
|
-
static bool HandleDecimal(T &state, uint8_t digit) {
|
1923
|
-
if (state.decimal_count == state.scale && !state.round_set) {
|
1924
|
-
// Determine whether the last registered decimal should be rounded or not
|
1925
|
-
state.round_set = true;
|
1926
|
-
state.should_round = digit >= 5;
|
1927
|
-
}
|
1928
|
-
if (!ALLOW_EXPONENT && state.decimal_count == state.scale) {
|
1929
|
-
// we exceeded the amount of supported decimals
|
1930
|
-
// however, we don't throw an error here
|
1931
|
-
// we just truncate the decimal
|
1932
|
-
return true;
|
1933
|
-
}
|
1934
|
-
//! If we expect an exponent, we need to preserve the decimals
|
1935
|
-
//! But we don't want to overflow, so we prevent overflowing the result with this check
|
1936
|
-
if (state.digit_count + state.decimal_count >= DecimalWidth<decltype(state.result)>::max) {
|
1937
|
-
return true;
|
1938
|
-
}
|
1939
|
-
state.decimal_count++;
|
1940
|
-
if (NEGATIVE) {
|
1941
|
-
state.result = state.result * 10 - digit;
|
1942
|
-
} else {
|
1943
|
-
state.result = state.result * 10 + digit;
|
1944
|
-
}
|
1945
|
-
return true;
|
1946
|
-
}
|
1947
|
-
|
1948
|
-
template <class T, bool NEGATIVE>
|
1949
|
-
static bool TruncateExcessiveDecimals(T &state) {
|
1950
|
-
D_ASSERT(state.excessive_decimals);
|
1951
|
-
bool round_up = false;
|
1952
|
-
for (idx_t i = 0; i < state.excessive_decimals; i++) {
|
1953
|
-
auto mod = state.result % 10;
|
1954
|
-
round_up = NEGATIVE ? mod <= -5 : mod >= 5;
|
1955
|
-
state.result /= 10.0;
|
1956
|
-
}
|
1957
|
-
//! Only round up when exponents are involved
|
1958
|
-
if (state.exponent_type == T::ExponentType::POSITIVE && round_up) {
|
1959
|
-
RoundUpResult<T, NEGATIVE>(state);
|
1960
|
-
}
|
1961
|
-
D_ASSERT(state.decimal_count > state.scale);
|
1962
|
-
state.decimal_count = state.scale;
|
1963
|
-
return true;
|
1964
|
-
}
|
1965
|
-
|
1966
|
-
template <class T, bool NEGATIVE>
|
1967
|
-
static bool Finalize(T &state) {
|
1968
|
-
if (state.exponent_type != T::ExponentType::POSITIVE && state.decimal_count > state.scale) {
|
1969
|
-
//! Did not encounter an exponent, but ALLOW_EXPONENT was on
|
1970
|
-
state.excessive_decimals = state.decimal_count - state.scale;
|
1971
|
-
}
|
1972
|
-
if (state.excessive_decimals && !TruncateExcessiveDecimals<T, NEGATIVE>(state)) {
|
1973
|
-
return false;
|
1974
|
-
}
|
1975
|
-
if (state.exponent_type == T::ExponentType::NONE && state.round_set && state.should_round) {
|
1976
|
-
RoundUpResult<T, NEGATIVE>(state);
|
1977
|
-
}
|
1978
|
-
// if we have not gotten exactly "scale" decimals, we need to multiply the result
|
1979
|
-
// e.g. if we have a string "1.0" that is cast to a DECIMAL(9,3), the value needs to be 1000
|
1980
|
-
// but we have only gotten the value "10" so far, so we multiply by 1000
|
1981
|
-
for (uint8_t i = state.decimal_count; i < state.scale; i++) {
|
1982
|
-
state.result *= 10;
|
1983
|
-
}
|
1984
|
-
return true;
|
1985
|
-
}
|
1986
|
-
};
|
1987
|
-
|
1988
|
-
template <class T, char decimal_separator = '.'>
|
1989
|
-
bool TryDecimalStringCast(string_t input, T &result, CastParameters ¶meters, uint8_t width, uint8_t scale) {
|
1990
|
-
DecimalCastData<T> state;
|
1991
|
-
state.result = 0;
|
1992
|
-
state.width = width;
|
1993
|
-
state.scale = scale;
|
1994
|
-
state.digit_count = 0;
|
1995
|
-
state.decimal_count = 0;
|
1996
|
-
state.excessive_decimals = 0;
|
1997
|
-
state.exponent_type = DecimalCastData<T>::ExponentType::NONE;
|
1998
|
-
state.round_set = false;
|
1999
|
-
state.should_round = false;
|
2000
|
-
if (!TryIntegerCast<DecimalCastData<T>, true, true, DecimalCastOperation, false, decimal_separator>(
|
2001
|
-
input.GetData(), input.GetSize(), state, false)) {
|
2002
|
-
string error = StringUtil::Format("Could not convert string \"%s\" to DECIMAL(%d,%d)", input.GetString(),
|
2003
|
-
(int)width, (int)scale);
|
2004
|
-
HandleCastError::AssignError(error, parameters);
|
2005
|
-
return false;
|
2006
|
-
}
|
2007
|
-
result = state.result;
|
2008
|
-
return true;
|
2009
|
-
}
|
2010
|
-
|
2011
1813
|
template <>
|
2012
1814
|
bool TryCastToDecimal::Operation(string_t input, int16_t &result, CastParameters ¶meters, uint8_t width,
|
2013
1815
|
uint8_t scale) {
|
@@ -2058,22 +1860,22 @@ bool TryCastToDecimalCommaSeparated::Operation(string_t input, hugeint_t &result
|
|
2058
1860
|
|
2059
1861
|
template <>
|
2060
1862
|
string_t StringCastFromDecimal::Operation(int16_t input, uint8_t width, uint8_t scale, Vector &result) {
|
2061
|
-
return DecimalToString::Format<int16_t
|
1863
|
+
return DecimalToString::Format<int16_t>(input, width, scale, result);
|
2062
1864
|
}
|
2063
1865
|
|
2064
1866
|
template <>
|
2065
1867
|
string_t StringCastFromDecimal::Operation(int32_t input, uint8_t width, uint8_t scale, Vector &result) {
|
2066
|
-
return DecimalToString::Format<int32_t
|
1868
|
+
return DecimalToString::Format<int32_t>(input, width, scale, result);
|
2067
1869
|
}
|
2068
1870
|
|
2069
1871
|
template <>
|
2070
1872
|
string_t StringCastFromDecimal::Operation(int64_t input, uint8_t width, uint8_t scale, Vector &result) {
|
2071
|
-
return DecimalToString::Format<int64_t
|
1873
|
+
return DecimalToString::Format<int64_t>(input, width, scale, result);
|
2072
1874
|
}
|
2073
1875
|
|
2074
1876
|
template <>
|
2075
1877
|
string_t StringCastFromDecimal::Operation(hugeint_t input, uint8_t width, uint8_t scale, Vector &result) {
|
2076
|
-
return
|
1878
|
+
return DecimalToString::Format<hugeint_t>(input, width, scale, result);
|
2077
1879
|
}
|
2078
1880
|
|
2079
1881
|
//===--------------------------------------------------------------------===//
|
@@ -2481,7 +2283,7 @@ bool DoubleToDecimalCast(SRC input, DST &result, CastParameters ¶meters, uin
|
|
2481
2283
|
HandleCastError::AssignError(error, parameters);
|
2482
2284
|
return false;
|
2483
2285
|
}
|
2484
|
-
result = Cast::Operation<SRC, DST>(value);
|
2286
|
+
result = Cast::Operation<SRC, DST>(static_cast<SRC>(value));
|
2485
2287
|
return true;
|
2486
2288
|
}
|
2487
2289
|
|
@@ -24,37 +24,41 @@ string_t StringCast::Operation(bool input, Vector &vector) {
|
|
24
24
|
|
25
25
|
template <>
|
26
26
|
string_t StringCast::Operation(int8_t input, Vector &vector) {
|
27
|
-
return NumericHelper::FormatSigned<int8_t
|
27
|
+
return NumericHelper::FormatSigned<int8_t>(input, vector);
|
28
28
|
}
|
29
29
|
|
30
30
|
template <>
|
31
31
|
string_t StringCast::Operation(int16_t input, Vector &vector) {
|
32
|
-
return NumericHelper::FormatSigned<int16_t
|
32
|
+
return NumericHelper::FormatSigned<int16_t>(input, vector);
|
33
33
|
}
|
34
34
|
template <>
|
35
35
|
string_t StringCast::Operation(int32_t input, Vector &vector) {
|
36
|
-
return NumericHelper::FormatSigned<int32_t
|
36
|
+
return NumericHelper::FormatSigned<int32_t>(input, vector);
|
37
37
|
}
|
38
38
|
|
39
39
|
template <>
|
40
40
|
string_t StringCast::Operation(int64_t input, Vector &vector) {
|
41
|
-
return NumericHelper::FormatSigned<int64_t
|
41
|
+
return NumericHelper::FormatSigned<int64_t>(input, vector);
|
42
42
|
}
|
43
43
|
template <>
|
44
44
|
duckdb::string_t StringCast::Operation(uint8_t input, Vector &vector) {
|
45
|
-
return NumericHelper::FormatSigned<uint8_t
|
45
|
+
return NumericHelper::FormatSigned<uint8_t>(input, vector);
|
46
46
|
}
|
47
47
|
template <>
|
48
48
|
duckdb::string_t StringCast::Operation(uint16_t input, Vector &vector) {
|
49
|
-
return NumericHelper::FormatSigned<uint16_t
|
49
|
+
return NumericHelper::FormatSigned<uint16_t>(input, vector);
|
50
50
|
}
|
51
51
|
template <>
|
52
52
|
duckdb::string_t StringCast::Operation(uint32_t input, Vector &vector) {
|
53
|
-
return NumericHelper::FormatSigned<uint32_t
|
53
|
+
return NumericHelper::FormatSigned<uint32_t>(input, vector);
|
54
54
|
}
|
55
55
|
template <>
|
56
56
|
duckdb::string_t StringCast::Operation(uint64_t input, Vector &vector) {
|
57
|
-
return NumericHelper::FormatSigned<uint64_t
|
57
|
+
return NumericHelper::FormatSigned<uint64_t>(input, vector);
|
58
|
+
}
|
59
|
+
template <>
|
60
|
+
duckdb::string_t StringCast::Operation(hugeint_t input, Vector &vector) {
|
61
|
+
return NumericHelper::FormatSigned<hugeint_t>(input, vector);
|
58
62
|
}
|
59
63
|
|
60
64
|
template <>
|
@@ -76,11 +80,6 @@ string_t StringCast::Operation(interval_t input, Vector &vector) {
|
|
76
80
|
return StringVector::AddString(vector, buffer, length);
|
77
81
|
}
|
78
82
|
|
79
|
-
template <>
|
80
|
-
duckdb::string_t StringCast::Operation(hugeint_t input, Vector &vector) {
|
81
|
-
return HugeintToStringCast::FormatSigned(input, vector);
|
82
|
-
}
|
83
|
-
|
84
83
|
template <>
|
85
84
|
duckdb::string_t StringCast::Operation(uhugeint_t input, Vector &vector) {
|
86
85
|
return UhugeintToStringCast::Format(input, vector);
|
@@ -181,7 +180,7 @@ string_t StringCastTZ::Operation(dtime_tz_t input, Vector &vector) {
|
|
181
180
|
auto ss = std::abs(offset);
|
182
181
|
const auto hh = ss / Interval::SECS_PER_HOUR;
|
183
182
|
|
184
|
-
const auto hh_length = (hh < 100) ? 2 : NumericHelper::UnsignedLength(uint32_t(hh));
|
183
|
+
const auto hh_length = UnsafeNumericCast<idx_t>((hh < 100) ? 2 : NumericHelper::UnsignedLength(uint32_t(hh)));
|
185
184
|
length += hh_length;
|
186
185
|
|
187
186
|
ss %= Interval::SECS_PER_HOUR;
|
@@ -2,6 +2,7 @@
|
|
2
2
|
#include "duckdb/common/exception.hpp"
|
3
3
|
#include "duckdb/common/file_system.hpp"
|
4
4
|
#include "duckdb/common/helper.hpp"
|
5
|
+
#include "duckdb/common/numeric_utils.hpp"
|
5
6
|
|
6
7
|
namespace duckdb {
|
7
8
|
class PipeFile : public FileHandle {
|
@@ -22,10 +23,10 @@ public:
|
|
22
23
|
};
|
23
24
|
|
24
25
|
int64_t PipeFile::ReadChunk(void *buffer, int64_t nr_bytes) {
|
25
|
-
return child_handle->Read(buffer, nr_bytes);
|
26
|
+
return child_handle->Read(buffer, UnsafeNumericCast<idx_t>(nr_bytes));
|
26
27
|
}
|
27
28
|
int64_t PipeFile::WriteChunk(void *buffer, int64_t nr_bytes) {
|
28
|
-
return child_handle->Write(buffer, nr_bytes);
|
29
|
+
return child_handle->Write(buffer, UnsafeNumericCast<idx_t>(nr_bytes));
|
29
30
|
}
|
30
31
|
|
31
32
|
void PipeFileSystem::Reset(FileHandle &handle) {
|
@@ -1,4 +1,5 @@
|
|
1
1
|
#include "duckdb/common/random_engine.hpp"
|
2
|
+
#include "duckdb/common/numeric_utils.hpp"
|
2
3
|
#include "pcg_random.hpp"
|
3
4
|
#include <random>
|
4
5
|
|
@@ -15,7 +16,7 @@ RandomEngine::RandomEngine(int64_t seed) : random_state(make_uniq<RandomState>()
|
|
15
16
|
if (seed < 0) {
|
16
17
|
random_state->pcg.seed(pcg_extras::seed_seq_from<std::random_device>());
|
17
18
|
} else {
|
18
|
-
random_state->pcg.seed(seed);
|
19
|
+
random_state->pcg.seed(NumericCast<uint64_t>(seed));
|
19
20
|
}
|
20
21
|
}
|
21
22
|
|
@@ -10,17 +10,18 @@ namespace duckdb_re2 {
|
|
10
10
|
Regex::Regex(const std::string &pattern, RegexOptions options) {
|
11
11
|
RE2::Options o;
|
12
12
|
o.set_case_sensitive(options == RegexOptions::CASE_INSENSITIVE);
|
13
|
-
regex =
|
13
|
+
regex = duckdb::make_shared_ptr<duckdb_re2::RE2>(StringPiece(pattern), o);
|
14
14
|
}
|
15
15
|
|
16
16
|
bool RegexSearchInternal(const char *input, Match &match, const Regex &r, RE2::Anchor anchor, size_t start,
|
17
17
|
size_t end) {
|
18
18
|
auto ®ex = r.GetRegex();
|
19
19
|
duckdb::vector<StringPiece> target_groups;
|
20
|
-
auto group_count = regex.NumberOfCapturingGroups() + 1;
|
20
|
+
auto group_count = duckdb::UnsafeNumericCast<size_t>(regex.NumberOfCapturingGroups() + 1);
|
21
21
|
target_groups.resize(group_count);
|
22
22
|
match.groups.clear();
|
23
|
-
if (!regex.Match(StringPiece(input), start, end, anchor, target_groups.data(),
|
23
|
+
if (!regex.Match(StringPiece(input), start, end, anchor, target_groups.data(),
|
24
|
+
duckdb::UnsafeNumericCast<int>(group_count))) {
|
24
25
|
return false;
|
25
26
|
}
|
26
27
|
for (auto &group : target_groups) {
|
@@ -41,7 +42,8 @@ bool RegexMatch(const std::string &input, Match &match, const Regex ®ex) {
|
|
41
42
|
}
|
42
43
|
|
43
44
|
bool RegexMatch(const char *start, const char *end, Match &match, const Regex ®ex) {
|
44
|
-
return RegexSearchInternal(start, match, regex, RE2::ANCHOR_BOTH, 0,
|
45
|
+
return RegexSearchInternal(start, match, regex, RE2::ANCHOR_BOTH, 0,
|
46
|
+
duckdb::UnsafeNumericCast<size_t>(end - start));
|
45
47
|
}
|
46
48
|
|
47
49
|
bool RegexMatch(const std::string &input, const Regex ®ex) {
|
@@ -36,14 +36,14 @@ void RowOperations::DestroyStates(RowOperationsState &state, TupleDataLayout &la
|
|
36
36
|
return;
|
37
37
|
}
|
38
38
|
// Move to the first aggregate state
|
39
|
-
VectorOperations::AddInPlace(addresses, layout.GetAggrOffset(), count);
|
39
|
+
VectorOperations::AddInPlace(addresses, UnsafeNumericCast<int64_t>(layout.GetAggrOffset()), count);
|
40
40
|
for (const auto &aggr : layout.GetAggregates()) {
|
41
41
|
if (aggr.function.destructor) {
|
42
42
|
AggregateInputData aggr_input_data(aggr.GetFunctionData(), state.allocator);
|
43
43
|
aggr.function.destructor(addresses, aggr_input_data, count);
|
44
44
|
}
|
45
45
|
// Move to the next aggregate state
|
46
|
-
VectorOperations::AddInPlace(addresses, aggr.payload_size, count);
|
46
|
+
VectorOperations::AddInPlace(addresses, UnsafeNumericCast<int64_t>(aggr.payload_size), count);
|
47
47
|
}
|
48
48
|
}
|
49
49
|
|
@@ -74,8 +74,8 @@ void RowOperations::CombineStates(RowOperationsState &state, TupleDataLayout &la
|
|
74
74
|
}
|
75
75
|
|
76
76
|
// Move to the first aggregate states
|
77
|
-
VectorOperations::AddInPlace(sources, layout.GetAggrOffset(), count);
|
78
|
-
VectorOperations::AddInPlace(targets, layout.GetAggrOffset(), count);
|
77
|
+
VectorOperations::AddInPlace(sources, UnsafeNumericCast<int64_t>(layout.GetAggrOffset()), count);
|
78
|
+
VectorOperations::AddInPlace(targets, UnsafeNumericCast<int64_t>(layout.GetAggrOffset()), count);
|
79
79
|
|
80
80
|
// Keep track of the offset
|
81
81
|
idx_t offset = layout.GetAggrOffset();
|
@@ -87,16 +87,16 @@ void RowOperations::CombineStates(RowOperationsState &state, TupleDataLayout &la
|
|
87
87
|
aggr.function.combine(sources, targets, aggr_input_data, count);
|
88
88
|
|
89
89
|
// Move to the next aggregate states
|
90
|
-
VectorOperations::AddInPlace(sources, aggr.payload_size, count);
|
91
|
-
VectorOperations::AddInPlace(targets, aggr.payload_size, count);
|
90
|
+
VectorOperations::AddInPlace(sources, UnsafeNumericCast<int64_t>(aggr.payload_size), count);
|
91
|
+
VectorOperations::AddInPlace(targets, UnsafeNumericCast<int64_t>(aggr.payload_size), count);
|
92
92
|
|
93
93
|
// Increment the offset
|
94
94
|
offset += aggr.payload_size;
|
95
95
|
}
|
96
96
|
|
97
97
|
// Now subtract the offset to get back to the original position
|
98
|
-
VectorOperations::AddInPlace(sources, -offset, count);
|
99
|
-
VectorOperations::AddInPlace(targets, -offset, count);
|
98
|
+
VectorOperations::AddInPlace(sources, -UnsafeNumericCast<int64_t>(offset), count);
|
99
|
+
VectorOperations::AddInPlace(targets, -UnsafeNumericCast<int64_t>(offset), count);
|
100
100
|
}
|
101
101
|
|
102
102
|
void RowOperations::FinalizeStates(RowOperationsState &state, TupleDataLayout &layout, Vector &addresses,
|
@@ -106,7 +106,7 @@ void RowOperations::FinalizeStates(RowOperationsState &state, TupleDataLayout &l
|
|
106
106
|
VectorOperations::Copy(addresses, addresses_copy, result.size(), 0, 0);
|
107
107
|
|
108
108
|
// Move to the first aggregate state
|
109
|
-
VectorOperations::AddInPlace(addresses_copy, layout.GetAggrOffset(), result.size());
|
109
|
+
VectorOperations::AddInPlace(addresses_copy, UnsafeNumericCast<int64_t>(layout.GetAggrOffset()), result.size());
|
110
110
|
|
111
111
|
auto &aggregates = layout.GetAggregates();
|
112
112
|
for (idx_t i = 0; i < aggregates.size(); i++) {
|
@@ -116,7 +116,7 @@ void RowOperations::FinalizeStates(RowOperationsState &state, TupleDataLayout &l
|
|
116
116
|
aggr.function.finalize(addresses_copy, aggr_input_data, target, result.size(), 0);
|
117
117
|
|
118
118
|
// Move to the next aggregate state
|
119
|
-
VectorOperations::AddInPlace(addresses_copy, aggr.payload_size, result.size());
|
119
|
+
VectorOperations::AddInPlace(addresses_copy, UnsafeNumericCast<int64_t>(aggr.payload_size), result.size());
|
120
120
|
}
|
121
121
|
}
|
122
122
|
|
@@ -37,7 +37,8 @@ void RowOperations::SwizzleColumns(const RowLayout &layout, const data_ptr_t bas
|
|
37
37
|
for (idx_t i = 0; i < next; i++) {
|
38
38
|
if (Load<uint32_t>(col_ptr) > string_t::INLINE_LENGTH) {
|
39
39
|
// Overwrite the string pointer with the within-row offset (if not inlined)
|
40
|
-
Store<idx_t>(Load<data_ptr_t>(string_ptr) - heap_row_ptrs[i],
|
40
|
+
Store<idx_t>(UnsafeNumericCast<idx_t>(Load<data_ptr_t>(string_ptr) - heap_row_ptrs[i]),
|
41
|
+
string_ptr);
|
41
42
|
}
|
42
43
|
col_ptr += row_width;
|
43
44
|
string_ptr += row_width;
|
@@ -46,7 +47,7 @@ void RowOperations::SwizzleColumns(const RowLayout &layout, const data_ptr_t bas
|
|
46
47
|
// Non-varchar blob columns
|
47
48
|
for (idx_t i = 0; i < next; i++) {
|
48
49
|
// Overwrite the column data pointer with the within-row offset
|
49
|
-
Store<idx_t>(Load<data_ptr_t>(col_ptr) - heap_row_ptrs[i], col_ptr);
|
50
|
+
Store<idx_t>(UnsafeNumericCast<idx_t>(Load<data_ptr_t>(col_ptr) - heap_row_ptrs[i]), col_ptr);
|
50
51
|
col_ptr += row_width;
|
51
52
|
}
|
52
53
|
}
|
@@ -79,7 +80,7 @@ void RowOperations::CopyHeapAndSwizzle(const RowLayout &layout, data_ptr_t row_p
|
|
79
80
|
|
80
81
|
// Copy and swizzle
|
81
82
|
memcpy(heap_ptr, source_heap_ptr, size);
|
82
|
-
Store<idx_t>(heap_ptr - heap_base_ptr, row_ptr + heap_offset);
|
83
|
+
Store<idx_t>(UnsafeNumericCast<idx_t>(heap_ptr - heap_base_ptr), row_ptr + heap_offset);
|
83
84
|
|
84
85
|
// Increment for next iteration
|
85
86
|
row_ptr += row_width;
|
@@ -153,6 +153,8 @@ static void HeapGatherArrayVector(Vector &v, const idx_t vcount, const Selection
|
|
153
153
|
data_ptr_t array_validitymask_location = key_locations[i];
|
154
154
|
key_locations[i] += array_validitymask_size;
|
155
155
|
|
156
|
+
NestedValidity parent_validity(array_validitymask_location);
|
157
|
+
|
156
158
|
// The size of each variable size entry is stored after the validity mask
|
157
159
|
// (if the child type is variable size)
|
158
160
|
data_ptr_t var_entry_size_ptr = nullptr;
|
@@ -164,8 +166,8 @@ static void HeapGatherArrayVector(Vector &v, const idx_t vcount, const Selection
|
|
164
166
|
// row idx
|
165
167
|
const auto row_idx = sel.get_index(i);
|
166
168
|
|
167
|
-
|
168
|
-
|
169
|
+
idx_t array_start = row_idx * array_size;
|
170
|
+
idx_t elem_remaining = array_size;
|
169
171
|
|
170
172
|
while (elem_remaining > 0) {
|
171
173
|
auto chunk_size = MinValue(static_cast<idx_t>(STANDARD_VECTOR_SIZE), elem_remaining);
|
@@ -190,11 +192,11 @@ static void HeapGatherArrayVector(Vector &v, const idx_t vcount, const Selection
|
|
190
192
|
}
|
191
193
|
|
192
194
|
// Pass on this array's validity mask to the child vector
|
193
|
-
NestedValidity parent_validity(array_validitymask_location);
|
194
195
|
RowOperations::HeapGather(child_vector, chunk_size, array_sel, array_entry_locations, &parent_validity);
|
195
196
|
|
196
197
|
elem_remaining -= chunk_size;
|
197
198
|
array_start += chunk_size;
|
199
|
+
parent_validity.OffsetListBy(chunk_size);
|
198
200
|
}
|
199
201
|
}
|
200
202
|
}
|