duckdb 0.8.2-dev33.0 → 0.8.2-dev3300.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/README.md +7 -0
- package/binding.gyp +25 -13
- package/binding.gyp.in +1 -1
- package/configure.py +8 -3
- package/duckdb_extension_config.cmake +10 -0
- package/package.json +1 -1
- package/src/duckdb/extension/icu/icu-dateadd.cpp +2 -2
- package/src/duckdb/extension/icu/icu-datefunc.cpp +10 -1
- package/src/duckdb/extension/icu/icu-datepart.cpp +162 -41
- package/src/duckdb/extension/icu/icu-datesub.cpp +3 -2
- package/src/duckdb/extension/icu/icu-datetrunc.cpp +2 -1
- package/src/duckdb/extension/icu/icu-list-range.cpp +1 -1
- package/src/duckdb/extension/icu/icu-makedate.cpp +19 -6
- package/src/duckdb/extension/icu/icu-strptime.cpp +5 -24
- package/src/duckdb/extension/icu/icu-table-range.cpp +5 -5
- package/src/duckdb/extension/icu/icu-timebucket.cpp +16 -16
- package/src/duckdb/extension/icu/icu-timezone.cpp +8 -8
- package/src/duckdb/extension/icu/icu_extension.cpp +5 -7
- package/src/duckdb/extension/json/buffered_json_reader.cpp +2 -0
- package/src/duckdb/extension/json/include/buffered_json_reader.hpp +5 -19
- package/src/duckdb/extension/json/include/json_common.hpp +47 -231
- package/src/duckdb/extension/json/include/json_deserializer.hpp +1 -1
- package/src/duckdb/extension/json/include/json_enums.hpp +60 -0
- package/src/duckdb/extension/json/include/json_executors.hpp +49 -13
- package/src/duckdb/extension/json/include/json_functions.hpp +2 -1
- package/src/duckdb/extension/json/include/json_scan.hpp +14 -10
- package/src/duckdb/extension/json/include/json_serializer.hpp +1 -1
- package/src/duckdb/extension/json/include/json_transform.hpp +3 -0
- package/src/duckdb/extension/json/json_common.cpp +272 -40
- package/src/duckdb/extension/json/json_deserializer.cpp +16 -14
- package/src/duckdb/extension/json/json_enums.cpp +105 -0
- package/src/duckdb/extension/json/json_functions/json_create.cpp +21 -2
- package/src/duckdb/extension/json/json_functions/json_structure.cpp +1 -1
- package/src/duckdb/extension/json/json_functions/json_transform.cpp +93 -38
- package/src/duckdb/extension/json/json_functions/json_type.cpp +1 -1
- package/src/duckdb/extension/json/json_functions.cpp +26 -25
- package/src/duckdb/extension/json/json_scan.cpp +47 -6
- package/src/duckdb/extension/json/json_serializer.cpp +11 -11
- package/src/duckdb/extension/json/serialize_json.cpp +92 -0
- package/src/duckdb/extension/parquet/column_reader.cpp +37 -25
- package/src/duckdb/extension/parquet/column_writer.cpp +77 -61
- package/src/duckdb/extension/parquet/include/cast_column_reader.hpp +2 -2
- package/src/duckdb/extension/parquet/include/column_reader.hpp +14 -16
- package/src/duckdb/extension/parquet/include/column_writer.hpp +9 -7
- package/src/duckdb/extension/parquet/include/list_column_reader.hpp +2 -2
- package/src/duckdb/extension/parquet/include/parquet_dbp_decoder.hpp +3 -3
- package/src/duckdb/extension/parquet/include/parquet_decimal_utils.hpp +3 -3
- package/src/duckdb/extension/parquet/include/parquet_file_metadata_cache.hpp +2 -2
- package/src/duckdb/extension/parquet/include/parquet_reader.hpp +4 -0
- package/src/duckdb/extension/parquet/include/parquet_statistics.hpp +2 -2
- package/src/duckdb/extension/parquet/include/parquet_support.hpp +9 -11
- package/src/duckdb/extension/parquet/include/parquet_timestamp.hpp +1 -0
- package/src/duckdb/extension/parquet/include/parquet_writer.hpp +28 -5
- package/src/duckdb/extension/parquet/include/string_column_reader.hpp +1 -1
- package/src/duckdb/extension/parquet/include/struct_column_reader.hpp +2 -3
- package/src/duckdb/extension/parquet/include/zstd_file_system.hpp +2 -2
- package/src/duckdb/extension/parquet/parquet_extension.cpp +258 -40
- package/src/duckdb/extension/parquet/parquet_reader.cpp +10 -10
- package/src/duckdb/extension/parquet/parquet_statistics.cpp +25 -8
- package/src/duckdb/extension/parquet/parquet_timestamp.cpp +6 -0
- package/src/duckdb/extension/parquet/parquet_writer.cpp +149 -31
- package/src/duckdb/extension/parquet/serialize_parquet.cpp +26 -0
- package/src/duckdb/extension/parquet/zstd_file_system.cpp +2 -2
- package/src/duckdb/src/catalog/catalog.cpp +3 -7
- package/src/duckdb/src/catalog/catalog_entry/duck_table_entry.cpp +8 -11
- package/src/duckdb/src/catalog/catalog_entry/index_catalog_entry.cpp +17 -41
- package/src/duckdb/src/catalog/catalog_entry/macro_catalog_entry.cpp +2 -10
- package/src/duckdb/src/catalog/catalog_entry/schema_catalog_entry.cpp +4 -14
- package/src/duckdb/src/catalog/catalog_entry/sequence_catalog_entry.cpp +11 -28
- package/src/duckdb/src/catalog/catalog_entry/table_catalog_entry.cpp +11 -42
- package/src/duckdb/src/catalog/catalog_entry/type_catalog_entry.cpp +7 -26
- package/src/duckdb/src/catalog/catalog_entry/view_catalog_entry.cpp +11 -27
- package/src/duckdb/src/catalog/catalog_entry.cpp +25 -1
- package/src/duckdb/src/catalog/catalog_search_path.cpp +5 -4
- package/src/duckdb/src/catalog/catalog_set.cpp +0 -63
- package/src/duckdb/src/catalog/default/default_functions.cpp +21 -0
- package/src/duckdb/src/catalog/dependency_manager.cpp +0 -36
- package/src/duckdb/src/common/adbc/adbc.cpp +541 -171
- package/src/duckdb/src/common/adbc/driver_manager.cpp +92 -39
- package/src/duckdb/src/common/adbc/nanoarrow/allocator.cpp +57 -0
- package/src/duckdb/src/common/adbc/nanoarrow/metadata.cpp +121 -0
- package/src/duckdb/src/common/adbc/nanoarrow/schema.cpp +474 -0
- package/src/duckdb/src/common/adbc/nanoarrow/single_batch_array_stream.cpp +84 -0
- package/src/duckdb/src/common/allocator.cpp +14 -2
- package/src/duckdb/src/common/arrow/appender/bool_data.cpp +44 -0
- package/src/duckdb/src/common/arrow/appender/list_data.cpp +78 -0
- package/src/duckdb/src/common/arrow/appender/map_data.cpp +86 -0
- package/src/duckdb/src/common/arrow/appender/struct_data.cpp +45 -0
- package/src/duckdb/src/common/arrow/appender/union_data.cpp +70 -0
- package/src/duckdb/src/common/arrow/arrow_appender.cpp +95 -666
- package/src/duckdb/src/common/arrow/arrow_converter.cpp +65 -37
- package/src/duckdb/src/common/arrow/arrow_wrapper.cpp +37 -42
- package/src/duckdb/src/common/assert.cpp +3 -0
- package/src/duckdb/src/common/constants.cpp +2 -1
- package/src/duckdb/src/common/enum_util.cpp +4838 -4429
- package/src/duckdb/src/common/enums/date_part_specifier.cpp +2 -0
- package/src/duckdb/src/common/enums/logical_operator_type.cpp +4 -0
- package/src/duckdb/src/common/enums/optimizer_type.cpp +2 -0
- package/src/duckdb/src/common/enums/physical_operator_type.cpp +4 -0
- package/src/duckdb/src/common/exception.cpp +2 -2
- package/src/duckdb/src/common/extra_type_info.cpp +483 -0
- package/src/duckdb/src/common/field_writer.cpp +1 -1
- package/src/duckdb/src/common/file_system.cpp +25 -6
- package/src/duckdb/src/common/filename_pattern.cpp +1 -1
- package/src/duckdb/src/common/gzip_file_system.cpp +7 -12
- package/src/duckdb/src/common/hive_partitioning.cpp +10 -6
- package/src/duckdb/src/common/http_state.cpp +78 -0
- package/src/duckdb/src/common/local_file_system.cpp +36 -28
- package/src/duckdb/src/common/multi_file_reader.cpp +193 -20
- package/src/duckdb/src/common/operator/cast_operators.cpp +92 -1
- package/src/duckdb/src/common/operator/string_cast.cpp +45 -8
- package/src/duckdb/src/common/radix_partitioning.cpp +26 -8
- package/src/duckdb/src/common/re2_regex.cpp +1 -1
- package/src/duckdb/src/common/row_operations/row_external.cpp +1 -1
- package/src/duckdb/src/common/serializer/binary_deserializer.cpp +8 -3
- package/src/duckdb/src/common/serializer/binary_serializer.cpp +14 -9
- package/src/duckdb/src/common/serializer/buffered_file_reader.cpp +0 -9
- package/src/duckdb/src/common/serializer/format_serializer.cpp +15 -0
- package/src/duckdb/src/common/sort/merge_sorter.cpp +9 -16
- package/src/duckdb/src/common/sort/partition_state.cpp +70 -50
- package/src/duckdb/src/common/sort/sort_state.cpp +1 -1
- package/src/duckdb/src/common/sort/sorted_block.cpp +1 -1
- package/src/duckdb/src/common/types/batched_data_collection.cpp +7 -2
- package/src/duckdb/src/common/types/bit.cpp +51 -0
- package/src/duckdb/src/common/types/column/column_data_allocator.cpp +9 -6
- package/src/duckdb/src/common/types/column/column_data_collection.cpp +68 -2
- package/src/duckdb/src/common/types/column/column_data_collection_segment.cpp +20 -6
- package/src/duckdb/src/common/types/column/partitioned_column_data.cpp +2 -2
- package/src/duckdb/src/common/types/data_chunk.cpp +2 -2
- package/src/duckdb/src/common/types/date.cpp +15 -0
- package/src/duckdb/src/common/types/hugeint.cpp +40 -0
- package/src/duckdb/src/common/types/interval.cpp +3 -0
- package/src/duckdb/src/common/types/list_segment.cpp +56 -198
- package/src/duckdb/src/common/types/row/partitioned_tuple_data.cpp +3 -9
- package/src/duckdb/src/common/types/row/row_data_collection_scanner.cpp +35 -5
- package/src/duckdb/src/common/types/row/tuple_data_collection.cpp +2 -0
- package/src/duckdb/src/common/types/row/tuple_data_scatter_gather.cpp +2 -2
- package/src/duckdb/src/common/types/string_heap.cpp +4 -0
- package/src/duckdb/src/common/types/time.cpp +105 -0
- package/src/duckdb/src/common/types/timestamp.cpp +7 -0
- package/src/duckdb/src/common/types/uuid.cpp +2 -2
- package/src/duckdb/src/common/types/validity_mask.cpp +33 -0
- package/src/duckdb/src/common/types/value.cpp +65 -47
- package/src/duckdb/src/common/types/vector.cpp +52 -25
- package/src/duckdb/src/common/types.cpp +38 -724
- package/src/duckdb/src/common/virtual_file_system.cpp +142 -1
- package/src/duckdb/src/core_functions/aggregate/holistic/approximate_quantile.cpp +26 -0
- package/src/duckdb/src/core_functions/aggregate/holistic/mode.cpp +5 -7
- package/src/duckdb/src/core_functions/aggregate/holistic/quantile.cpp +64 -19
- package/src/duckdb/src/core_functions/aggregate/holistic/reservoir_quantile.cpp +30 -0
- package/src/duckdb/src/core_functions/aggregate/nested/histogram.cpp +1 -0
- package/src/duckdb/src/core_functions/aggregate/nested/list.cpp +83 -59
- package/src/duckdb/src/core_functions/aggregate/regression/regr_avg.cpp +4 -4
- package/src/duckdb/src/core_functions/aggregate/regression/regr_intercept.cpp +4 -4
- package/src/duckdb/src/core_functions/aggregate/regression/regr_r2.cpp +5 -4
- package/src/duckdb/src/core_functions/aggregate/regression/regr_sxx_syy.cpp +8 -8
- package/src/duckdb/src/core_functions/aggregate/regression/regr_sxy.cpp +4 -3
- package/src/duckdb/src/core_functions/function_list.cpp +10 -4
- package/src/duckdb/src/core_functions/scalar/date/date_diff.cpp +2 -0
- package/src/duckdb/src/core_functions/scalar/date/date_part.cpp +380 -89
- package/src/duckdb/src/core_functions/scalar/date/date_sub.cpp +2 -0
- package/src/duckdb/src/core_functions/scalar/date/date_trunc.cpp +4 -0
- package/src/duckdb/src/core_functions/scalar/date/epoch.cpp +10 -24
- package/src/duckdb/src/core_functions/scalar/date/make_date.cpp +19 -4
- package/src/duckdb/src/core_functions/scalar/date/strftime.cpp +10 -0
- package/src/duckdb/src/core_functions/scalar/debug/vector_type.cpp +23 -0
- package/src/duckdb/src/core_functions/scalar/list/array_slice.cpp +314 -82
- package/src/duckdb/src/core_functions/scalar/list/list_aggregates.cpp +4 -2
- package/src/duckdb/src/core_functions/scalar/list/list_lambdas.cpp +22 -3
- package/src/duckdb/src/core_functions/scalar/map/map_entries.cpp +2 -2
- package/src/duckdb/src/core_functions/scalar/string/to_base.cpp +66 -0
- package/src/duckdb/src/core_functions/scalar/union/union_tag.cpp +1 -1
- package/src/duckdb/src/execution/aggregate_hashtable.cpp +40 -18
- package/src/duckdb/src/execution/column_binding_resolver.cpp +10 -7
- package/src/duckdb/src/execution/expression_executor/execute_parameter.cpp +2 -2
- package/src/duckdb/src/execution/expression_executor.cpp +1 -1
- package/src/duckdb/src/execution/index/art/art.cpp +219 -259
- package/src/duckdb/src/execution/index/art/art_key.cpp +0 -11
- package/src/duckdb/src/execution/index/art/fixed_size_allocator.cpp +11 -15
- package/src/duckdb/src/execution/index/art/iterator.cpp +130 -214
- package/src/duckdb/src/execution/index/art/leaf.cpp +300 -266
- package/src/duckdb/src/execution/index/art/node.cpp +211 -205
- package/src/duckdb/src/execution/index/art/node16.cpp +10 -19
- package/src/duckdb/src/execution/index/art/node256.cpp +10 -18
- package/src/duckdb/src/execution/index/art/node4.cpp +21 -23
- package/src/duckdb/src/execution/index/art/node48.cpp +10 -20
- package/src/duckdb/src/execution/index/art/prefix.cpp +308 -338
- package/src/duckdb/src/execution/join_hashtable.cpp +4 -4
- package/src/duckdb/src/execution/operator/aggregate/aggregate_object.cpp +1 -0
- package/src/duckdb/src/execution/operator/aggregate/physical_hash_aggregate.cpp +14 -11
- package/src/duckdb/src/execution/operator/aggregate/physical_perfecthash_aggregate.cpp +6 -4
- package/src/duckdb/src/execution/operator/aggregate/physical_streaming_window.cpp +8 -3
- package/src/duckdb/src/execution/operator/aggregate/physical_ungrouped_aggregate.cpp +46 -34
- package/src/duckdb/src/execution/operator/aggregate/physical_window.cpp +332 -1067
- package/src/duckdb/src/execution/operator/filter/physical_filter.cpp +1 -1
- package/src/duckdb/src/execution/operator/helper/physical_batch_collector.cpp +12 -9
- package/src/duckdb/src/execution/operator/helper/physical_explain_analyze.cpp +2 -2
- package/src/duckdb/src/execution/operator/helper/physical_limit.cpp +10 -8
- package/src/duckdb/src/execution/operator/helper/physical_materialized_collector.cpp +7 -5
- package/src/duckdb/src/execution/operator/helper/physical_vacuum.cpp +7 -5
- package/src/duckdb/src/execution/operator/join/physical_asof_join.cpp +449 -288
- package/src/duckdb/src/execution/operator/join/physical_blockwise_nl_join.cpp +2 -2
- package/src/duckdb/src/execution/operator/join/physical_comparison_join.cpp +1 -2
- package/src/duckdb/src/execution/operator/join/physical_delim_join.cpp +13 -6
- package/src/duckdb/src/execution/operator/join/physical_hash_join.cpp +28 -15
- package/src/duckdb/src/execution/operator/join/physical_iejoin.cpp +35 -17
- package/src/duckdb/src/execution/operator/join/physical_join.cpp +1 -1
- package/src/duckdb/src/execution/operator/join/physical_nested_loop_join.cpp +7 -4
- package/src/duckdb/src/execution/operator/join/physical_piecewise_merge_join.cpp +31 -10
- package/src/duckdb/src/execution/operator/join/physical_range_join.cpp +41 -5
- package/src/duckdb/src/execution/operator/order/physical_order.cpp +7 -5
- package/src/duckdb/src/execution/operator/order/physical_top_n.cpp +7 -5
- package/src/duckdb/src/execution/operator/persistent/base_csv_reader.cpp +100 -13
- package/src/duckdb/src/execution/operator/persistent/csv_file_handle.cpp +1 -1
- package/src/duckdb/src/execution/operator/persistent/csv_reader_options.cpp +20 -0
- package/src/duckdb/src/execution/operator/persistent/csv_rejects_table.cpp +48 -0
- package/src/duckdb/src/execution/operator/persistent/parallel_csv_reader.cpp +2 -3
- package/src/duckdb/src/execution/operator/persistent/physical_batch_copy_to_file.cpp +14 -10
- package/src/duckdb/src/execution/operator/persistent/physical_batch_insert.cpp +11 -9
- package/src/duckdb/src/execution/operator/persistent/physical_copy_to_file.cpp +9 -7
- package/src/duckdb/src/execution/operator/persistent/physical_fixed_batch_copy.cpp +14 -12
- package/src/duckdb/src/execution/operator/persistent/physical_insert.cpp +11 -11
- package/src/duckdb/src/execution/operator/persistent/physical_update.cpp +4 -2
- package/src/duckdb/src/execution/operator/projection/physical_pivot.cpp +2 -1
- package/src/duckdb/src/execution/operator/projection/physical_unnest.cpp +24 -27
- package/src/duckdb/src/execution/operator/scan/physical_column_data_scan.cpp +19 -0
- package/src/duckdb/src/execution/operator/scan/physical_table_scan.cpp +7 -12
- package/src/duckdb/src/execution/operator/schema/physical_attach.cpp +2 -1
- package/src/duckdb/src/execution/operator/schema/physical_create_art_index.cpp +198 -0
- package/src/duckdb/src/execution/operator/schema/physical_create_type.cpp +2 -6
- package/src/duckdb/src/execution/operator/set/physical_cte.cpp +160 -0
- package/src/duckdb/src/execution/operator/set/physical_recursive_cte.cpp +15 -5
- package/src/duckdb/src/execution/partitionable_hashtable.cpp +41 -6
- package/src/duckdb/src/execution/perfect_aggregate_hashtable.cpp +37 -6
- package/src/duckdb/src/execution/physical_operator.cpp +20 -16
- package/src/duckdb/src/execution/physical_plan/plan_aggregate.cpp +43 -10
- package/src/duckdb/src/execution/physical_plan/plan_asof_join.cpp +57 -35
- package/src/duckdb/src/execution/physical_plan/plan_comparison_join.cpp +32 -15
- package/src/duckdb/src/execution/physical_plan/plan_create_index.cpp +45 -34
- package/src/duckdb/src/execution/physical_plan/plan_cte.cpp +33 -0
- package/src/duckdb/src/execution/physical_plan/plan_delim_join.cpp +2 -5
- package/src/duckdb/src/execution/physical_plan/plan_get.cpp +2 -2
- package/src/duckdb/src/execution/physical_plan/plan_recursive_cte.cpp +25 -4
- package/src/duckdb/src/execution/physical_plan_generator.cpp +6 -11
- package/src/duckdb/src/execution/radix_partitioned_hashtable.cpp +290 -43
- package/src/duckdb/src/execution/window_executor.cpp +1284 -0
- package/src/duckdb/src/execution/window_segment_tree.cpp +408 -144
- package/src/duckdb/src/function/aggregate/distributive/count.cpp +2 -13
- package/src/duckdb/src/function/aggregate/sorted_aggregate_function.cpp +6 -12
- package/src/duckdb/src/function/cast/bit_cast.cpp +34 -2
- package/src/duckdb/src/function/cast/blob_cast.cpp +3 -0
- package/src/duckdb/src/function/cast/numeric_casts.cpp +2 -0
- package/src/duckdb/src/function/cast/string_cast.cpp +2 -2
- package/src/duckdb/src/function/cast/time_casts.cpp +7 -6
- package/src/duckdb/src/function/function.cpp +3 -1
- package/src/duckdb/src/function/pragma/pragma_queries.cpp +5 -0
- package/src/duckdb/src/function/scalar/compressed_materialization/compress_integral.cpp +212 -0
- package/src/duckdb/src/function/scalar/compressed_materialization/compress_string.cpp +249 -0
- package/src/duckdb/src/function/scalar/compressed_materialization_functions.cpp +29 -0
- package/src/duckdb/src/function/scalar/list/list_resize.cpp +162 -0
- package/src/duckdb/src/function/scalar/nested_functions.cpp +1 -0
- package/src/duckdb/src/function/scalar/operators/add.cpp +9 -0
- package/src/duckdb/src/function/scalar/operators/arithmetic.cpp +6 -3
- package/src/duckdb/src/function/scalar/string/like.cpp +12 -4
- package/src/duckdb/src/function/scalar/system/aggregate_export.cpp +39 -5
- package/src/duckdb/src/function/scalar_function.cpp +5 -20
- package/src/duckdb/src/function/table/arrow/arrow_duck_schema.cpp +57 -0
- package/src/duckdb/src/function/table/arrow.cpp +110 -88
- package/src/duckdb/src/function/table/arrow_conversion.cpp +86 -73
- package/src/duckdb/src/function/table/copy_csv.cpp +8 -1
- package/src/duckdb/src/function/table/read_csv.cpp +124 -21
- package/src/duckdb/src/function/table/system/test_all_types.cpp +48 -21
- package/src/duckdb/src/function/table/system_functions.cpp +1 -0
- package/src/duckdb/src/function/table/table_scan.cpp +44 -0
- package/src/duckdb/src/function/table/version/pragma_version.cpp +49 -2
- package/src/duckdb/src/function/table_function.cpp +4 -3
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/index_catalog_entry.hpp +3 -3
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/macro_catalog_entry.hpp +1 -4
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/schema_catalog_entry.hpp +2 -5
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/sequence_catalog_entry.hpp +1 -6
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/table_catalog_entry.hpp +2 -13
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/type_catalog_entry.hpp +1 -4
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/view_catalog_entry.hpp +2 -5
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry.hpp +14 -0
- package/src/duckdb/src/include/duckdb/catalog/catalog_set.hpp +0 -6
- package/src/duckdb/src/include/duckdb/common/adbc/adbc.h +1 -0
- package/src/duckdb/src/include/duckdb/common/adbc/adbc.hpp +4 -1
- package/src/duckdb/src/include/duckdb/common/adbc/single_batch_array_stream.hpp +16 -0
- package/src/duckdb/src/include/duckdb/common/allocator.hpp +2 -0
- package/src/duckdb/src/include/duckdb/common/arrow/appender/append_data.hpp +109 -0
- package/src/duckdb/src/include/duckdb/common/arrow/appender/bool_data.hpp +15 -0
- package/src/duckdb/src/include/duckdb/common/arrow/appender/enum_data.hpp +69 -0
- package/src/duckdb/src/include/duckdb/common/arrow/appender/list.hpp +8 -0
- package/src/duckdb/src/include/duckdb/common/arrow/appender/list_data.hpp +18 -0
- package/src/duckdb/src/include/duckdb/common/arrow/appender/map_data.hpp +18 -0
- package/src/duckdb/src/include/duckdb/common/arrow/appender/scalar_data.hpp +88 -0
- package/src/duckdb/src/include/duckdb/common/arrow/appender/struct_data.hpp +18 -0
- package/src/duckdb/src/include/duckdb/common/arrow/appender/union_data.hpp +21 -0
- package/src/duckdb/src/include/duckdb/common/arrow/appender/varchar_data.hpp +105 -0
- package/src/duckdb/src/include/duckdb/common/arrow/arrow_appender.hpp +9 -4
- package/src/duckdb/src/include/duckdb/common/arrow/arrow_converter.hpp +3 -5
- package/src/duckdb/src/include/duckdb/common/arrow/arrow_wrapper.hpp +5 -3
- package/src/duckdb/src/include/duckdb/common/arrow/nanoarrow/nanoarrow.h +462 -0
- package/src/duckdb/src/include/duckdb/common/arrow/nanoarrow/nanoarrow.hpp +14 -0
- package/src/duckdb/src/include/duckdb/common/arrow/result_arrow_wrapper.hpp +4 -0
- package/src/duckdb/src/include/duckdb/common/assert.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/bitpacking.hpp +70 -55
- package/src/duckdb/src/include/duckdb/common/bswap.hpp +42 -0
- package/src/duckdb/src/include/duckdb/common/case_insensitive_map.hpp +1 -0
- package/src/duckdb/src/include/duckdb/common/constants.hpp +4 -0
- package/src/duckdb/src/include/duckdb/common/dl.hpp +3 -1
- package/src/duckdb/src/include/duckdb/common/enum_util.hpp +660 -580
- package/src/duckdb/src/include/duckdb/common/enums/cte_materialize.hpp +21 -0
- package/src/duckdb/src/include/duckdb/common/enums/date_part_specifier.hpp +9 -1
- package/src/duckdb/src/include/duckdb/common/enums/index_type.hpp +4 -3
- package/src/duckdb/src/include/duckdb/common/enums/joinref_type.hpp +2 -1
- package/src/duckdb/src/include/duckdb/common/enums/logical_operator_type.hpp +2 -0
- package/src/duckdb/src/include/duckdb/common/enums/operator_result_type.hpp +5 -1
- package/src/duckdb/src/include/duckdb/common/enums/optimizer_type.hpp +2 -0
- package/src/duckdb/src/include/duckdb/common/enums/pending_execution_result.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/enums/physical_operator_type.hpp +2 -0
- package/src/duckdb/src/include/duckdb/common/extra_operator_info.hpp +27 -0
- package/src/duckdb/src/include/duckdb/common/extra_type_info.hpp +215 -0
- package/src/duckdb/src/include/duckdb/common/field_writer.hpp +0 -4
- package/src/duckdb/src/include/duckdb/common/file_system.hpp +10 -8
- package/src/duckdb/src/include/duckdb/common/filename_pattern.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/helper.hpp +8 -3
- package/src/duckdb/src/include/duckdb/common/hive_partitioning.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/http_state.hpp +61 -28
- package/src/duckdb/src/include/duckdb/common/hugeint.hpp +15 -0
- package/src/duckdb/src/include/duckdb/common/index_vector.hpp +12 -0
- package/src/duckdb/src/include/duckdb/common/limits.hpp +52 -149
- package/src/duckdb/src/include/duckdb/common/multi_file_reader.hpp +11 -5
- package/src/duckdb/src/include/duckdb/common/multi_file_reader_options.hpp +12 -42
- package/src/duckdb/src/include/duckdb/common/mutex.hpp +3 -0
- package/src/duckdb/src/include/duckdb/common/numeric_utils.hpp +48 -0
- package/src/duckdb/src/include/duckdb/common/opener_file_system.hpp +6 -2
- package/src/duckdb/src/include/duckdb/common/operator/add.hpp +5 -2
- package/src/duckdb/src/include/duckdb/common/operator/cast_operators.hpp +65 -4
- package/src/duckdb/src/include/duckdb/common/operator/multiply.hpp +3 -2
- package/src/duckdb/src/include/duckdb/common/operator/numeric_cast.hpp +10 -0
- package/src/duckdb/src/include/duckdb/common/operator/string_cast.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/operator/subtract.hpp +3 -2
- package/src/duckdb/src/include/duckdb/common/radix.hpp +9 -20
- package/src/duckdb/src/include/duckdb/common/radix_partitioning.hpp +6 -21
- package/src/duckdb/src/include/duckdb/common/row_operations/row_operations.hpp +3 -3
- package/src/duckdb/src/include/duckdb/common/serializer/binary_deserializer.hpp +35 -7
- package/src/duckdb/src/include/duckdb/common/serializer/binary_serializer.hpp +14 -6
- package/src/duckdb/src/include/duckdb/common/serializer/buffered_file_reader.hpp +0 -4
- package/src/duckdb/src/include/duckdb/common/serializer/deserialization_data.hpp +110 -0
- package/src/duckdb/src/include/duckdb/common/serializer/format_deserializer.hpp +94 -16
- package/src/duckdb/src/include/duckdb/common/serializer/format_serializer.hpp +73 -40
- package/src/duckdb/src/include/duckdb/common/serializer/serialization_traits.hpp +26 -4
- package/src/duckdb/src/include/duckdb/common/serializer.hpp +0 -7
- package/src/duckdb/src/include/duckdb/common/sort/partition_state.hpp +23 -8
- package/src/duckdb/src/include/duckdb/common/stack_checker.hpp +34 -0
- package/src/duckdb/src/include/duckdb/common/string_util.hpp +11 -0
- package/src/duckdb/src/include/duckdb/common/type_util.hpp +8 -0
- package/src/duckdb/src/include/duckdb/common/typedefs.hpp +8 -0
- package/src/duckdb/src/include/duckdb/common/types/batched_data_collection.hpp +3 -1
- package/src/duckdb/src/include/duckdb/common/types/bit.hpp +81 -0
- package/src/duckdb/src/include/duckdb/common/types/column/column_data_allocator.hpp +11 -1
- package/src/duckdb/src/include/duckdb/common/types/column/column_data_collection.hpp +12 -1
- package/src/duckdb/src/include/duckdb/common/types/column/column_data_collection_segment.hpp +3 -1
- package/src/duckdb/src/include/duckdb/common/types/column/column_data_scan_states.hpp +3 -1
- package/src/duckdb/src/include/duckdb/common/types/data_chunk.hpp +1 -3
- package/src/duckdb/src/include/duckdb/common/types/date.hpp +9 -5
- package/src/duckdb/src/include/duckdb/common/types/datetime.hpp +46 -3
- package/src/duckdb/src/include/duckdb/common/types/list_segment.hpp +11 -15
- package/src/duckdb/src/include/duckdb/common/types/row/partitioned_tuple_data.hpp +5 -2
- package/src/duckdb/src/include/duckdb/common/types/row/row_data_collection_scanner.hpp +5 -1
- package/src/duckdb/src/include/duckdb/common/types/row/tuple_data_collection.hpp +1 -0
- package/src/duckdb/src/include/duckdb/common/types/row/tuple_data_states.hpp +3 -0
- package/src/duckdb/src/include/duckdb/common/types/string_heap.hpp +3 -0
- package/src/duckdb/src/include/duckdb/common/types/string_type.hpp +9 -0
- package/src/duckdb/src/include/duckdb/common/types/time.hpp +5 -0
- package/src/duckdb/src/include/duckdb/common/types/timestamp.hpp +16 -10
- package/src/duckdb/src/include/duckdb/common/types/value.hpp +7 -2
- package/src/duckdb/src/include/duckdb/common/types/vector.hpp +7 -0
- package/src/duckdb/src/include/duckdb/common/types.hpp +6 -25
- package/src/duckdb/src/include/duckdb/common/vector_operations/aggregate_executor.hpp +7 -2
- package/src/duckdb/src/include/duckdb/common/virtual_file_system.hpp +40 -97
- package/src/duckdb/src/include/duckdb/core_functions/aggregate/algebraic/corr.hpp +4 -4
- package/src/duckdb/src/include/duckdb/core_functions/aggregate/algebraic/covar.hpp +3 -1
- package/src/duckdb/src/include/duckdb/core_functions/aggregate/algebraic_functions.hpp +3 -1
- package/src/duckdb/src/include/duckdb/core_functions/aggregate/distributive_functions.hpp +4 -2
- package/src/duckdb/src/include/duckdb/core_functions/aggregate/holistic_functions.hpp +3 -1
- package/src/duckdb/src/include/duckdb/core_functions/aggregate/nested_functions.hpp +3 -1
- package/src/duckdb/src/include/duckdb/core_functions/aggregate/regression/regr_count.hpp +1 -0
- package/src/duckdb/src/include/duckdb/core_functions/aggregate/regression/regr_slope.hpp +3 -3
- package/src/duckdb/src/include/duckdb/core_functions/aggregate/regression_functions.hpp +3 -1
- package/src/duckdb/src/include/duckdb/core_functions/scalar/bit_functions.hpp +3 -1
- package/src/duckdb/src/include/duckdb/core_functions/scalar/blob_functions.hpp +3 -1
- package/src/duckdb/src/include/duckdb/core_functions/scalar/date_functions.hpp +40 -11
- package/src/duckdb/src/include/duckdb/core_functions/scalar/debug_functions.hpp +27 -0
- package/src/duckdb/src/include/duckdb/core_functions/scalar/enum_functions.hpp +3 -1
- package/src/duckdb/src/include/duckdb/core_functions/scalar/generic_functions.hpp +3 -1
- package/src/duckdb/src/include/duckdb/core_functions/scalar/list_functions.hpp +7 -5
- package/src/duckdb/src/include/duckdb/core_functions/scalar/map_functions.hpp +3 -1
- package/src/duckdb/src/include/duckdb/core_functions/scalar/math_functions.hpp +6 -4
- package/src/duckdb/src/include/duckdb/core_functions/scalar/operators_functions.hpp +4 -2
- package/src/duckdb/src/include/duckdb/core_functions/scalar/random_functions.hpp +3 -1
- package/src/duckdb/src/include/duckdb/core_functions/scalar/string_functions.hpp +12 -1
- package/src/duckdb/src/include/duckdb/core_functions/scalar/struct_functions.hpp +3 -1
- package/src/duckdb/src/include/duckdb/core_functions/scalar/union_functions.hpp +3 -1
- package/src/duckdb/src/include/duckdb/execution/aggregate_hashtable.hpp +21 -3
- package/src/duckdb/src/include/duckdb/execution/executor.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/index/art/art.hpp +13 -12
- package/src/duckdb/src/include/duckdb/execution/index/art/art_key.hpp +0 -1
- package/src/duckdb/src/include/duckdb/execution/index/art/fixed_size_allocator.hpp +22 -24
- package/src/duckdb/src/include/duckdb/execution/index/art/iterator.hpp +32 -28
- package/src/duckdb/src/include/duckdb/execution/index/art/leaf.hpp +46 -51
- package/src/duckdb/src/include/duckdb/execution/index/art/node.hpp +134 -53
- package/src/duckdb/src/include/duckdb/execution/index/art/node16.hpp +5 -7
- package/src/duckdb/src/include/duckdb/execution/index/art/node256.hpp +5 -7
- package/src/duckdb/src/include/duckdb/execution/index/art/node4.hpp +7 -9
- package/src/duckdb/src/include/duckdb/execution/index/art/node48.hpp +5 -7
- package/src/duckdb/src/include/duckdb/execution/index/art/prefix.hpp +63 -52
- package/src/duckdb/src/include/duckdb/execution/operator/aggregate/physical_hash_aggregate.hpp +3 -3
- package/src/duckdb/src/include/duckdb/execution/operator/aggregate/physical_perfecthash_aggregate.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/aggregate/physical_ungrouped_aggregate.hpp +3 -3
- package/src/duckdb/src/include/duckdb/execution/operator/aggregate/physical_window.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_batch_collector.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_explain_analyze.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_limit.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_materialized_collector.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_vacuum.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_asof_join.hpp +5 -12
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_blockwise_nl_join.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_delim_join.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_hash_join.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_iejoin.hpp +3 -3
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_nested_loop_join.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_piecewise_merge_join.hpp +3 -3
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_range_join.hpp +12 -1
- package/src/duckdb/src/include/duckdb/execution/operator/order/physical_order.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/order/physical_top_n.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/base_csv_reader.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/csv_line_info.hpp +4 -3
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/csv_reader_options.hpp +10 -1
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/csv_rejects_table.hpp +36 -0
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/parallel_csv_reader.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_batch_copy_to_file.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_batch_insert.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_copy_to_file.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_fixed_batch_copy.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_insert.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_update.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/scan/physical_column_data_scan.hpp +10 -0
- package/src/duckdb/src/include/duckdb/execution/operator/scan/physical_table_scan.hpp +5 -5
- package/src/duckdb/src/include/duckdb/execution/operator/schema/{physical_create_index.hpp → physical_create_art_index.hpp} +14 -7
- package/src/duckdb/src/include/duckdb/execution/operator/set/physical_cte.hpp +62 -0
- package/src/duckdb/src/include/duckdb/execution/operator/set/physical_recursive_cte.hpp +8 -2
- package/src/duckdb/src/include/duckdb/execution/partitionable_hashtable.hpp +5 -1
- package/src/duckdb/src/include/duckdb/execution/perfect_aggregate_hashtable.hpp +4 -2
- package/src/duckdb/src/include/duckdb/execution/physical_operator.hpp +6 -5
- package/src/duckdb/src/include/duckdb/execution/physical_operator_states.hpp +11 -0
- package/src/duckdb/src/include/duckdb/execution/physical_plan_generator.hpp +6 -2
- package/src/duckdb/src/include/duckdb/execution/radix_partitioned_hashtable.hpp +10 -3
- package/src/duckdb/src/include/duckdb/execution/window_executor.hpp +313 -0
- package/src/duckdb/src/include/duckdb/execution/window_segment_tree.hpp +79 -63
- package/src/duckdb/src/include/duckdb/function/aggregate_function.hpp +12 -4
- package/src/duckdb/src/include/duckdb/function/aggregate_state.hpp +2 -2
- package/src/duckdb/src/include/duckdb/function/built_in_functions.hpp +1 -0
- package/src/duckdb/src/include/duckdb/function/copy_function.hpp +6 -1
- package/src/duckdb/src/include/duckdb/function/function_serialization.hpp +81 -0
- package/src/duckdb/src/include/duckdb/function/macro_function.hpp +3 -0
- package/src/duckdb/src/include/duckdb/function/scalar/compressed_materialization_functions.hpp +49 -0
- package/src/duckdb/src/include/duckdb/function/scalar/list/contains_or_position.hpp +1 -1
- package/src/duckdb/src/include/duckdb/function/scalar/nested_functions.hpp +5 -0
- package/src/duckdb/src/include/duckdb/function/scalar/strftime_format.hpp +8 -0
- package/src/duckdb/src/include/duckdb/function/scalar/string_functions.hpp +2 -0
- package/src/duckdb/src/include/duckdb/function/scalar_function.hpp +8 -3
- package/src/duckdb/src/include/duckdb/function/scalar_macro_function.hpp +3 -0
- package/src/duckdb/src/include/duckdb/function/table/arrow/arrow_duck_schema.hpp +99 -0
- package/src/duckdb/src/include/duckdb/function/table/arrow.hpp +6 -36
- package/src/duckdb/src/include/duckdb/function/table/read_csv.hpp +7 -0
- package/src/duckdb/src/include/duckdb/function/table/system_functions.hpp +5 -1
- package/src/duckdb/src/include/duckdb/function/table_function.hpp +8 -0
- package/src/duckdb/src/include/duckdb/function/table_macro_function.hpp +3 -0
- package/src/duckdb/src/include/duckdb/function/udf_function.hpp +2 -1
- package/src/duckdb/src/include/duckdb/main/attached_database.hpp +1 -1
- package/src/duckdb/src/include/duckdb/main/capi/capi_internal.hpp +4 -3
- package/src/duckdb/src/include/duckdb/main/chunk_scan_state/query_result.hpp +29 -0
- package/src/duckdb/src/include/duckdb/main/chunk_scan_state.hpp +43 -0
- package/src/duckdb/src/include/duckdb/main/client_config.hpp +5 -2
- package/src/duckdb/src/include/duckdb/main/client_context.hpp +16 -14
- package/src/duckdb/src/include/duckdb/main/client_properties.hpp +25 -0
- package/src/duckdb/src/include/duckdb/main/config.hpp +3 -1
- package/src/duckdb/src/include/duckdb/main/connection.hpp +1 -2
- package/src/duckdb/src/include/duckdb/main/extension/generated_extension_loader.hpp +22 -0
- package/src/duckdb/src/include/duckdb/main/extension_entries.hpp +8 -0
- package/src/duckdb/src/include/duckdb/main/extension_util.hpp +4 -0
- package/src/duckdb/src/include/duckdb/main/pending_query_result.hpp +5 -0
- package/src/duckdb/src/include/duckdb/main/prepared_statement.hpp +73 -5
- package/src/duckdb/src/include/duckdb/main/prepared_statement_data.hpp +6 -6
- package/src/duckdb/src/include/duckdb/main/query_result.hpp +2 -27
- package/src/duckdb/src/include/duckdb/main/relation/aggregate_relation.hpp +4 -1
- package/src/duckdb/src/include/duckdb/main/relation/cross_product_relation.hpp +4 -1
- package/src/duckdb/src/include/duckdb/main/relation/join_relation.hpp +5 -2
- package/src/duckdb/src/include/duckdb/main/relation.hpp +4 -2
- package/src/duckdb/src/include/duckdb/main/settings.hpp +41 -11
- package/src/duckdb/src/include/duckdb/optimizer/column_binding_replacer.hpp +47 -0
- package/src/duckdb/src/include/duckdb/optimizer/compressed_materialization.hpp +132 -0
- package/src/duckdb/src/include/duckdb/optimizer/deliminator.hpp +13 -16
- package/src/duckdb/src/include/duckdb/optimizer/filter_pushdown.hpp +7 -0
- package/src/duckdb/src/include/duckdb/optimizer/join_order/cardinality_estimator.hpp +38 -64
- package/src/duckdb/src/include/duckdb/optimizer/join_order/cost_model.hpp +37 -0
- package/src/duckdb/src/include/duckdb/optimizer/join_order/estimated_properties.hpp +10 -1
- package/src/duckdb/src/include/duckdb/optimizer/join_order/join_node.hpp +14 -29
- package/src/duckdb/src/include/duckdb/optimizer/join_order/join_order_optimizer.hpp +8 -22
- package/src/duckdb/src/include/duckdb/optimizer/join_order/join_relation.hpp +1 -12
- package/src/duckdb/src/include/duckdb/optimizer/join_order/plan_enumerator.hpp +89 -0
- package/src/duckdb/src/include/duckdb/optimizer/join_order/query_graph.hpp +19 -30
- package/src/duckdb/src/include/duckdb/optimizer/join_order/query_graph_manager.hpp +113 -0
- package/src/duckdb/src/include/duckdb/optimizer/join_order/relation_manager.hpp +73 -0
- package/src/duckdb/src/include/duckdb/optimizer/join_order/relation_statistics_helper.hpp +73 -0
- package/src/duckdb/src/include/duckdb/optimizer/matcher/set_matcher.hpp +13 -0
- package/src/duckdb/src/include/duckdb/optimizer/optimizer.hpp +3 -0
- package/src/duckdb/src/include/duckdb/optimizer/remove_duplicate_groups.hpp +40 -0
- package/src/duckdb/src/include/duckdb/optimizer/statistics_propagator.hpp +11 -3
- package/src/duckdb/src/include/duckdb/optimizer/topn_optimizer.hpp +2 -0
- package/src/duckdb/src/include/duckdb/parallel/pipeline.hpp +2 -3
- package/src/duckdb/src/include/duckdb/parallel/pipeline_executor.hpp +3 -2
- package/src/duckdb/src/include/duckdb/parallel/task_scheduler.hpp +9 -1
- package/src/duckdb/src/include/duckdb/parser/column_definition.hpp +6 -5
- package/src/duckdb/src/include/duckdb/parser/column_list.hpp +4 -0
- package/src/duckdb/src/include/duckdb/parser/common_table_expression_info.hpp +2 -0
- package/src/duckdb/src/include/duckdb/parser/constraint.hpp +5 -0
- package/src/duckdb/src/include/duckdb/parser/constraints/check_constraint.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/constraints/foreign_key_constraint.hpp +6 -0
- package/src/duckdb/src/include/duckdb/parser/constraints/not_null_constraint.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/constraints/unique_constraint.hpp +6 -0
- package/src/duckdb/src/include/duckdb/parser/expression/between_expression.hpp +4 -1
- package/src/duckdb/src/include/duckdb/parser/expression/case_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/cast_expression.hpp +4 -1
- package/src/duckdb/src/include/duckdb/parser/expression/collate_expression.hpp +4 -1
- package/src/duckdb/src/include/duckdb/parser/expression/columnref_expression.hpp +4 -1
- package/src/duckdb/src/include/duckdb/parser/expression/comparison_expression.hpp +4 -1
- package/src/duckdb/src/include/duckdb/parser/expression/conjunction_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/constant_expression.hpp +4 -1
- package/src/duckdb/src/include/duckdb/parser/expression/default_expression.hpp +1 -0
- package/src/duckdb/src/include/duckdb/parser/expression/function_expression.hpp +4 -1
- package/src/duckdb/src/include/duckdb/parser/expression/lambda_expression.hpp +4 -1
- package/src/duckdb/src/include/duckdb/parser/expression/operator_expression.hpp +21 -4
- package/src/duckdb/src/include/duckdb/parser/expression/parameter_expression.hpp +18 -2
- package/src/duckdb/src/include/duckdb/parser/expression/positional_reference_expression.hpp +4 -1
- package/src/duckdb/src/include/duckdb/parser/expression/star_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/subquery_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/window_expression.hpp +4 -1
- package/src/duckdb/src/include/duckdb/parser/group_by_node.hpp +11 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/alter_info.hpp +12 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/alter_table_info.hpp +66 -2
- package/src/duckdb/src/include/duckdb/parser/parsed_data/attach_info.hpp +8 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/copy_info.hpp +8 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_index_info.hpp +9 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_info.hpp +9 -2
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_macro_info.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_schema_info.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_sequence_info.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_table_info.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_type_info.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_view_info.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/detach_info.hpp +7 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/drop_info.hpp +7 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/exported_table_data.hpp +7 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/load_info.hpp +13 -3
- package/src/duckdb/src/include/duckdb/parser/parsed_data/parse_info.hpp +22 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/pragma_info.hpp +10 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/show_select_info.hpp +7 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/transaction_info.hpp +10 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/vacuum_info.hpp +10 -0
- package/src/duckdb/src/include/duckdb/parser/parser.hpp +4 -0
- package/src/duckdb/src/include/duckdb/parser/query_node/cte_node.hpp +54 -0
- package/src/duckdb/src/include/duckdb/parser/query_node/list.hpp +1 -0
- package/src/duckdb/src/include/duckdb/parser/query_node.hpp +2 -1
- package/src/duckdb/src/include/duckdb/parser/statement/execute_statement.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/tableref/emptytableref.hpp +1 -0
- package/src/duckdb/src/include/duckdb/parser/tableref/joinref.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/tableref/subqueryref.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/tokens.hpp +1 -0
- package/src/duckdb/src/include/duckdb/parser/transformer.hpp +23 -26
- package/src/duckdb/src/include/duckdb/planner/binder.hpp +12 -5
- package/src/duckdb/src/include/duckdb/planner/bound_constraint.hpp +0 -8
- package/src/duckdb/src/include/duckdb/planner/bound_parameter_map.hpp +2 -1
- package/src/duckdb/src/include/duckdb/planner/bound_result_modifier.hpp +6 -0
- package/src/duckdb/src/include/duckdb/planner/bound_tokens.hpp +1 -0
- package/src/duckdb/src/include/duckdb/planner/column_binding.hpp +9 -0
- package/src/duckdb/src/include/duckdb/planner/constraints/bound_unique_constraint.hpp +3 -3
- package/src/duckdb/src/include/duckdb/planner/expression/bound_aggregate_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_between_expression.hpp +6 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_case_expression.hpp +6 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_cast_expression.hpp +6 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_columnref_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_comparison_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_conjunction_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_constant_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_default_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_function_expression.hpp +4 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_lambda_expression.hpp +3 -1
- package/src/duckdb/src/include/duckdb/planner/expression/bound_lambdaref_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_operator_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_parameter_data.hpp +24 -6
- package/src/duckdb/src/include/duckdb/planner/expression/bound_parameter_expression.hpp +9 -2
- package/src/duckdb/src/include/duckdb/planner/expression/bound_reference_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_unnest_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_window_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/expression/list.hpp +1 -0
- package/src/duckdb/src/include/duckdb/planner/expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/expression_binder/lateral_binder.hpp +0 -2
- package/src/duckdb/src/include/duckdb/planner/expression_binder.hpp +13 -1
- package/src/duckdb/src/include/duckdb/planner/filter/conjunction_filter.hpp +4 -0
- package/src/duckdb/src/include/duckdb/planner/filter/constant_filter.hpp +2 -0
- package/src/duckdb/src/include/duckdb/planner/filter/null_filter.hpp +4 -0
- package/src/duckdb/src/include/duckdb/planner/joinside.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/logical_operator.hpp +3 -2
- package/src/duckdb/src/include/duckdb/planner/logical_tokens.hpp +1 -2
- package/src/duckdb/src/include/duckdb/planner/operator/list.hpp +3 -3
- package/src/duckdb/src/include/duckdb/planner/operator/logical_aggregate.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_any_join.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_column_data_get.hpp +4 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_comparison_join.hpp +12 -7
- package/src/duckdb/src/include/duckdb/planner/operator/logical_copy_to_file.hpp +2 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_create.hpp +9 -6
- package/src/duckdb/src/include/duckdb/planner/operator/logical_create_index.hpp +12 -23
- package/src/duckdb/src/include/duckdb/planner/operator/logical_create_table.hpp +10 -6
- package/src/duckdb/src/include/duckdb/planner/operator/logical_cross_product.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_cteref.hpp +9 -2
- package/src/duckdb/src/include/duckdb/planner/operator/logical_delete.hpp +7 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_delim_get.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_dependent_join.hpp +43 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_distinct.hpp +6 -10
- package/src/duckdb/src/include/duckdb/planner/operator/logical_dummy_scan.hpp +2 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_empty_result.hpp +2 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_explain.hpp +4 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_expression_get.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_extension_operator.hpp +8 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_filter.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_get.hpp +11 -1
- package/src/duckdb/src/include/duckdb/planner/operator/logical_insert.hpp +6 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_limit.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_limit_percent.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_materialized_cte.hpp +52 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_order.hpp +7 -35
- package/src/duckdb/src/include/duckdb/planner/operator/logical_pivot.hpp +6 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_positional_join.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_projection.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_recursive_cte.hpp +10 -7
- package/src/duckdb/src/include/duckdb/planner/operator/logical_reset.hpp +4 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_sample.hpp +6 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_set.hpp +4 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_set_operation.hpp +4 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_show.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_simple.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_top_n.hpp +4 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_unnest.hpp +2 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_update.hpp +6 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_window.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator_extension.hpp +1 -0
- package/src/duckdb/src/include/duckdb/planner/planner.hpp +4 -3
- package/src/duckdb/src/include/duckdb/planner/query_node/bound_cte_node.hpp +44 -0
- package/src/duckdb/src/include/duckdb/planner/query_node/list.hpp +1 -0
- package/src/duckdb/src/include/duckdb/planner/subquery/flatten_dependent_join.hpp +2 -2
- package/src/duckdb/src/include/duckdb/planner/subquery/has_correlated_expressions.hpp +4 -1
- package/src/duckdb/src/include/duckdb/planner/subquery/recursive_dependent_join_planner.hpp +31 -0
- package/src/duckdb/src/include/duckdb/planner/subquery/rewrite_correlated_expressions.hpp +8 -2
- package/src/duckdb/src/include/duckdb/planner/table_filter.hpp +7 -1
- package/src/duckdb/src/include/duckdb/planner/tableref/bound_cteref.hpp +5 -2
- package/src/duckdb/src/include/duckdb/planner/tableref/bound_pivotref.hpp +3 -0
- package/src/duckdb/src/include/duckdb/storage/arena_allocator.hpp +2 -1
- package/src/duckdb/src/include/duckdb/storage/block.hpp +27 -4
- package/src/duckdb/src/include/duckdb/storage/block_manager.hpp +11 -11
- package/src/duckdb/src/include/duckdb/storage/checkpoint/row_group_writer.hpp +5 -5
- package/src/duckdb/src/include/duckdb/storage/checkpoint/table_data_reader.hpp +2 -2
- package/src/duckdb/src/include/duckdb/storage/checkpoint/table_data_writer.hpp +3 -3
- package/src/duckdb/src/include/duckdb/storage/checkpoint_manager.hpp +19 -16
- package/src/duckdb/src/include/duckdb/storage/data_pointer.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/data_table.hpp +2 -2
- package/src/duckdb/src/include/duckdb/storage/in_memory_block_manager.hpp +2 -2
- package/src/duckdb/src/include/duckdb/storage/index.hpp +2 -2
- package/src/duckdb/src/include/duckdb/storage/metadata/metadata_manager.hpp +88 -0
- package/src/duckdb/src/include/duckdb/storage/metadata/metadata_reader.hpp +54 -0
- package/src/duckdb/src/include/duckdb/storage/metadata/metadata_writer.hpp +45 -0
- package/src/duckdb/src/include/duckdb/storage/object_cache.hpp +22 -0
- package/src/duckdb/src/include/duckdb/storage/partial_block_manager.hpp +2 -2
- package/src/duckdb/src/include/duckdb/storage/single_file_block_manager.hpp +8 -5
- package/src/duckdb/src/include/duckdb/storage/statistics/string_stats.hpp +4 -0
- package/src/duckdb/src/include/duckdb/storage/storage_info.hpp +2 -2
- package/src/duckdb/src/include/duckdb/storage/storage_manager.hpp +2 -2
- package/src/duckdb/src/include/duckdb/storage/table/chunk_info.hpp +3 -0
- package/src/duckdb/src/include/duckdb/storage/table/persistent_table_data.hpp +2 -2
- package/src/duckdb/src/include/duckdb/storage/table/row_group.hpp +4 -3
- package/src/duckdb/src/include/duckdb/storage/table/row_group_collection.hpp +3 -3
- package/src/duckdb/src/include/duckdb/storage/table/row_group_segment_tree.hpp +2 -2
- package/src/duckdb/src/include/duckdb/storage/table/table_index_list.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/table_io_manager.hpp +3 -0
- package/src/duckdb/src/include/duckdb/storage/write_ahead_log.hpp +3 -4
- package/src/duckdb/src/include/duckdb/transaction/local_storage.hpp +2 -3
- package/src/duckdb/src/include/duckdb/verification/prepared_statement_verifier.hpp +1 -1
- package/src/duckdb/src/include/duckdb.h +86 -1
- package/src/duckdb/src/main/appender.cpp +3 -1
- package/src/duckdb/src/main/attached_database.cpp +2 -2
- package/src/duckdb/src/main/capi/arrow-c.cpp +196 -8
- package/src/duckdb/src/main/capi/duckdb-c.cpp +16 -0
- package/src/duckdb/src/main/capi/duckdb_value-c.cpp +1 -1
- package/src/duckdb/src/main/capi/pending-c.cpp +23 -0
- package/src/duckdb/src/main/capi/prepared-c.cpp +106 -28
- package/src/duckdb/src/main/capi/result-c.cpp +3 -1
- package/src/duckdb/src/main/chunk_scan_state/query_result.cpp +53 -0
- package/src/duckdb/src/main/chunk_scan_state.cpp +48 -0
- package/src/duckdb/src/main/client_context.cpp +42 -19
- package/src/duckdb/src/main/client_verify.cpp +17 -0
- package/src/duckdb/src/main/config.cpp +4 -1
- package/src/duckdb/src/main/database.cpp +2 -11
- package/src/duckdb/src/main/db_instance_cache.cpp +14 -6
- package/src/duckdb/src/main/extension/extension_helper.cpp +107 -88
- package/src/duckdb/src/main/extension/extension_install.cpp +10 -1
- package/src/duckdb/src/main/extension/extension_load.cpp +26 -6
- package/src/duckdb/src/main/extension/extension_util.cpp +16 -0
- package/src/duckdb/src/main/pending_query_result.cpp +9 -1
- package/src/duckdb/src/main/prepared_statement.cpp +38 -11
- package/src/duckdb/src/main/prepared_statement_data.cpp +23 -18
- package/src/duckdb/src/main/query_result.cpp +0 -21
- package/src/duckdb/src/main/relation/aggregate_relation.cpp +20 -10
- package/src/duckdb/src/main/relation/cross_product_relation.cpp +4 -3
- package/src/duckdb/src/main/relation/join_relation.cpp +6 -6
- package/src/duckdb/src/main/relation.cpp +10 -9
- package/src/duckdb/src/main/settings/settings.cpp +79 -33
- package/src/duckdb/src/optimizer/column_binding_replacer.cpp +43 -0
- package/src/duckdb/src/optimizer/column_lifetime_analyzer.cpp +2 -4
- package/src/duckdb/src/optimizer/compressed_materialization/compress_aggregate.cpp +140 -0
- package/src/duckdb/src/optimizer/compressed_materialization/compress_distinct.cpp +42 -0
- package/src/duckdb/src/optimizer/compressed_materialization/compress_order.cpp +65 -0
- package/src/duckdb/src/optimizer/compressed_materialization.cpp +477 -0
- package/src/duckdb/src/optimizer/deliminator.cpp +180 -323
- package/src/duckdb/src/optimizer/filter_pushdown.cpp +23 -6
- package/src/duckdb/src/optimizer/join_order/cardinality_estimator.cpp +79 -325
- package/src/duckdb/src/optimizer/join_order/cost_model.cpp +19 -0
- package/src/duckdb/src/optimizer/join_order/estimated_properties.cpp +7 -0
- package/src/duckdb/src/optimizer/join_order/join_node.cpp +5 -37
- package/src/duckdb/src/optimizer/join_order/join_order_optimizer.cpp +48 -1047
- package/src/duckdb/src/optimizer/join_order/join_relation_set.cpp +2 -6
- package/src/duckdb/src/optimizer/join_order/plan_enumerator.cpp +552 -0
- package/src/duckdb/src/optimizer/join_order/query_graph.cpp +52 -41
- package/src/duckdb/src/optimizer/join_order/query_graph_manager.cpp +409 -0
- package/src/duckdb/src/optimizer/join_order/relation_manager.cpp +356 -0
- package/src/duckdb/src/optimizer/join_order/relation_statistics_helper.cpp +351 -0
- package/src/duckdb/src/optimizer/optimizer.cpp +49 -14
- package/src/duckdb/src/optimizer/pushdown/pushdown_cross_product.cpp +5 -5
- package/src/duckdb/src/optimizer/pushdown/pushdown_get.cpp +0 -1
- package/src/duckdb/src/optimizer/pushdown/pushdown_projection.cpp +34 -7
- package/src/duckdb/src/optimizer/remove_duplicate_groups.cpp +127 -0
- package/src/duckdb/src/optimizer/remove_unused_columns.cpp +4 -0
- package/src/duckdb/src/optimizer/rule/regex_optimizations.cpp +154 -15
- package/src/duckdb/src/optimizer/statistics/operator/propagate_join.cpp +65 -8
- package/src/duckdb/src/optimizer/statistics/operator/propagate_order.cpp +1 -1
- package/src/duckdb/src/optimizer/statistics_propagator.cpp +7 -5
- package/src/duckdb/src/optimizer/topn_optimizer.cpp +27 -10
- package/src/duckdb/src/optimizer/unnest_rewriter.cpp +3 -5
- package/src/duckdb/src/parallel/executor.cpp +25 -1
- package/src/duckdb/src/parallel/pipeline.cpp +0 -17
- package/src/duckdb/src/parallel/pipeline_executor.cpp +33 -13
- package/src/duckdb/src/parallel/pipeline_finish_event.cpp +55 -1
- package/src/duckdb/src/parallel/task_scheduler.cpp +18 -2
- package/src/duckdb/src/parser/column_definition.cpp +20 -32
- package/src/duckdb/src/parser/column_list.cpp +8 -0
- package/src/duckdb/src/parser/constraints/foreign_key_constraint.cpp +3 -0
- package/src/duckdb/src/parser/constraints/unique_constraint.cpp +3 -0
- package/src/duckdb/src/parser/expression/between_expression.cpp +3 -15
- package/src/duckdb/src/parser/expression/case_expression.cpp +0 -25
- package/src/duckdb/src/parser/expression/cast_expression.cpp +3 -14
- package/src/duckdb/src/parser/expression/collate_expression.cpp +3 -13
- package/src/duckdb/src/parser/expression/columnref_expression.cpp +3 -12
- package/src/duckdb/src/parser/expression/comparison_expression.cpp +3 -13
- package/src/duckdb/src/parser/expression/conjunction_expression.cpp +0 -12
- package/src/duckdb/src/parser/expression/constant_expression.cpp +3 -11
- package/src/duckdb/src/parser/expression/default_expression.cpp +0 -4
- package/src/duckdb/src/parser/expression/function_expression.cpp +3 -32
- package/src/duckdb/src/parser/expression/lambda_expression.cpp +4 -14
- package/src/duckdb/src/parser/expression/operator_expression.cpp +0 -12
- package/src/duckdb/src/parser/expression/parameter_expression.cpp +7 -19
- package/src/duckdb/src/parser/expression/positional_reference_expression.cpp +4 -11
- package/src/duckdb/src/parser/expression/star_expression.cpp +0 -19
- package/src/duckdb/src/parser/expression/subquery_expression.cpp +0 -18
- package/src/duckdb/src/parser/expression/window_expression.cpp +3 -39
- package/src/duckdb/src/parser/parsed_data/alter_info.cpp +5 -2
- package/src/duckdb/src/parser/parsed_data/alter_table_info.cpp +38 -0
- package/src/duckdb/src/parser/parsed_data/create_index_info.cpp +17 -1
- package/src/duckdb/src/parser/parsed_data/create_sequence_info.cpp +2 -0
- package/src/duckdb/src/parser/parsed_data/detach_info.cpp +1 -1
- package/src/duckdb/src/parser/parsed_data/drop_info.cpp +1 -1
- package/src/duckdb/src/parser/parsed_data/sample_options.cpp +0 -18
- package/src/duckdb/src/parser/parsed_data/transaction_info.cpp +4 -1
- package/src/duckdb/src/parser/parsed_data/vacuum_info.cpp +1 -1
- package/src/duckdb/src/parser/parsed_expression.cpp +0 -70
- package/src/duckdb/src/parser/parsed_expression_iterator.cpp +7 -0
- package/src/duckdb/src/parser/parser.cpp +62 -36
- package/src/duckdb/src/parser/query_node/cte_node.cpp +58 -0
- package/src/duckdb/src/parser/query_node/recursive_cte_node.cpp +0 -19
- package/src/duckdb/src/parser/query_node/select_node.cpp +0 -29
- package/src/duckdb/src/parser/query_node/set_operation_node.cpp +0 -15
- package/src/duckdb/src/parser/query_node.cpp +15 -47
- package/src/duckdb/src/parser/result_modifier.cpp +0 -87
- package/src/duckdb/src/parser/statement/execute_statement.cpp +2 -2
- package/src/duckdb/src/parser/statement/select_statement.cpp +0 -10
- package/src/duckdb/src/parser/tableref/basetableref.cpp +0 -19
- package/src/duckdb/src/parser/tableref/emptytableref.cpp +0 -4
- package/src/duckdb/src/parser/tableref/expressionlistref.cpp +0 -15
- package/src/duckdb/src/parser/tableref/joinref.cpp +3 -23
- package/src/duckdb/src/parser/tableref/pivotref.cpp +6 -45
- package/src/duckdb/src/parser/tableref/subqueryref.cpp +3 -13
- package/src/duckdb/src/parser/tableref/table_function.cpp +0 -15
- package/src/duckdb/src/parser/tableref.cpp +0 -44
- package/src/duckdb/src/parser/transform/constraint/transform_constraint.cpp +55 -38
- package/src/duckdb/src/parser/transform/expression/transform_array_access.cpp +13 -4
- package/src/duckdb/src/parser/transform/expression/transform_constant.cpp +55 -3
- package/src/duckdb/src/parser/transform/expression/transform_expression.cpp +2 -0
- package/src/duckdb/src/parser/transform/expression/transform_function.cpp +3 -0
- package/src/duckdb/src/parser/transform/expression/transform_multi_assign_reference.cpp +44 -0
- package/src/duckdb/src/parser/transform/expression/transform_param_ref.cpp +45 -26
- package/src/duckdb/src/parser/transform/helpers/transform_cte.cpp +19 -1
- package/src/duckdb/src/parser/transform/helpers/transform_typename.cpp +16 -1
- package/src/duckdb/src/parser/transform/statement/transform_copy.cpp +13 -0
- package/src/duckdb/src/parser/transform/statement/transform_create_index.cpp +32 -17
- package/src/duckdb/src/parser/transform/statement/transform_create_type.cpp +1 -1
- package/src/duckdb/src/parser/transform/statement/transform_delete.cpp +6 -1
- package/src/duckdb/src/parser/transform/statement/transform_insert.cpp +6 -1
- package/src/duckdb/src/parser/transform/statement/transform_pivot_stmt.cpp +7 -2
- package/src/duckdb/src/parser/transform/statement/transform_pragma.cpp +14 -11
- package/src/duckdb/src/parser/transform/statement/transform_prepare.cpp +28 -6
- package/src/duckdb/src/parser/transform/statement/transform_select_node.cpp +11 -2
- package/src/duckdb/src/parser/transform/statement/transform_update.cpp +6 -1
- package/src/duckdb/src/parser/transformer.cpp +44 -25
- package/src/duckdb/src/planner/binder/expression/bind_macro_expression.cpp +5 -3
- package/src/duckdb/src/planner/binder/expression/bind_parameter_expression.cpp +10 -10
- package/src/duckdb/src/planner/binder/query_node/bind_cte_node.cpp +64 -0
- package/src/duckdb/src/planner/binder/query_node/plan_cte_node.cpp +26 -0
- package/src/duckdb/src/planner/binder/query_node/plan_recursive_cte_node.cpp +5 -5
- package/src/duckdb/src/planner/binder/query_node/plan_setop.cpp +4 -4
- package/src/duckdb/src/planner/binder/query_node/plan_subquery.cpp +36 -33
- package/src/duckdb/src/planner/binder/statement/bind_create.cpp +14 -52
- package/src/duckdb/src/planner/binder/statement/bind_create_table.cpp +0 -23
- package/src/duckdb/src/planner/binder/statement/bind_execute.cpp +13 -7
- package/src/duckdb/src/planner/binder/statement/bind_export.cpp +29 -4
- package/src/duckdb/src/planner/binder/tableref/bind_basetableref.cpp +24 -5
- package/src/duckdb/src/planner/binder/tableref/bind_joinref.cpp +32 -5
- package/src/duckdb/src/planner/binder/tableref/bind_pivot.cpp +116 -50
- package/src/duckdb/src/planner/binder/tableref/plan_cteref.cpp +1 -1
- package/src/duckdb/src/planner/binder/tableref/plan_joinref.cpp +67 -31
- package/src/duckdb/src/planner/binder/tableref/plan_subqueryref.cpp +3 -3
- package/src/duckdb/src/planner/binder.cpp +44 -31
- package/src/duckdb/src/planner/expression/bound_aggregate_expression.cpp +24 -1
- package/src/duckdb/src/planner/expression/bound_between_expression.cpp +4 -0
- package/src/duckdb/src/planner/expression/bound_cast_expression.cpp +13 -8
- package/src/duckdb/src/planner/expression/bound_function_expression.cpp +22 -0
- package/src/duckdb/src/planner/expression/bound_parameter_expression.cpp +28 -20
- package/src/duckdb/src/planner/expression/bound_window_expression.cpp +48 -4
- package/src/duckdb/src/planner/expression_binder/lateral_binder.cpp +4 -31
- package/src/duckdb/src/planner/expression_binder.cpp +23 -0
- package/src/duckdb/src/planner/expression_iterator.cpp +6 -0
- package/src/duckdb/src/planner/logical_operator.cpp +19 -7
- package/src/duckdb/src/planner/logical_operator_visitor.cpp +5 -6
- package/src/duckdb/src/planner/operator/logical_comparison_join.cpp +4 -2
- package/src/duckdb/src/planner/operator/logical_copy_to_file.cpp +8 -0
- package/src/duckdb/src/planner/operator/logical_create.cpp +14 -0
- package/src/duckdb/src/planner/operator/logical_create_index.cpp +36 -7
- package/src/duckdb/src/planner/operator/logical_create_table.cpp +16 -0
- package/src/duckdb/src/planner/operator/logical_cteref.cpp +3 -1
- package/src/duckdb/src/planner/operator/logical_delete.cpp +9 -2
- package/src/duckdb/src/planner/operator/logical_dependent_join.cpp +26 -0
- package/src/duckdb/src/planner/operator/logical_distinct.cpp +13 -0
- package/src/duckdb/src/planner/operator/logical_explain.cpp +1 -1
- package/src/duckdb/src/planner/operator/logical_extension_operator.cpp +39 -0
- package/src/duckdb/src/planner/operator/logical_get.cpp +82 -4
- package/src/duckdb/src/planner/operator/logical_insert.cpp +8 -2
- package/src/duckdb/src/planner/operator/logical_materialized_cte.cpp +22 -0
- package/src/duckdb/src/planner/operator/logical_order.cpp +39 -0
- package/src/duckdb/src/planner/operator/logical_pivot.cpp +3 -0
- package/src/duckdb/src/planner/operator/logical_recursive_cte.cpp +5 -5
- package/src/duckdb/src/planner/operator/logical_sample.cpp +3 -0
- package/src/duckdb/src/planner/operator/logical_update.cpp +8 -2
- package/src/duckdb/src/planner/parsed_data/bound_create_table_info.cpp +4 -2
- package/src/duckdb/src/planner/planner.cpp +18 -7
- package/src/duckdb/src/planner/subquery/flatten_dependent_join.cpp +90 -38
- package/src/duckdb/src/planner/subquery/has_correlated_expressions.cpp +22 -7
- package/src/duckdb/src/planner/subquery/rewrite_correlated_expressions.cpp +65 -7
- package/src/duckdb/src/storage/arena_allocator.cpp +13 -2
- package/src/duckdb/src/storage/buffer/block_manager.cpp +13 -9
- package/src/duckdb/src/storage/checkpoint/row_group_writer.cpp +1 -1
- package/src/duckdb/src/storage/checkpoint/table_data_reader.cpp +3 -4
- package/src/duckdb/src/storage/checkpoint/table_data_writer.cpp +7 -7
- package/src/duckdb/src/storage/checkpoint_manager.cpp +74 -69
- package/src/duckdb/src/storage/compression/bitpacking.cpp +87 -63
- package/src/duckdb/src/storage/compression/bitpacking_hugeint.cpp +295 -0
- package/src/duckdb/src/storage/compression/fsst.cpp +1 -1
- package/src/duckdb/src/storage/compression/rle.cpp +52 -13
- package/src/duckdb/src/storage/data_table.cpp +36 -25
- package/src/duckdb/src/storage/index.cpp +4 -26
- package/src/duckdb/src/storage/local_storage.cpp +3 -4
- package/src/duckdb/src/storage/metadata/metadata_manager.cpp +267 -0
- package/src/duckdb/src/storage/metadata/metadata_reader.cpp +80 -0
- package/src/duckdb/src/storage/metadata/metadata_writer.cpp +86 -0
- package/src/duckdb/src/storage/serialization/serialize_constraint.cpp +98 -0
- package/src/duckdb/src/storage/serialization/serialize_create_info.cpp +194 -0
- package/src/duckdb/src/storage/serialization/serialize_expression.cpp +283 -0
- package/src/duckdb/src/storage/serialization/serialize_logical_operator.cpp +762 -0
- package/src/duckdb/src/storage/serialization/serialize_macro_function.cpp +62 -0
- package/src/duckdb/src/storage/serialization/serialize_nodes.cpp +432 -0
- package/src/duckdb/src/storage/serialization/serialize_parse_info.cpp +419 -0
- package/src/duckdb/src/storage/serialization/serialize_parsed_expression.cpp +342 -0
- package/src/duckdb/src/storage/serialization/serialize_query_node.cpp +122 -0
- package/src/duckdb/src/storage/serialization/serialize_result_modifier.cpp +97 -0
- package/src/duckdb/src/storage/serialization/serialize_statement.cpp +22 -0
- package/src/duckdb/src/storage/serialization/serialize_table_filter.cpp +97 -0
- package/src/duckdb/src/storage/serialization/serialize_tableref.cpp +164 -0
- package/src/duckdb/src/storage/serialization/serialize_types.cpp +127 -0
- package/src/duckdb/src/storage/single_file_block_manager.cpp +69 -51
- package/src/duckdb/src/storage/statistics/string_stats.cpp +21 -2
- package/src/duckdb/src/storage/storage_info.cpp +3 -2
- package/src/duckdb/src/storage/storage_manager.cpp +11 -5
- package/src/duckdb/src/storage/table/chunk_info.cpp +17 -0
- package/src/duckdb/src/storage/table/column_data_checkpointer.cpp +3 -3
- package/src/duckdb/src/storage/table/list_column_data.cpp +6 -3
- package/src/duckdb/src/storage/table/persistent_table_data.cpp +1 -2
- package/src/duckdb/src/storage/table/row_group.cpp +34 -19
- package/src/duckdb/src/storage/table/row_group_collection.cpp +23 -19
- package/src/duckdb/src/storage/table/update_segment.cpp +1 -1
- package/src/duckdb/src/storage/table_index_list.cpp +1 -1
- package/src/duckdb/src/storage/wal_replay.cpp +24 -24
- package/src/duckdb/src/storage/write_ahead_log.cpp +3 -2
- package/src/duckdb/src/verification/prepared_statement_verifier.cpp +16 -11
- package/src/duckdb/third_party/concurrentqueue/concurrentqueue.h +2 -2
- package/src/duckdb/third_party/concurrentqueue/lightweightsemaphore.h +5 -2
- package/src/duckdb/third_party/fast_float/fast_float/fast_float.h +2 -0
- package/src/duckdb/third_party/httplib/httplib.hpp +10 -1
- package/src/duckdb/third_party/libpg_query/include/nodes/parsenodes.hpp +10 -0
- package/src/duckdb/third_party/libpg_query/include/parser/gram.hpp +2 -1
- package/src/duckdb/third_party/libpg_query/pg_functions.cpp +13 -0
- package/src/duckdb/third_party/libpg_query/src_backend_parser_gram.cpp +11057 -10328
- package/src/duckdb/third_party/libpg_query/src_backend_parser_scansup.cpp +9 -0
- package/src/duckdb/third_party/mbedtls/include/mbedtls_wrapper.hpp +10 -0
- package/src/duckdb/third_party/mbedtls/mbedtls_wrapper.cpp +31 -1
- package/src/duckdb/ub_extension_icu_third_party_icu_i18n.cpp +4 -4
- package/src/duckdb/ub_src_common.cpp +4 -0
- package/src/duckdb/ub_src_common_adbc_nanoarrow.cpp +8 -0
- package/src/duckdb/ub_src_common_arrow_appender.cpp +10 -0
- package/src/duckdb/ub_src_common_serializer.cpp +2 -0
- package/src/duckdb/ub_src_core_functions_scalar_debug.cpp +2 -0
- package/src/duckdb/ub_src_core_functions_scalar_string.cpp +2 -0
- package/src/duckdb/ub_src_execution.cpp +2 -0
- package/src/duckdb/ub_src_execution_index_art.cpp +0 -6
- package/src/duckdb/ub_src_execution_operator_persistent.cpp +2 -0
- package/src/duckdb/ub_src_execution_operator_schema.cpp +1 -1
- package/src/duckdb/ub_src_execution_operator_set.cpp +2 -0
- package/src/duckdb/ub_src_execution_physical_plan.cpp +2 -0
- package/src/duckdb/ub_src_function_scalar.cpp +2 -0
- package/src/duckdb/ub_src_function_scalar_compressed_materialization.cpp +4 -0
- package/src/duckdb/ub_src_function_scalar_list.cpp +2 -0
- package/src/duckdb/ub_src_function_table_arrow.cpp +2 -0
- package/src/duckdb/ub_src_main.cpp +2 -0
- package/src/duckdb/ub_src_main_chunk_scan_state.cpp +2 -0
- package/src/duckdb/ub_src_optimizer.cpp +6 -0
- package/src/duckdb/ub_src_optimizer_compressed_materialization.cpp +6 -0
- package/src/duckdb/ub_src_optimizer_join_order.cpp +10 -0
- package/src/duckdb/ub_src_optimizer_statistics_expression.cpp +0 -2
- package/src/duckdb/ub_src_parser.cpp +0 -2
- package/src/duckdb/ub_src_parser_query_node.cpp +2 -0
- package/src/duckdb/ub_src_parser_transform_expression.cpp +2 -0
- package/src/duckdb/ub_src_planner_binder_query_node.cpp +4 -0
- package/src/duckdb/ub_src_planner_operator.cpp +3 -3
- package/src/duckdb/ub_src_storage.cpp +0 -4
- package/src/duckdb/ub_src_storage_compression.cpp +2 -0
- package/src/duckdb/ub_src_storage_metadata.cpp +6 -0
- package/src/duckdb/ub_src_storage_serialization.cpp +28 -0
- package/src/duckdb_node.hpp +1 -0
- package/src/statement.cpp +10 -5
- package/test/columns.test.ts +25 -3
- package/test/extension.test.ts +1 -1
- package/test/test_all_types.test.ts +234 -0
- package/tsconfig.json +1 -0
- package/src/duckdb/src/execution/index/art/leaf_segment.cpp +0 -52
- package/src/duckdb/src/execution/index/art/prefix_segment.cpp +0 -42
- package/src/duckdb/src/execution/index/art/swizzleable_pointer.cpp +0 -22
- package/src/duckdb/src/execution/operator/schema/physical_create_index.cpp +0 -193
- package/src/duckdb/src/include/duckdb/common/arrow/arrow_options.hpp +0 -25
- package/src/duckdb/src/include/duckdb/execution/index/art/leaf_segment.hpp +0 -38
- package/src/duckdb/src/include/duckdb/execution/index/art/prefix_segment.hpp +0 -40
- package/src/duckdb/src/include/duckdb/execution/index/art/swizzleable_pointer.hpp +0 -58
- package/src/duckdb/src/include/duckdb/planner/operator/logical_asof_join.hpp +0 -27
- package/src/duckdb/src/include/duckdb/planner/operator/logical_delim_join.hpp +0 -32
- package/src/duckdb/src/include/duckdb/storage/meta_block_reader.hpp +0 -49
- package/src/duckdb/src/include/duckdb/storage/meta_block_writer.hpp +0 -50
- package/src/duckdb/src/optimizer/statistics/expression/propagate_and_compress.cpp +0 -118
- package/src/duckdb/src/parser/common_table_expression_info.cpp +0 -19
- package/src/duckdb/src/planner/operator/logical_asof_join.cpp +0 -14
- package/src/duckdb/src/planner/operator/logical_delim_join.cpp +0 -27
- package/src/duckdb/src/storage/meta_block_reader.cpp +0 -78
- package/src/duckdb/src/storage/meta_block_writer.cpp +0 -80
@@ -5,8 +5,6 @@
|
|
5
5
|
#include "duckdb/execution/expression_executor.hpp"
|
6
6
|
#include "duckdb/storage/arena_allocator.hpp"
|
7
7
|
#include "duckdb/execution/index/art/art_key.hpp"
|
8
|
-
#include "duckdb/execution/index/art/prefix_segment.hpp"
|
9
|
-
#include "duckdb/execution/index/art/leaf_segment.hpp"
|
10
8
|
#include "duckdb/execution/index/art/prefix.hpp"
|
11
9
|
#include "duckdb/execution/index/art/leaf.hpp"
|
12
10
|
#include "duckdb/execution/index/art/node4.hpp"
|
@@ -35,31 +33,33 @@ struct ARTIndexScanState : public IndexScanState {
|
|
35
33
|
|
36
34
|
ART::ART(const vector<column_t> &column_ids, TableIOManager &table_io_manager,
|
37
35
|
const vector<unique_ptr<Expression>> &unbound_expressions, const IndexConstraintType constraint_type,
|
38
|
-
AttachedDatabase &db, const
|
39
|
-
|
40
|
-
|
41
|
-
|
36
|
+
AttachedDatabase &db, const shared_ptr<vector<FixedSizeAllocator>> &allocators_ptr, BlockPointer pointer)
|
37
|
+
: Index(db, IndexType::ART, table_io_manager, column_ids, unbound_expressions, constraint_type),
|
38
|
+
allocators(allocators_ptr), owns_data(false) {
|
42
39
|
if (!Radix::IsLittleEndian()) {
|
43
40
|
throw NotImplementedException("ART indexes are not supported on big endian architectures");
|
44
41
|
}
|
45
42
|
|
46
43
|
// initialize all allocators
|
47
|
-
allocators
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
44
|
+
if (!allocators) {
|
45
|
+
owns_data = true;
|
46
|
+
allocators = make_shared<vector<FixedSizeAllocator>>();
|
47
|
+
allocators->emplace_back(FixedSizeAllocator(sizeof(Prefix), buffer_manager.GetBufferAllocator()));
|
48
|
+
allocators->emplace_back(FixedSizeAllocator(sizeof(Leaf), buffer_manager.GetBufferAllocator()));
|
49
|
+
allocators->emplace_back(FixedSizeAllocator(sizeof(Node4), buffer_manager.GetBufferAllocator()));
|
50
|
+
allocators->emplace_back(FixedSizeAllocator(sizeof(Node16), buffer_manager.GetBufferAllocator()));
|
51
|
+
allocators->emplace_back(FixedSizeAllocator(sizeof(Node48), buffer_manager.GetBufferAllocator()));
|
52
|
+
allocators->emplace_back(FixedSizeAllocator(sizeof(Node256), buffer_manager.GetBufferAllocator()));
|
53
|
+
}
|
54
54
|
|
55
55
|
// set the root node of the tree
|
56
56
|
tree = make_uniq<Node>();
|
57
|
-
|
58
|
-
|
59
|
-
tree->
|
57
|
+
serialized_data_pointer = pointer;
|
58
|
+
if (pointer.IsValid()) {
|
59
|
+
tree->SetSerialized();
|
60
|
+
tree->SetPtr(pointer.block_id, pointer.offset);
|
60
61
|
tree->Deserialize(*this);
|
61
62
|
}
|
62
|
-
serialized_data_pointer = BlockPointer(block_id, block_offset);
|
63
63
|
|
64
64
|
// validate the types of the key columns
|
65
65
|
for (idx_t i = 0; i < types.size(); i++) {
|
@@ -306,10 +306,12 @@ bool Construct(ART &art, vector<ARTKey> &keys, row_t *row_ids, Node &node, KeySe
|
|
306
306
|
return false;
|
307
307
|
}
|
308
308
|
|
309
|
+
reference<Node> ref_node(node);
|
310
|
+
Prefix::New(art, ref_node, start_key, prefix_start, start_key.len - prefix_start);
|
309
311
|
if (single_row_id) {
|
310
|
-
Leaf::New(
|
312
|
+
Leaf::New(ref_node, row_ids[key_section.start]);
|
311
313
|
} else {
|
312
|
-
Leaf::New(art,
|
314
|
+
Leaf::New(art, ref_node, row_ids + key_section.start, num_row_ids);
|
313
315
|
}
|
314
316
|
return true;
|
315
317
|
}
|
@@ -320,17 +322,20 @@ bool Construct(ART &art, vector<ARTKey> &keys, row_t *row_ids, Node &node, KeySe
|
|
320
322
|
vector<KeySection> child_sections;
|
321
323
|
GetChildSections(child_sections, keys, key_section);
|
322
324
|
|
323
|
-
|
324
|
-
Node
|
325
|
-
|
325
|
+
// set the prefix
|
326
|
+
reference<Node> ref_node(node);
|
326
327
|
auto prefix_length = key_section.depth - prefix_start;
|
327
|
-
|
328
|
+
Prefix::New(art, ref_node, start_key, prefix_start, prefix_length);
|
329
|
+
|
330
|
+
// set the node
|
331
|
+
auto node_type = Node::GetARTNodeTypeByCount(child_sections.size());
|
332
|
+
Node::New(art, ref_node, node_type);
|
328
333
|
|
329
334
|
// recurse on each child section
|
330
335
|
for (auto &child_section : child_sections) {
|
331
336
|
Node new_child;
|
332
337
|
auto no_violation = Construct(art, keys, row_ids, new_child, child_section, has_constraint);
|
333
|
-
Node::InsertChild(art,
|
338
|
+
Node::InsertChild(art, ref_node, child_section.key_byte, new_child);
|
334
339
|
if (!no_violation) {
|
335
340
|
return false;
|
336
341
|
}
|
@@ -354,19 +359,9 @@ bool ART::ConstructFromSorted(idx_t count, vector<ARTKey> &keys, Vector &row_ide
|
|
354
359
|
D_ASSERT(!VerifyAndToStringInternal(true).empty());
|
355
360
|
for (idx_t i = 0; i < count; i++) {
|
356
361
|
D_ASSERT(!keys[i].Empty());
|
357
|
-
auto
|
358
|
-
D_ASSERT(
|
359
|
-
|
360
|
-
|
361
|
-
if (leaf.IsInlined()) {
|
362
|
-
D_ASSERT(row_ids[i] == leaf.row_ids.inlined);
|
363
|
-
continue;
|
364
|
-
}
|
365
|
-
|
366
|
-
D_ASSERT(leaf.row_ids.ptr.IsSet());
|
367
|
-
Node leaf_segment = leaf.row_ids.ptr;
|
368
|
-
auto position = leaf.FindRowId(*this, leaf_segment, row_ids[i]);
|
369
|
-
D_ASSERT(position != (uint32_t)DConstants::INVALID_INDEX);
|
362
|
+
auto leaf = Lookup(*tree, keys[i], 0);
|
363
|
+
D_ASSERT(leaf.IsSet());
|
364
|
+
D_ASSERT(Leaf::ContainsRowId(*this, leaf, row_ids[i]));
|
370
365
|
}
|
371
366
|
#endif
|
372
367
|
|
@@ -427,19 +422,9 @@ PreservedError ART::Insert(IndexLock &lock, DataChunk &input, Vector &row_ids) {
|
|
427
422
|
continue;
|
428
423
|
}
|
429
424
|
|
430
|
-
auto
|
431
|
-
D_ASSERT(
|
432
|
-
|
433
|
-
|
434
|
-
if (leaf.IsInlined()) {
|
435
|
-
D_ASSERT(row_identifiers[i] == leaf.row_ids.inlined);
|
436
|
-
continue;
|
437
|
-
}
|
438
|
-
|
439
|
-
D_ASSERT(leaf.row_ids.ptr.IsSet());
|
440
|
-
Node leaf_segment = leaf.row_ids.ptr;
|
441
|
-
auto position = leaf.FindRowId(*this, leaf_segment, row_identifiers[i]);
|
442
|
-
D_ASSERT(position != (uint32_t)DConstants::INVALID_INDEX);
|
425
|
+
auto leaf = Lookup(*tree, keys[i], 0);
|
426
|
+
D_ASSERT(leaf.IsSet());
|
427
|
+
D_ASSERT(Leaf::ContainsRowId(*this, leaf, row_identifiers[i]));
|
443
428
|
}
|
444
429
|
#endif
|
445
430
|
|
@@ -467,91 +452,83 @@ void ART::VerifyAppend(DataChunk &chunk, ConflictManager &conflict_manager) {
|
|
467
452
|
CheckConstraintsForChunk(chunk, conflict_manager);
|
468
453
|
}
|
469
454
|
|
470
|
-
bool ART::InsertToLeaf(Node &
|
471
|
-
|
472
|
-
auto &leaf = Leaf::Get(*this, leaf_node);
|
455
|
+
bool ART::InsertToLeaf(Node &leaf, const row_t &row_id) {
|
473
456
|
|
474
|
-
|
475
|
-
for (idx_t k = 0; k < leaf.count; k++) {
|
476
|
-
D_ASSERT(leaf.GetRowId(*this, k) != row_id);
|
477
|
-
}
|
478
|
-
#endif
|
479
|
-
if (IsUnique() && leaf.count != 0) {
|
457
|
+
if (IsUnique()) {
|
480
458
|
return false;
|
481
459
|
}
|
482
|
-
|
460
|
+
|
461
|
+
Leaf::Insert(*this, leaf, row_id);
|
483
462
|
return true;
|
484
463
|
}
|
485
464
|
|
486
465
|
bool ART::Insert(Node &node, const ARTKey &key, idx_t depth, const row_t &row_id) {
|
487
466
|
|
467
|
+
// node is currently empty, create a leaf here with the key
|
488
468
|
if (!node.IsSet()) {
|
489
|
-
|
490
|
-
|
469
|
+
D_ASSERT(depth <= key.len);
|
470
|
+
reference<Node> ref_node(node);
|
471
|
+
Prefix::New(*this, ref_node, key, depth, key.len - depth);
|
472
|
+
Leaf::New(ref_node, row_id);
|
491
473
|
return true;
|
492
474
|
}
|
493
475
|
|
494
|
-
|
476
|
+
auto node_type = node.GetType();
|
495
477
|
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
return InsertToLeaf(node, row_id);
|
501
|
-
}
|
478
|
+
// insert the row ID into this leaf
|
479
|
+
if (node_type == NType::LEAF || node_type == NType::LEAF_INLINED) {
|
480
|
+
return InsertToLeaf(node, row_id);
|
481
|
+
}
|
502
482
|
|
503
|
-
|
504
|
-
|
505
|
-
auto
|
506
|
-
new_n4.prefix.Initialize(*this, key, depth, mismatch_position);
|
483
|
+
if (node_type != NType::PREFIX) {
|
484
|
+
D_ASSERT(depth < key.len);
|
485
|
+
auto child = node.GetChild(*this, key[depth]);
|
507
486
|
|
508
|
-
|
509
|
-
|
487
|
+
// recurse, if a child exists at key[depth]
|
488
|
+
if (child) {
|
489
|
+
bool success = Insert(*child, key, depth + 1, row_id);
|
490
|
+
node.ReplaceChild(*this, key[depth], *child);
|
491
|
+
return success;
|
492
|
+
}
|
510
493
|
|
494
|
+
// insert a new leaf node at key[depth]
|
511
495
|
Node leaf_node;
|
512
|
-
|
513
|
-
|
514
|
-
|
496
|
+
reference<Node> ref_node(leaf_node);
|
497
|
+
if (depth + 1 < key.len) {
|
498
|
+
Prefix::New(*this, ref_node, key, depth + 1, key.len - depth - 1);
|
499
|
+
}
|
500
|
+
Leaf::New(ref_node, row_id);
|
501
|
+
Node::InsertChild(*this, node, key[depth], leaf_node);
|
515
502
|
return true;
|
516
503
|
}
|
517
504
|
|
518
|
-
//
|
519
|
-
|
520
|
-
|
505
|
+
// this is a prefix node, traverse
|
506
|
+
reference<Node> next_node(node);
|
507
|
+
auto mismatch_position = Prefix::Traverse(*this, next_node, key, depth);
|
521
508
|
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
// prefix differs, create new node
|
526
|
-
auto old_node = node;
|
527
|
-
auto &new_n4 = Node4::New(*this, node);
|
528
|
-
new_n4.prefix.Initialize(*this, key, depth, mismatch_position);
|
529
|
-
|
530
|
-
auto key_byte = old_node_prefix.Reduce(*this, mismatch_position);
|
531
|
-
Node4::InsertChild(*this, node, key_byte, old_node);
|
532
|
-
|
533
|
-
Node leaf_node;
|
534
|
-
Leaf::New(*this, leaf_node, key, depth + mismatch_position + 1, row_id);
|
535
|
-
Node4::InsertChild(*this, node, key[depth + mismatch_position], leaf_node);
|
536
|
-
|
537
|
-
return true;
|
538
|
-
}
|
539
|
-
depth += node.GetPrefix(*this).count;
|
509
|
+
// prefix matches key
|
510
|
+
if (next_node.get().GetType() != NType::PREFIX) {
|
511
|
+
return Insert(next_node, key, depth, row_id);
|
540
512
|
}
|
541
513
|
|
542
|
-
//
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
514
|
+
// prefix does not match the key, we need to create a new Node4; this new Node4 has two children,
|
515
|
+
// the remaining part of the prefix, and the new leaf
|
516
|
+
Node remaining_prefix;
|
517
|
+
auto prefix_byte = Prefix::GetByte(*this, next_node, mismatch_position);
|
518
|
+
Prefix::Split(*this, next_node, remaining_prefix, mismatch_position);
|
519
|
+
Node4::New(*this, next_node);
|
520
|
+
|
521
|
+
// insert remaining prefix
|
522
|
+
Node4::InsertChild(*this, next_node, prefix_byte, remaining_prefix);
|
550
523
|
|
551
|
-
// insert
|
524
|
+
// insert new leaf
|
552
525
|
Node leaf_node;
|
553
|
-
|
554
|
-
|
526
|
+
reference<Node> ref_node(leaf_node);
|
527
|
+
if (depth + 1 < key.len) {
|
528
|
+
Prefix::New(*this, ref_node, key, depth + 1, key.len - depth - 1);
|
529
|
+
}
|
530
|
+
Leaf::New(ref_node, row_id);
|
531
|
+
Node4::InsertChild(*this, next_node, key[depth], leaf_node);
|
555
532
|
return true;
|
556
533
|
}
|
557
534
|
|
@@ -590,19 +567,9 @@ void ART::Delete(IndexLock &state, DataChunk &input, Vector &row_ids) {
|
|
590
567
|
continue;
|
591
568
|
}
|
592
569
|
|
593
|
-
auto
|
594
|
-
if (
|
595
|
-
|
596
|
-
|
597
|
-
if (leaf.IsInlined()) {
|
598
|
-
D_ASSERT(row_identifiers[i] != leaf.row_ids.inlined);
|
599
|
-
continue;
|
600
|
-
}
|
601
|
-
|
602
|
-
D_ASSERT(leaf.row_ids.ptr.IsSet());
|
603
|
-
Node leaf_segment = leaf.row_ids.ptr;
|
604
|
-
auto position = leaf.FindRowId(*this, leaf_segment, row_identifiers[i]);
|
605
|
-
D_ASSERT(position == (uint32_t)DConstants::INVALID_INDEX);
|
570
|
+
auto leaf = Lookup(*tree, keys[i], 0);
|
571
|
+
if (leaf.IsSet()) {
|
572
|
+
D_ASSERT(!Leaf::ContainsRowId(*this, leaf, row_identifiers[i]));
|
606
573
|
}
|
607
574
|
}
|
608
575
|
#endif
|
@@ -614,46 +581,48 @@ void ART::Erase(Node &node, const ARTKey &key, idx_t depth, const row_t &row_id)
|
|
614
581
|
return;
|
615
582
|
}
|
616
583
|
|
617
|
-
//
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
Node::Free(*this, node);
|
624
|
-
node.Reset();
|
584
|
+
// handle prefix
|
585
|
+
reference<Node> next_node(node);
|
586
|
+
if (next_node.get().GetType() == NType::PREFIX) {
|
587
|
+
Prefix::Traverse(*this, next_node, key, depth);
|
588
|
+
if (next_node.get().GetType() == NType::PREFIX) {
|
589
|
+
return;
|
625
590
|
}
|
626
|
-
return;
|
627
591
|
}
|
628
592
|
|
629
|
-
//
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
return;
|
593
|
+
// delete a row ID from a leaf (root is leaf with possible prefix nodes)
|
594
|
+
if (next_node.get().GetType() == NType::LEAF || next_node.get().GetType() == NType::LEAF_INLINED) {
|
595
|
+
if (Leaf::Remove(*this, next_node, row_id)) {
|
596
|
+
Node::Free(*this, node);
|
634
597
|
}
|
635
|
-
|
598
|
+
return;
|
636
599
|
}
|
637
600
|
|
638
|
-
|
601
|
+
D_ASSERT(depth < key.len);
|
602
|
+
auto child = next_node.get().GetChild(*this, key[depth]);
|
639
603
|
if (child) {
|
640
604
|
D_ASSERT(child->IsSet());
|
641
605
|
|
642
|
-
|
643
|
-
|
644
|
-
|
645
|
-
|
606
|
+
auto temp_depth = depth + 1;
|
607
|
+
reference<Node> child_node(*child);
|
608
|
+
if (child_node.get().GetType() == NType::PREFIX) {
|
609
|
+
Prefix::Traverse(*this, child_node, key, temp_depth);
|
610
|
+
if (child_node.get().GetType() == NType::PREFIX) {
|
611
|
+
return;
|
612
|
+
}
|
613
|
+
}
|
646
614
|
|
647
|
-
|
648
|
-
|
649
|
-
|
615
|
+
if (child_node.get().GetType() == NType::LEAF || child_node.get().GetType() == NType::LEAF_INLINED) {
|
616
|
+
// leaf found, remove entry
|
617
|
+
if (Leaf::Remove(*this, child_node, row_id)) {
|
618
|
+
Node::DeleteChild(*this, next_node, node, key[depth]);
|
650
619
|
}
|
651
620
|
return;
|
652
621
|
}
|
653
622
|
|
654
623
|
// recurse
|
655
624
|
Erase(*child, key, depth + 1, row_id);
|
656
|
-
|
625
|
+
next_node.get().ReplaceChild(*this, key[depth], *child);
|
657
626
|
}
|
658
627
|
}
|
659
628
|
|
@@ -697,20 +666,11 @@ static ARTKey CreateKey(ArenaAllocator &allocator, PhysicalType type, Value &val
|
|
697
666
|
|
698
667
|
bool ART::SearchEqual(ARTKey &key, idx_t max_count, vector<row_t> &result_ids) {
|
699
668
|
|
700
|
-
auto
|
701
|
-
if (!
|
669
|
+
auto leaf = Lookup(*tree, key, 0);
|
670
|
+
if (!leaf.IsSet()) {
|
702
671
|
return true;
|
703
672
|
}
|
704
|
-
|
705
|
-
auto &leaf = Leaf::Get(*this, leaf_node);
|
706
|
-
if (leaf.count > max_count) {
|
707
|
-
return false;
|
708
|
-
}
|
709
|
-
for (idx_t i = 0; i < leaf.count; i++) {
|
710
|
-
row_t row_id = leaf.GetRowId(*this, i);
|
711
|
-
result_ids.push_back(row_id);
|
712
|
-
}
|
713
|
-
return true;
|
673
|
+
return Leaf::GetRowIds(*this, leaf, result_ids, max_count);
|
714
674
|
}
|
715
675
|
|
716
676
|
void ART::SearchEqualJoinNoFetch(ARTKey &key, idx_t &result_size) {
|
@@ -722,8 +682,10 @@ void ART::SearchEqualJoinNoFetch(ARTKey &key, idx_t &result_size) {
|
|
722
682
|
return;
|
723
683
|
}
|
724
684
|
|
725
|
-
|
726
|
-
|
685
|
+
// we only perform index joins on PK/FK columns
|
686
|
+
D_ASSERT(leaf_node.GetType() == NType::LEAF_INLINED);
|
687
|
+
result_size = 1;
|
688
|
+
return;
|
727
689
|
}
|
728
690
|
|
729
691
|
//===--------------------------------------------------------------------===//
|
@@ -733,35 +695,28 @@ void ART::SearchEqualJoinNoFetch(ARTKey &key, idx_t &result_size) {
|
|
733
695
|
Node ART::Lookup(Node node, const ARTKey &key, idx_t depth) {
|
734
696
|
|
735
697
|
while (node.IsSet()) {
|
736
|
-
|
737
|
-
|
738
|
-
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
}
|
698
|
+
|
699
|
+
// traverse prefix, if exists
|
700
|
+
reference<Node> next_node(node);
|
701
|
+
if (next_node.get().GetType() == NType::PREFIX) {
|
702
|
+
Prefix::Traverse(*this, next_node, key, depth);
|
703
|
+
if (next_node.get().GetType() == NType::PREFIX) {
|
704
|
+
return Node();
|
744
705
|
}
|
745
|
-
return node;
|
746
706
|
}
|
747
|
-
|
748
|
-
if (
|
749
|
-
|
750
|
-
if (key[depth + pos] != node_prefix.GetByte(*this, pos)) {
|
751
|
-
// prefix mismatch, subtree of node does not contain key
|
752
|
-
return Node();
|
753
|
-
}
|
754
|
-
}
|
755
|
-
depth += node_prefix.count;
|
707
|
+
|
708
|
+
if (next_node.get().GetType() == NType::LEAF || next_node.get().GetType() == NType::LEAF_INLINED) {
|
709
|
+
return next_node.get();
|
756
710
|
}
|
757
711
|
|
758
|
-
|
759
|
-
auto child =
|
712
|
+
D_ASSERT(depth < key.len);
|
713
|
+
auto child = next_node.get().GetChild(*this, key[depth]);
|
760
714
|
if (!child) {
|
715
|
+
// prefix matches key, but no child at byte, ART/subtree does not contain key
|
761
716
|
return Node();
|
762
717
|
}
|
763
718
|
|
764
|
-
//
|
719
|
+
// lookup in child node
|
765
720
|
node = *child;
|
766
721
|
D_ASSERT(node.IsSet());
|
767
722
|
depth++;
|
@@ -771,21 +726,21 @@ Node ART::Lookup(Node node, const ARTKey &key, idx_t depth) {
|
|
771
726
|
}
|
772
727
|
|
773
728
|
//===--------------------------------------------------------------------===//
|
774
|
-
// Greater Than
|
775
|
-
// Returns: True (If found leaf >= key)
|
776
|
-
// False (Otherwise)
|
729
|
+
// Greater Than and Less Than
|
777
730
|
//===--------------------------------------------------------------------===//
|
778
731
|
|
779
|
-
bool ART::SearchGreater(ARTIndexScanState &state, ARTKey &key, bool
|
780
|
-
vector<row_t> &result_ids) {
|
732
|
+
bool ART::SearchGreater(ARTIndexScanState &state, ARTKey &key, bool equal, idx_t max_count, vector<row_t> &result_ids) {
|
781
733
|
|
782
|
-
|
734
|
+
if (!tree->IsSet()) {
|
735
|
+
return true;
|
736
|
+
}
|
737
|
+
Iterator &it = state.iterator;
|
783
738
|
|
784
|
-
//
|
785
|
-
// that satisfies our requirement
|
739
|
+
// find the lowest value that satisfies the predicate
|
786
740
|
if (!it.art) {
|
787
741
|
it.art = this;
|
788
|
-
if (!it.LowerBound(*tree, key,
|
742
|
+
if (!it.LowerBound(*tree, key, equal, 0)) {
|
743
|
+
// early-out, if the maximum value in the ART is lower than the lower bound
|
789
744
|
return true;
|
790
745
|
}
|
791
746
|
}
|
@@ -796,86 +751,84 @@ bool ART::SearchGreater(ARTIndexScanState &state, ARTKey &key, bool inclusive, i
|
|
796
751
|
return it.Scan(empty_key, max_count, result_ids, false);
|
797
752
|
}
|
798
753
|
|
799
|
-
|
800
|
-
// Less Than
|
801
|
-
//===--------------------------------------------------------------------===//
|
802
|
-
|
803
|
-
bool ART::SearchLess(ARTIndexScanState &state, ARTKey &upper_bound, bool inclusive, idx_t max_count,
|
754
|
+
bool ART::SearchLess(ARTIndexScanState &state, ARTKey &upper_bound, bool equal, idx_t max_count,
|
804
755
|
vector<row_t> &result_ids) {
|
805
756
|
|
806
757
|
if (!tree->IsSet()) {
|
807
758
|
return true;
|
808
759
|
}
|
809
|
-
|
810
|
-
auto &it = state.iterator;
|
760
|
+
Iterator &it = state.iterator;
|
811
761
|
|
812
762
|
if (!it.art) {
|
813
763
|
it.art = this;
|
814
|
-
//
|
764
|
+
// find the minimum value in the ART: we start scanning from this value
|
815
765
|
it.FindMinimum(*tree);
|
816
|
-
// early
|
817
|
-
if (it.
|
766
|
+
// early-out, if the minimum value is higher than the upper bound
|
767
|
+
if (it.current_key > upper_bound) {
|
818
768
|
return true;
|
819
769
|
}
|
820
770
|
}
|
821
771
|
|
822
772
|
// now continue the scan until we reach the upper bound
|
823
|
-
return it.Scan(upper_bound, max_count, result_ids,
|
773
|
+
return it.Scan(upper_bound, max_count, result_ids, equal);
|
824
774
|
}
|
825
775
|
|
826
776
|
//===--------------------------------------------------------------------===//
|
827
777
|
// Closed Range Query
|
828
778
|
//===--------------------------------------------------------------------===//
|
829
779
|
|
830
|
-
bool ART::SearchCloseRange(ARTIndexScanState &state, ARTKey &lower_bound, ARTKey &upper_bound, bool
|
831
|
-
bool
|
832
|
-
|
780
|
+
bool ART::SearchCloseRange(ARTIndexScanState &state, ARTKey &lower_bound, ARTKey &upper_bound, bool left_equal,
|
781
|
+
bool right_equal, idx_t max_count, vector<row_t> &result_ids) {
|
782
|
+
|
783
|
+
Iterator &it = state.iterator;
|
833
784
|
|
834
|
-
//
|
785
|
+
// find the first node that satisfies the left predicate
|
835
786
|
if (!it.art) {
|
836
787
|
it.art = this;
|
837
|
-
if (!it.LowerBound(*tree, lower_bound,
|
788
|
+
if (!it.LowerBound(*tree, lower_bound, left_equal, 0)) {
|
789
|
+
// early-out, if the maximum value in the ART is lower than the lower bound
|
838
790
|
return true;
|
839
791
|
}
|
840
792
|
}
|
841
793
|
|
842
794
|
// now continue the scan until we reach the upper bound
|
843
|
-
return it.Scan(upper_bound, max_count, result_ids,
|
795
|
+
return it.Scan(upper_bound, max_count, result_ids, right_equal);
|
844
796
|
}
|
845
797
|
|
846
|
-
bool ART::Scan(const Transaction &transaction, const DataTable &table, IndexScanState &
|
847
|
-
|
848
|
-
|
798
|
+
bool ART::Scan(const Transaction &transaction, const DataTable &table, IndexScanState &state, const idx_t max_count,
|
799
|
+
vector<row_t> &result_ids) {
|
800
|
+
|
801
|
+
auto &scan_state = state.Cast<ARTIndexScanState>();
|
849
802
|
vector<row_t> row_ids;
|
850
803
|
bool success;
|
851
804
|
|
852
805
|
// FIXME: the key directly owning the data for a single key might be more efficient
|
853
|
-
D_ASSERT(
|
806
|
+
D_ASSERT(scan_state.values[0].type().InternalType() == types[0]);
|
854
807
|
ArenaAllocator arena_allocator(Allocator::Get(db));
|
855
|
-
auto key = CreateKey(arena_allocator, types[0],
|
808
|
+
auto key = CreateKey(arena_allocator, types[0], scan_state.values[0]);
|
856
809
|
|
857
|
-
if (
|
810
|
+
if (scan_state.values[1].IsNull()) {
|
858
811
|
|
859
812
|
// single predicate
|
860
813
|
lock_guard<mutex> l(lock);
|
861
|
-
switch (
|
814
|
+
switch (scan_state.expressions[0]) {
|
862
815
|
case ExpressionType::COMPARE_EQUAL:
|
863
816
|
success = SearchEqual(key, max_count, row_ids);
|
864
817
|
break;
|
865
818
|
case ExpressionType::COMPARE_GREATERTHANOREQUALTO:
|
866
|
-
success = SearchGreater(
|
819
|
+
success = SearchGreater(scan_state, key, true, max_count, row_ids);
|
867
820
|
break;
|
868
821
|
case ExpressionType::COMPARE_GREATERTHAN:
|
869
|
-
success = SearchGreater(
|
822
|
+
success = SearchGreater(scan_state, key, false, max_count, row_ids);
|
870
823
|
break;
|
871
824
|
case ExpressionType::COMPARE_LESSTHANOREQUALTO:
|
872
|
-
success = SearchLess(
|
825
|
+
success = SearchLess(scan_state, key, true, max_count, row_ids);
|
873
826
|
break;
|
874
827
|
case ExpressionType::COMPARE_LESSTHAN:
|
875
|
-
success = SearchLess(
|
828
|
+
success = SearchLess(scan_state, key, false, max_count, row_ids);
|
876
829
|
break;
|
877
830
|
default:
|
878
|
-
throw InternalException("
|
831
|
+
throw InternalException("Index scan type not implemented");
|
879
832
|
}
|
880
833
|
|
881
834
|
} else {
|
@@ -883,12 +836,12 @@ bool ART::Scan(const Transaction &transaction, const DataTable &table, IndexScan
|
|
883
836
|
// two predicates
|
884
837
|
lock_guard<mutex> l(lock);
|
885
838
|
|
886
|
-
D_ASSERT(
|
887
|
-
auto upper_bound = CreateKey(arena_allocator, types[0],
|
839
|
+
D_ASSERT(scan_state.values[1].type().InternalType() == types[0]);
|
840
|
+
auto upper_bound = CreateKey(arena_allocator, types[0], scan_state.values[1]);
|
888
841
|
|
889
|
-
bool
|
890
|
-
bool
|
891
|
-
success = SearchCloseRange(
|
842
|
+
bool left_equal = scan_state.expressions[0] == ExpressionType ::COMPARE_GREATERTHANOREQUALTO;
|
843
|
+
bool right_equal = scan_state.expressions[1] == ExpressionType ::COMPARE_LESSTHANOREQUALTO;
|
844
|
+
success = SearchCloseRange(scan_state, key, upper_bound, left_equal, right_equal, max_count, row_ids);
|
892
845
|
}
|
893
846
|
|
894
847
|
if (!success) {
|
@@ -987,20 +940,18 @@ void ART::CheckConstraintsForChunk(DataChunk &input, ConflictManager &conflict_m
|
|
987
940
|
continue;
|
988
941
|
}
|
989
942
|
|
990
|
-
auto
|
991
|
-
if (!
|
943
|
+
auto leaf = Lookup(*tree, keys[i], 0);
|
944
|
+
if (!leaf.IsSet()) {
|
992
945
|
if (conflict_manager.AddMiss(i)) {
|
993
946
|
found_conflict = i;
|
994
947
|
}
|
995
948
|
continue;
|
996
949
|
}
|
997
950
|
|
998
|
-
//
|
999
|
-
// NOTE:
|
1000
|
-
|
1001
|
-
|
1002
|
-
auto row_id = leaf.GetRowId(*this, 0);
|
1003
|
-
if (conflict_manager.AddHit(i, row_id)) {
|
951
|
+
// when we find a node, we need to update the 'matches' and 'row_ids'
|
952
|
+
// NOTE: leaves can have more than one row_id, but for UNIQUE/PRIMARY KEY they will only have one
|
953
|
+
D_ASSERT(leaf.GetType() == NType::LEAF_INLINED);
|
954
|
+
if (conflict_manager.AddHit(i, leaf.GetRowId())) {
|
1004
955
|
found_conflict = i;
|
1005
956
|
}
|
1006
957
|
}
|
@@ -1020,13 +971,13 @@ void ART::CheckConstraintsForChunk(DataChunk &input, ConflictManager &conflict_m
|
|
1020
971
|
// Serialization
|
1021
972
|
//===--------------------------------------------------------------------===//
|
1022
973
|
|
1023
|
-
BlockPointer ART::Serialize(
|
974
|
+
BlockPointer ART::Serialize(MetadataWriter &writer) {
|
1024
975
|
|
1025
976
|
lock_guard<mutex> l(lock);
|
1026
977
|
if (tree->IsSet()) {
|
1027
978
|
serialized_data_pointer = tree->Serialize(*this, writer);
|
1028
979
|
} else {
|
1029
|
-
serialized_data_pointer =
|
980
|
+
serialized_data_pointer = BlockPointer();
|
1030
981
|
}
|
1031
982
|
|
1032
983
|
return serialized_data_pointer;
|
@@ -1038,26 +989,28 @@ BlockPointer ART::Serialize(MetaBlockWriter &writer) {
|
|
1038
989
|
|
1039
990
|
void ART::InitializeVacuum(ARTFlags &flags) {
|
1040
991
|
|
1041
|
-
flags.vacuum_flags.reserve(allocators
|
1042
|
-
for (auto &allocator : allocators) {
|
1043
|
-
flags.vacuum_flags.push_back(allocator
|
992
|
+
flags.vacuum_flags.reserve(allocators->size());
|
993
|
+
for (auto &allocator : *allocators) {
|
994
|
+
flags.vacuum_flags.push_back(allocator.InitializeVacuum());
|
1044
995
|
}
|
1045
996
|
}
|
1046
997
|
|
1047
998
|
void ART::FinalizeVacuum(const ARTFlags &flags) {
|
1048
999
|
|
1049
|
-
for (idx_t i = 0; i < allocators
|
1000
|
+
for (idx_t i = 0; i < allocators->size(); i++) {
|
1050
1001
|
if (flags.vacuum_flags[i]) {
|
1051
|
-
allocators[i]
|
1002
|
+
(*allocators)[i].FinalizeVacuum();
|
1052
1003
|
}
|
1053
1004
|
}
|
1054
1005
|
}
|
1055
1006
|
|
1056
1007
|
void ART::Vacuum(IndexLock &state) {
|
1057
1008
|
|
1009
|
+
D_ASSERT(owns_data);
|
1010
|
+
|
1058
1011
|
if (!tree->IsSet()) {
|
1059
|
-
for (auto &allocator : allocators) {
|
1060
|
-
allocator
|
1012
|
+
for (auto &allocator : *allocators) {
|
1013
|
+
allocator.Reset();
|
1061
1014
|
}
|
1062
1015
|
return;
|
1063
1016
|
}
|
@@ -1079,13 +1032,13 @@ void ART::Vacuum(IndexLock &state) {
|
|
1079
1032
|
}
|
1080
1033
|
|
1081
1034
|
// traverse the allocated memory of the tree to perform a vacuum
|
1082
|
-
|
1035
|
+
tree->Vacuum(*this, flags);
|
1083
1036
|
|
1084
1037
|
// finalize the vacuum operation
|
1085
1038
|
FinalizeVacuum(flags);
|
1086
1039
|
|
1087
|
-
for (auto &allocator : allocators) {
|
1088
|
-
allocator
|
1040
|
+
for (auto &allocator : *allocators) {
|
1041
|
+
allocator.Verify();
|
1089
1042
|
}
|
1090
1043
|
}
|
1091
1044
|
|
@@ -1095,9 +1048,11 @@ void ART::Vacuum(IndexLock &state) {
|
|
1095
1048
|
|
1096
1049
|
void ART::InitializeMerge(ARTFlags &flags) {
|
1097
1050
|
|
1098
|
-
|
1099
|
-
|
1100
|
-
|
1051
|
+
D_ASSERT(owns_data);
|
1052
|
+
|
1053
|
+
flags.merge_buffer_counts.reserve(allocators->size());
|
1054
|
+
for (auto &allocator : *allocators) {
|
1055
|
+
flags.merge_buffer_counts.emplace_back(allocator.buffers.size());
|
1101
1056
|
}
|
1102
1057
|
}
|
1103
1058
|
|
@@ -1108,16 +1063,18 @@ bool ART::MergeIndexes(IndexLock &state, Index &other_index) {
|
|
1108
1063
|
return true;
|
1109
1064
|
}
|
1110
1065
|
|
1111
|
-
if (
|
1112
|
-
|
1113
|
-
|
1114
|
-
|
1115
|
-
|
1116
|
-
|
1066
|
+
if (other_art.owns_data) {
|
1067
|
+
if (tree->IsSet()) {
|
1068
|
+
// fully deserialize other_index, and traverse it to increment its buffer IDs
|
1069
|
+
ARTFlags flags;
|
1070
|
+
InitializeMerge(flags);
|
1071
|
+
other_art.tree->InitializeMerge(other_art, flags);
|
1072
|
+
}
|
1117
1073
|
|
1118
|
-
|
1119
|
-
|
1120
|
-
|
1074
|
+
// merge the node storage
|
1075
|
+
for (idx_t i = 0; i < allocators->size(); i++) {
|
1076
|
+
(*allocators)[i].Merge((*other_art.allocators)[i]);
|
1077
|
+
}
|
1121
1078
|
}
|
1122
1079
|
|
1123
1080
|
// merge the ARTs
|
@@ -1125,8 +1082,8 @@ bool ART::MergeIndexes(IndexLock &state, Index &other_index) {
|
|
1125
1082
|
return false;
|
1126
1083
|
}
|
1127
1084
|
|
1128
|
-
for (auto &allocator : allocators) {
|
1129
|
-
allocator
|
1085
|
+
for (auto &allocator : *allocators) {
|
1086
|
+
allocator.Verify();
|
1130
1087
|
}
|
1131
1088
|
return true;
|
1132
1089
|
}
|
@@ -1136,6 +1093,9 @@ bool ART::MergeIndexes(IndexLock &state, Index &other_index) {
|
|
1136
1093
|
//===--------------------------------------------------------------------===//
|
1137
1094
|
|
1138
1095
|
string ART::VerifyAndToString(IndexLock &state, const bool only_verify) {
|
1096
|
+
// FIXME: this can be improved by counting the allocations of each node type,
|
1097
|
+
// FIXME: and by asserting that each fixed-size allocator lists an equal number of
|
1098
|
+
// FIXME: allocations of that type
|
1139
1099
|
return VerifyAndToStringInternal(only_verify);
|
1140
1100
|
}
|
1141
1101
|
|