duckdb 1.1.2-dev4.0 → 1.1.3
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/package.json +1 -1
- package/src/duckdb/extension/icu/third_party/icu/common/putil.cpp +0 -5
- package/src/duckdb/extension/icu/third_party/icu/common/rbbiscan.cpp +1 -1
- package/src/duckdb/extension/icu/third_party/icu/common/rbbitblb.cpp +1 -1
- package/src/duckdb/extension/icu/third_party/icu/common/ucurr.cpp +1 -1
- package/src/duckdb/extension/icu/third_party/icu/common/uresbund.cpp +1 -1
- package/src/duckdb/extension/icu/third_party/icu/common/uresimp.h +31 -31
- package/src/duckdb/extension/icu/third_party/icu/common/ustring.cpp +1 -1
- package/src/duckdb/extension/icu/third_party/icu/common/uvector.cpp +1 -1
- package/src/duckdb/extension/icu/third_party/icu/i18n/coleitr.cpp +12 -12
- package/src/duckdb/extension/icu/third_party/icu/i18n/format.cpp +1 -1
- package/src/duckdb/extension/icu/third_party/icu/i18n/listformatter.cpp +4 -4
- package/src/duckdb/extension/icu/third_party/icu/i18n/number_decimalquantity.h +1 -1
- package/src/duckdb/extension/icu/third_party/icu/i18n/tzgnames.cpp +1 -1
- package/src/duckdb/extension/icu/third_party/icu/i18n/unicode/coleitr.h +28 -28
- package/src/duckdb/extension/icu/third_party/icu/i18n/unicode/format.h +7 -7
- package/src/duckdb/extension/icu/third_party/icu/i18n/unicode/ucol.h +1 -1
- package/src/duckdb/extension/icu/third_party/icu/i18n/unicode/ucoleitr.h +41 -41
- package/src/duckdb/extension/icu/third_party/icu/i18n/unicode/umsg.h +41 -41
- package/src/duckdb/extension/icu/third_party/icu/i18n/usrchimp.h +3 -3
- package/src/duckdb/extension/json/include/json_common.hpp +1 -1
- package/src/duckdb/extension/json/json_functions/json_structure.cpp +13 -7
- package/src/duckdb/extension/parquet/column_writer.cpp +2 -1
- package/src/duckdb/extension/parquet/geo_parquet.cpp +24 -9
- package/src/duckdb/extension/parquet/include/geo_parquet.hpp +3 -1
- package/src/duckdb/extension/parquet/include/parquet_reader.hpp +1 -0
- package/src/duckdb/extension/parquet/include/parquet_rle_bp_decoder.hpp +1 -1
- package/src/duckdb/extension/parquet/include/templated_column_reader.hpp +0 -4
- package/src/duckdb/extension/parquet/parquet_extension.cpp +20 -6
- package/src/duckdb/extension/parquet/parquet_reader.cpp +1 -2
- package/src/duckdb/extension/parquet/parquet_writer.cpp +1 -1
- package/src/duckdb/extension/parquet/serialize_parquet.cpp +0 -2
- package/src/duckdb/src/catalog/catalog_entry/duck_schema_entry.cpp +8 -1
- package/src/duckdb/src/catalog/default/default_functions.cpp +5 -5
- package/src/duckdb/src/common/allocator.cpp +3 -2
- package/src/duckdb/src/common/arrow/arrow_appender.cpp +1 -0
- package/src/duckdb/src/common/arrow/arrow_converter.cpp +11 -0
- package/src/duckdb/src/common/arrow/schema_metadata.cpp +6 -4
- package/src/duckdb/src/common/enum_util.cpp +33 -0
- package/src/duckdb/src/common/exception.cpp +3 -0
- package/src/duckdb/src/common/extra_type_info.cpp +1 -44
- package/src/duckdb/src/common/field_writer.cpp +97 -0
- package/src/duckdb/src/common/render_tree.cpp +7 -5
- package/src/duckdb/src/common/row_operations/row_match.cpp +359 -0
- package/src/duckdb/src/common/serializer/buffered_deserializer.cpp +27 -0
- package/src/duckdb/src/common/serializer/buffered_serializer.cpp +36 -0
- package/src/duckdb/src/common/serializer/format_serializer.cpp +15 -0
- package/src/duckdb/src/common/serializer.cpp +24 -0
- package/src/duckdb/src/common/sort/comparators.cpp +2 -2
- package/src/duckdb/src/common/types/bit.cpp +57 -34
- package/src/duckdb/src/common/types/data_chunk.cpp +32 -29
- package/src/duckdb/src/common/types/vector_cache.cpp +12 -6
- package/src/duckdb/src/common/vector_operations/comparison_operators.cpp +14 -0
- package/src/duckdb/src/core_functions/aggregate/distributive/bitstring_agg.cpp +20 -1
- package/src/duckdb/src/core_functions/aggregate/distributive/minmax.cpp +2 -2
- package/src/duckdb/src/core_functions/aggregate/holistic/approx_top_k.cpp +32 -7
- package/src/duckdb/src/core_functions/function_list.cpp +1 -2
- package/src/duckdb/src/core_functions/scalar/bit/bitstring.cpp +23 -5
- package/src/duckdb/src/core_functions/scalar/date/date_diff.cpp +12 -6
- package/src/duckdb/src/core_functions/scalar/date/date_part.cpp +1 -1
- package/src/duckdb/src/execution/expression_executor/execute_between.cpp +4 -3
- package/src/duckdb/src/execution/expression_executor/execute_case.cpp +4 -3
- package/src/duckdb/src/execution/expression_executor/execute_cast.cpp +2 -1
- package/src/duckdb/src/execution/expression_executor/execute_comparison.cpp +3 -2
- package/src/duckdb/src/execution/expression_executor/execute_conjunction.cpp +2 -1
- package/src/duckdb/src/execution/expression_executor/execute_function.cpp +2 -1
- package/src/duckdb/src/execution/expression_executor/execute_operator.cpp +3 -2
- package/src/duckdb/src/execution/expression_executor/execute_reference.cpp +1 -1
- package/src/duckdb/src/execution/expression_executor.cpp +9 -3
- package/src/duckdb/src/execution/expression_executor_state.cpp +11 -9
- package/src/duckdb/src/execution/index/art/fixed_size_allocator.cpp +238 -0
- package/src/duckdb/src/execution/index/art/plan_art.cpp +94 -0
- package/src/duckdb/src/execution/index/index_type_set.cpp +4 -1
- package/src/duckdb/src/execution/join_hashtable.cpp +7 -8
- package/src/duckdb/src/execution/operator/aggregate/physical_hash_aggregate.cpp +6 -4
- package/src/duckdb/src/execution/operator/csv_scanner/buffer_manager/csv_buffer_manager.cpp +4 -4
- package/src/duckdb/src/execution/operator/csv_scanner/scanner/base_scanner.cpp +1 -1
- package/src/duckdb/src/execution/operator/csv_scanner/scanner/csv_schema.cpp +44 -5
- package/src/duckdb/src/execution/operator/csv_scanner/scanner/string_value_scanner.cpp +28 -24
- package/src/duckdb/src/execution/operator/csv_scanner/sniffer/csv_sniffer.cpp +25 -26
- package/src/duckdb/src/execution/operator/csv_scanner/sniffer/dialect_detection.cpp +5 -3
- package/src/duckdb/src/execution/operator/csv_scanner/sniffer/header_detection.cpp +4 -4
- package/src/duckdb/src/execution/operator/csv_scanner/sniffer/type_detection.cpp +2 -2
- package/src/duckdb/src/execution/operator/csv_scanner/sniffer/type_refinement.cpp +1 -1
- package/src/duckdb/src/execution/operator/csv_scanner/sniffer/type_replacement.cpp +1 -1
- package/src/duckdb/src/execution/operator/csv_scanner/state_machine/csv_state_machine.cpp +1 -1
- package/src/duckdb/src/execution/operator/csv_scanner/state_machine/csv_state_machine_cache.cpp +2 -2
- package/src/duckdb/src/execution/operator/csv_scanner/table_function/csv_file_scanner.cpp +1 -1
- package/src/duckdb/src/execution/operator/csv_scanner/table_function/global_csv_state.cpp +1 -1
- package/src/duckdb/src/execution/operator/csv_scanner/util/csv_reader_options.cpp +73 -27
- package/src/duckdb/src/execution/operator/helper/physical_buffered_collector.cpp +1 -1
- package/src/duckdb/src/execution/operator/persistent/base_csv_reader.cpp +695 -0
- package/src/duckdb/src/execution/operator/persistent/buffered_csv_reader.cpp +1487 -0
- package/src/duckdb/src/execution/operator/persistent/csv_buffer.cpp +72 -0
- package/src/duckdb/src/execution/operator/persistent/csv_file_handle.cpp +158 -0
- package/src/duckdb/src/execution/operator/persistent/csv_reader_options.cpp +280 -0
- package/src/duckdb/src/execution/operator/persistent/parallel_csv_reader.cpp +666 -0
- package/src/duckdb/src/execution/operator/persistent/physical_export.cpp +14 -4
- package/src/duckdb/src/execution/operator/schema/physical_create_index.cpp +207 -0
- package/src/duckdb/src/execution/partitionable_hashtable.cpp +207 -0
- package/src/duckdb/src/execution/perfect_aggregate_hashtable.cpp +6 -1
- package/src/duckdb/src/execution/physical_plan/plan_comparison_join.cpp +0 -4
- package/src/duckdb/src/execution/physical_plan/plan_create_index.cpp +14 -87
- package/src/duckdb/src/execution/physical_plan/plan_export.cpp +1 -1
- package/src/duckdb/src/execution/physical_plan/plan_get.cpp +1 -1
- package/src/duckdb/src/execution/reservoir_sample.cpp +1 -1
- package/src/duckdb/src/execution/window_executor.cpp +3 -3
- package/src/duckdb/src/function/pragma/pragma_queries.cpp +1 -1
- package/src/duckdb/src/function/scalar/strftime_format.cpp +1 -2
- package/src/duckdb/src/function/scalar/string/concat.cpp +118 -151
- package/src/duckdb/src/function/table/arrow.cpp +13 -0
- package/src/duckdb/src/function/table/arrow_conversion.cpp +12 -7
- package/src/duckdb/src/function/table/copy_csv.cpp +1 -1
- package/src/duckdb/src/function/table/read_csv.cpp +2 -30
- package/src/duckdb/src/function/table/sniff_csv.cpp +2 -1
- package/src/duckdb/src/function/table/system/duckdb_secrets.cpp +15 -7
- package/src/duckdb/src/function/table/version/pragma_version.cpp +3 -3
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry_retriever.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/atomic.hpp +13 -1
- package/src/duckdb/src/include/duckdb/common/bitpacking.hpp +3 -4
- package/src/duckdb/src/include/duckdb/common/enum_util.hpp +8 -0
- package/src/duckdb/src/include/duckdb/common/enums/metric_type.hpp +2 -0
- package/src/duckdb/src/include/duckdb/common/exception.hpp +10 -0
- package/src/duckdb/src/include/duckdb/common/extra_type_info/enum_type_info.hpp +53 -0
- package/src/duckdb/src/include/duckdb/common/insertion_order_preserving_map.hpp +5 -5
- package/src/duckdb/src/include/duckdb/common/multi_file_reader.hpp +5 -0
- package/src/duckdb/src/include/duckdb/common/types/bit.hpp +36 -33
- package/src/duckdb/src/include/duckdb/common/types/data_chunk.hpp +10 -13
- package/src/duckdb/src/include/duckdb/common/types/uhugeint.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/types/vector_cache.hpp +7 -5
- package/src/duckdb/src/include/duckdb/common/windows_undefs.hpp +2 -1
- package/src/duckdb/src/include/duckdb/core_functions/aggregate/minmax_n_helpers.hpp +2 -0
- package/src/duckdb/src/include/duckdb/core_functions/scalar/bit_functions.hpp +1 -1
- package/src/duckdb/src/include/duckdb/core_functions/scalar/list_functions.hpp +0 -6
- package/src/duckdb/src/include/duckdb/core_functions/scalar/math_functions.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/expression_executor_state.hpp +3 -2
- package/src/duckdb/src/include/duckdb/execution/index/art/art.hpp +3 -0
- package/src/duckdb/src/include/duckdb/execution/index/index_type.hpp +16 -1
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_buffer_manager.hpp +4 -4
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_reader_options.hpp +4 -2
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_schema.hpp +3 -2
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/sniffer/csv_sniffer.hpp +91 -36
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/sniffer/sniff_result.hpp +36 -0
- package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/string_value_scanner.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/join/perfect_hash_join_executor.hpp +0 -1
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_export.hpp +2 -5
- package/src/duckdb/src/include/duckdb/function/table_function.hpp +1 -1
- package/src/duckdb/src/include/duckdb/main/database.hpp +5 -0
- package/src/duckdb/src/include/duckdb/main/extension_entries.hpp +1 -0
- package/src/duckdb/src/include/duckdb/main/profiling_info.hpp +20 -22
- package/src/duckdb/src/include/duckdb/main/query_profiler.hpp +7 -9
- package/src/duckdb/src/include/duckdb/main/secret/secret.hpp +8 -1
- package/src/duckdb/src/include/duckdb/main/table_description.hpp +14 -0
- package/src/duckdb/src/include/duckdb/optimizer/unnest_rewriter.hpp +5 -5
- package/src/duckdb/src/include/duckdb/parser/parsed_data/exported_table_data.hpp +15 -5
- package/src/duckdb/src/include/duckdb/parser/transformer.hpp +2 -0
- package/src/duckdb/src/include/duckdb/planner/expression_binder/order_binder.hpp +4 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_export.hpp +10 -13
- package/src/duckdb/src/include/duckdb/planner/table_filter.hpp +1 -0
- package/src/duckdb/src/include/duckdb/storage/metadata/metadata_manager.hpp +2 -2
- package/src/duckdb/src/include/duckdb/storage/standard_buffer_manager.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/statistics/distinct_statistics.hpp +0 -2
- package/src/duckdb/src/include/duckdb/storage/table/segment_tree.hpp +1 -0
- package/src/duckdb/src/include/duckdb/transaction/duck_transaction.hpp +5 -1
- package/src/duckdb/src/include/duckdb.h +2 -2
- package/src/duckdb/src/main/appender.cpp +3 -0
- package/src/duckdb/src/main/capi/profiling_info-c.cpp +5 -2
- package/src/duckdb/src/main/client_context.cpp +8 -2
- package/src/duckdb/src/main/connection.cpp +1 -1
- package/src/duckdb/src/main/database.cpp +13 -0
- package/src/duckdb/src/main/extension/extension_helper.cpp +1 -1
- package/src/duckdb/src/main/extension/extension_install.cpp +9 -1
- package/src/duckdb/src/main/extension/extension_load.cpp +3 -2
- package/src/duckdb/src/main/extension_install_info.cpp +1 -1
- package/src/duckdb/src/main/profiling_info.cpp +78 -58
- package/src/duckdb/src/main/query_profiler.cpp +79 -89
- package/src/duckdb/src/main/relation/read_csv_relation.cpp +1 -1
- package/src/duckdb/src/main/secret/secret.cpp +2 -1
- package/src/duckdb/src/main/secret/secret_manager.cpp +14 -0
- package/src/duckdb/src/optimizer/cte_filter_pusher.cpp +4 -2
- package/src/duckdb/src/optimizer/deliminator.cpp +0 -7
- package/src/duckdb/src/optimizer/in_clause_rewriter.cpp +7 -0
- package/src/duckdb/src/optimizer/pushdown/pushdown_left_join.cpp +4 -1
- package/src/duckdb/src/optimizer/unnest_rewriter.cpp +21 -21
- package/src/duckdb/src/parallel/task_scheduler.cpp +9 -0
- package/src/duckdb/src/parser/parsed_data/exported_table_data.cpp +22 -0
- package/src/duckdb/src/parser/parsed_expression_iterator.cpp +3 -0
- package/src/duckdb/src/parser/statement/insert_statement.cpp +7 -1
- package/src/duckdb/src/parser/transform/expression/transform_boolean_test.cpp +1 -1
- package/src/duckdb/src/parser/transform/helpers/transform_typename.cpp +89 -87
- package/src/duckdb/src/parser/transform/statement/transform_pivot_stmt.cpp +2 -2
- package/src/duckdb/src/planner/binder/expression/bind_macro_expression.cpp +4 -9
- package/src/duckdb/src/planner/binder/query_node/bind_select_node.cpp +4 -0
- package/src/duckdb/src/planner/binder/query_node/plan_setop.cpp +2 -2
- package/src/duckdb/src/planner/binder/statement/bind_create_table.cpp +4 -1
- package/src/duckdb/src/planner/binder/statement/bind_export.cpp +4 -3
- package/src/duckdb/src/planner/expression_binder/order_binder.cpp +13 -3
- package/src/duckdb/src/planner/expression_binder.cpp +1 -1
- package/src/duckdb/src/planner/operator/logical_export.cpp +28 -0
- package/src/duckdb/src/planner/table_binding.cpp +1 -2
- package/src/duckdb/src/planner/table_filter.cpp +6 -2
- package/src/duckdb/src/storage/buffer/buffer_pool.cpp +2 -1
- package/src/duckdb/src/storage/checkpoint_manager.cpp +1 -1
- package/src/duckdb/src/storage/compression/bitpacking.cpp +7 -3
- package/src/duckdb/src/storage/compression/dictionary_compression.cpp +1 -1
- package/src/duckdb/src/storage/metadata/metadata_manager.cpp +2 -2
- package/src/duckdb/src/storage/serialization/serialize_logical_operator.cpp +16 -0
- package/src/duckdb/src/storage/serialization/serialize_nodes.cpp +29 -0
- package/src/duckdb/src/storage/serialization/serialize_parse_info.cpp +15 -0
- package/src/duckdb/src/storage/single_file_block_manager.cpp +2 -1
- package/src/duckdb/src/storage/statistics/distinct_statistics.cpp +3 -5
- package/src/duckdb/src/storage/storage_info.cpp +4 -4
- package/src/duckdb/src/storage/table/row_group_collection.cpp +1 -1
- package/src/duckdb/src/storage/table/row_version_manager.cpp +5 -1
- package/src/duckdb/src/storage/temporary_file_manager.cpp +1 -1
- package/src/duckdb/src/transaction/duck_transaction.cpp +15 -14
- package/src/duckdb/third_party/brotli/common/brotli_platform.h +1 -1
- package/src/duckdb/third_party/brotli/dec/decode.cpp +1 -1
- package/src/duckdb/third_party/brotli/enc/memory.cpp +4 -4
- package/src/duckdb/third_party/fsst/libfsst.cpp +1 -1
- package/src/duckdb/third_party/hyperloglog/sds.cpp +1 -1
- package/src/duckdb/third_party/hyperloglog/sds.hpp +1 -1
- package/src/duckdb/third_party/libpg_query/include/common/keywords.hpp +1 -1
- package/src/duckdb/third_party/libpg_query/include/datatype/timestamp.hpp +1 -1
- package/src/duckdb/third_party/libpg_query/include/mb/pg_wchar.hpp +1 -1
- package/src/duckdb/third_party/libpg_query/include/nodes/bitmapset.hpp +1 -1
- package/src/duckdb/third_party/libpg_query/include/nodes/lockoptions.hpp +1 -1
- package/src/duckdb/third_party/libpg_query/include/nodes/makefuncs.hpp +1 -1
- package/src/duckdb/third_party/libpg_query/include/nodes/pg_list.hpp +1 -1
- package/src/duckdb/third_party/libpg_query/include/nodes/value.hpp +1 -1
- package/src/duckdb/third_party/libpg_query/include/parser/gramparse.hpp +1 -1
- package/src/duckdb/third_party/libpg_query/include/parser/parser.hpp +1 -1
- package/src/duckdb/third_party/libpg_query/include/parser/scanner.hpp +1 -1
- package/src/duckdb/third_party/libpg_query/include/parser/scansup.hpp +1 -1
- package/src/duckdb/third_party/libpg_query/include/pg_functions.hpp +1 -1
- package/src/duckdb/third_party/libpg_query/pg_functions.cpp +1 -1
- package/src/duckdb/third_party/libpg_query/src_backend_nodes_list.cpp +1 -1
- package/src/duckdb/third_party/libpg_query/src_backend_nodes_makefuncs.cpp +1 -1
- package/src/duckdb/third_party/libpg_query/src_backend_nodes_value.cpp +1 -1
- package/src/duckdb/third_party/libpg_query/src_backend_parser_gram.cpp +1964 -1964
- package/src/duckdb/third_party/libpg_query/src_backend_parser_parser.cpp +1 -1
- package/src/duckdb/third_party/libpg_query/src_backend_parser_scansup.cpp +1 -1
- package/src/duckdb/third_party/libpg_query/src_common_keywords.cpp +1 -1
- package/src/duckdb/third_party/lz4/lz4.cpp +1 -1
- package/src/duckdb/third_party/mbedtls/include/des_alt.h +1 -1
- package/src/duckdb/third_party/mbedtls/include/mbedtls/aes_alt.h +1 -1
- package/src/duckdb/third_party/mbedtls/include/mbedtls/aria_alt.h +1 -1
- package/src/duckdb/third_party/mbedtls/include/mbedtls/asn1write.h +1 -1
- package/src/duckdb/third_party/mbedtls/include/mbedtls/camellia_alt.h +1 -1
- package/src/duckdb/third_party/mbedtls/include/mbedtls/ccm_alt.h +1 -1
- package/src/duckdb/third_party/mbedtls/include/mbedtls/chacha20.h +1 -1
- package/src/duckdb/third_party/mbedtls/include/mbedtls/chachapoly.h +1 -1
- package/src/duckdb/third_party/mbedtls/include/mbedtls/cmac.h +1 -1
- package/src/duckdb/third_party/mbedtls/include/mbedtls/config_psa.h +1 -1
- package/src/duckdb/third_party/mbedtls/include/mbedtls/ecdsa.h +1 -1
- package/src/duckdb/third_party/mbedtls/include/mbedtls/ecp.h +1 -1
- package/src/duckdb/third_party/mbedtls/include/mbedtls/gcm_alt.h +1 -1
- package/src/duckdb/third_party/mbedtls/include/mbedtls/md5.h +1 -1
- package/src/duckdb/third_party/mbedtls/include/mbedtls/nist_kw.h +1 -1
- package/src/duckdb/third_party/mbedtls/include/mbedtls/pkcs12.h +1 -1
- package/src/duckdb/third_party/mbedtls/include/mbedtls/pkcs5.h +1 -1
- package/src/duckdb/third_party/mbedtls/include/mbedtls/psa_util.h +1 -1
- package/src/duckdb/third_party/mbedtls/include/mbedtls/ripemd160.h +1 -1
- package/src/duckdb/third_party/mbedtls/include/mbedtls/threading.h +1 -1
- package/src/duckdb/third_party/mbedtls/include/mbedtls/timing.h +1 -1
- package/src/duckdb/third_party/mbedtls/include/platform_alt.h +1 -1
- package/src/duckdb/third_party/mbedtls/include/psa/crypto.h +1 -1
- package/src/duckdb/third_party/mbedtls/include/rsa_alt.h +1 -1
- package/src/duckdb/third_party/mbedtls/include/sha1_alt.h +1 -1
- package/src/duckdb/third_party/mbedtls/include/sha256_alt.h +1 -1
- package/src/duckdb/third_party/mbedtls/include/sha512_alt.h +1 -1
- package/src/duckdb/third_party/mbedtls/include/ssl_misc.h +1 -1
- package/src/duckdb/third_party/mbedtls/library/aesni.h +1 -1
- package/src/duckdb/third_party/mbedtls/library/padlock.h +1 -1
- package/src/duckdb/third_party/miniz/miniz.cpp +1 -1
- package/src/duckdb/third_party/parquet/parquet_types.cpp +1 -1
- package/src/duckdb/third_party/parquet/windows_compatibility.h +1 -1
- package/src/duckdb/third_party/pcg/pcg_extras.hpp +1 -1
- package/src/duckdb/third_party/pcg/pcg_uint128.hpp +1 -1
- package/src/duckdb/third_party/skiplist/Node.h +4 -4
- package/src/duckdb/third_party/snappy/snappy.cc +1 -1
- package/src/duckdb/third_party/snappy/snappy_version.hpp +1 -1
- package/src/duckdb/third_party/thrift/thrift/thrift-config.h +1 -1
- package/src/duckdb/third_party/zstd/decompress/zstd_decompress_block.cpp +1 -1
- package/src/duckdb/third_party/zstd/include/zstd_static.h +1 -1
- package/src/duckdb/ub_src_execution_index_art.cpp +2 -0
- package/src/duckdb/ub_src_parser_parsed_data.cpp +2 -0
- package/src/duckdb/ub_src_planner_operator.cpp +2 -0
@@ -0,0 +1,359 @@
|
|
1
|
+
//===--------------------------------------------------------------------===//
|
2
|
+
// row_match.cpp
|
3
|
+
// Description: This file contains the implementation of the match operators
|
4
|
+
//===--------------------------------------------------------------------===//
|
5
|
+
|
6
|
+
#include "duckdb/common/exception.hpp"
|
7
|
+
#include "duckdb/common/operator/comparison_operators.hpp"
|
8
|
+
#include "duckdb/common/operator/constant_operators.hpp"
|
9
|
+
#include "duckdb/common/row_operations/row_operations.hpp"
|
10
|
+
#include "duckdb/common/types/row/tuple_data_collection.hpp"
|
11
|
+
|
12
|
+
namespace duckdb {
|
13
|
+
|
14
|
+
using ValidityBytes = RowLayout::ValidityBytes;
|
15
|
+
using Predicates = RowOperations::Predicates;
|
16
|
+
|
17
|
+
template <typename OP>
|
18
|
+
static idx_t SelectComparison(Vector &left, Vector &right, const SelectionVector &sel, idx_t count,
|
19
|
+
SelectionVector *true_sel, SelectionVector *false_sel) {
|
20
|
+
throw NotImplementedException("Unsupported nested comparison operand for RowOperations::Match");
|
21
|
+
}
|
22
|
+
|
23
|
+
template <>
|
24
|
+
idx_t SelectComparison<Equals>(Vector &left, Vector &right, const SelectionVector &sel, idx_t count,
|
25
|
+
SelectionVector *true_sel, SelectionVector *false_sel) {
|
26
|
+
return VectorOperations::NestedEquals(left, right, sel, count, true_sel, false_sel);
|
27
|
+
}
|
28
|
+
|
29
|
+
template <>
|
30
|
+
idx_t SelectComparison<NotEquals>(Vector &left, Vector &right, const SelectionVector &sel, idx_t count,
|
31
|
+
SelectionVector *true_sel, SelectionVector *false_sel) {
|
32
|
+
return VectorOperations::NestedNotEquals(left, right, sel, count, true_sel, false_sel);
|
33
|
+
}
|
34
|
+
|
35
|
+
template <>
|
36
|
+
idx_t SelectComparison<GreaterThan>(Vector &left, Vector &right, const SelectionVector &sel, idx_t count,
|
37
|
+
SelectionVector *true_sel, SelectionVector *false_sel) {
|
38
|
+
return VectorOperations::DistinctGreaterThan(left, right, &sel, count, true_sel, false_sel);
|
39
|
+
}
|
40
|
+
|
41
|
+
template <>
|
42
|
+
idx_t SelectComparison<GreaterThanEquals>(Vector &left, Vector &right, const SelectionVector &sel, idx_t count,
|
43
|
+
SelectionVector *true_sel, SelectionVector *false_sel) {
|
44
|
+
return VectorOperations::DistinctGreaterThanEquals(left, right, &sel, count, true_sel, false_sel);
|
45
|
+
}
|
46
|
+
|
47
|
+
template <>
|
48
|
+
idx_t SelectComparison<LessThan>(Vector &left, Vector &right, const SelectionVector &sel, idx_t count,
|
49
|
+
SelectionVector *true_sel, SelectionVector *false_sel) {
|
50
|
+
return VectorOperations::DistinctLessThan(left, right, &sel, count, true_sel, false_sel);
|
51
|
+
}
|
52
|
+
|
53
|
+
template <>
|
54
|
+
idx_t SelectComparison<LessThanEquals>(Vector &left, Vector &right, const SelectionVector &sel, idx_t count,
|
55
|
+
SelectionVector *true_sel, SelectionVector *false_sel) {
|
56
|
+
return VectorOperations::DistinctLessThanEquals(left, right, &sel, count, true_sel, false_sel);
|
57
|
+
}
|
58
|
+
|
59
|
+
template <class T, class OP, bool NO_MATCH_SEL>
|
60
|
+
static void TemplatedMatchType(UnifiedVectorFormat &col, Vector &rows, SelectionVector &sel, idx_t &count,
|
61
|
+
idx_t col_offset, idx_t col_no, SelectionVector *no_match, idx_t &no_match_count) {
|
62
|
+
// Precompute row_mask indexes
|
63
|
+
idx_t entry_idx;
|
64
|
+
idx_t idx_in_entry;
|
65
|
+
ValidityBytes::GetEntryIndex(col_no, entry_idx, idx_in_entry);
|
66
|
+
|
67
|
+
auto data = UnifiedVectorFormat::GetData<T>(col);
|
68
|
+
auto ptrs = FlatVector::GetData<data_ptr_t>(rows);
|
69
|
+
idx_t match_count = 0;
|
70
|
+
if (!col.validity.AllValid()) {
|
71
|
+
for (idx_t i = 0; i < count; i++) {
|
72
|
+
auto idx = sel.get_index(i);
|
73
|
+
|
74
|
+
auto row = ptrs[idx];
|
75
|
+
ValidityBytes row_mask(row);
|
76
|
+
auto isnull = !row_mask.RowIsValid(row_mask.GetValidityEntry(entry_idx), idx_in_entry);
|
77
|
+
|
78
|
+
auto col_idx = col.sel->get_index(idx);
|
79
|
+
if (!col.validity.RowIsValid(col_idx)) {
|
80
|
+
if (isnull) {
|
81
|
+
// match: move to next value to compare
|
82
|
+
sel.set_index(match_count++, idx);
|
83
|
+
} else {
|
84
|
+
if (NO_MATCH_SEL) {
|
85
|
+
no_match->set_index(no_match_count++, idx);
|
86
|
+
}
|
87
|
+
}
|
88
|
+
} else {
|
89
|
+
auto value = Load<T>(row + col_offset);
|
90
|
+
if (!isnull && OP::template Operation<T>(data[col_idx], value)) {
|
91
|
+
sel.set_index(match_count++, idx);
|
92
|
+
} else {
|
93
|
+
if (NO_MATCH_SEL) {
|
94
|
+
no_match->set_index(no_match_count++, idx);
|
95
|
+
}
|
96
|
+
}
|
97
|
+
}
|
98
|
+
}
|
99
|
+
} else {
|
100
|
+
for (idx_t i = 0; i < count; i++) {
|
101
|
+
auto idx = sel.get_index(i);
|
102
|
+
|
103
|
+
auto row = ptrs[idx];
|
104
|
+
ValidityBytes row_mask(row);
|
105
|
+
auto isnull = !row_mask.RowIsValid(row_mask.GetValidityEntry(entry_idx), idx_in_entry);
|
106
|
+
|
107
|
+
auto col_idx = col.sel->get_index(idx);
|
108
|
+
auto value = Load<T>(row + col_offset);
|
109
|
+
if (!isnull && OP::template Operation<T>(data[col_idx], value)) {
|
110
|
+
sel.set_index(match_count++, idx);
|
111
|
+
} else {
|
112
|
+
if (NO_MATCH_SEL) {
|
113
|
+
no_match->set_index(no_match_count++, idx);
|
114
|
+
}
|
115
|
+
}
|
116
|
+
}
|
117
|
+
}
|
118
|
+
count = match_count;
|
119
|
+
}
|
120
|
+
|
121
|
+
//! Forward declaration for recursion
|
122
|
+
template <class OP, bool NO_MATCH_SEL>
|
123
|
+
static void TemplatedMatchOp(Vector &vec, UnifiedVectorFormat &col, const TupleDataLayout &layout, Vector &rows,
|
124
|
+
SelectionVector &sel, idx_t &count, idx_t col_no, SelectionVector *no_match,
|
125
|
+
idx_t &no_match_count, const idx_t original_count);
|
126
|
+
|
127
|
+
template <class OP, bool NO_MATCH_SEL>
|
128
|
+
static void TemplatedMatchStruct(Vector &vec, UnifiedVectorFormat &col, const TupleDataLayout &layout, Vector &rows,
|
129
|
+
SelectionVector &sel, idx_t &count, const idx_t col_no, SelectionVector *no_match,
|
130
|
+
idx_t &no_match_count, const idx_t original_count) {
|
131
|
+
// Precompute row_mask indexes
|
132
|
+
idx_t entry_idx;
|
133
|
+
idx_t idx_in_entry;
|
134
|
+
ValidityBytes::GetEntryIndex(col_no, entry_idx, idx_in_entry);
|
135
|
+
|
136
|
+
// Work our way through the validity of the whole struct
|
137
|
+
auto ptrs = FlatVector::GetData<data_ptr_t>(rows);
|
138
|
+
idx_t match_count = 0;
|
139
|
+
if (!col.validity.AllValid()) {
|
140
|
+
for (idx_t i = 0; i < count; i++) {
|
141
|
+
auto idx = sel.get_index(i);
|
142
|
+
|
143
|
+
auto row = ptrs[idx];
|
144
|
+
ValidityBytes row_mask(row);
|
145
|
+
auto isnull = !row_mask.RowIsValid(row_mask.GetValidityEntry(entry_idx), idx_in_entry);
|
146
|
+
|
147
|
+
auto col_idx = col.sel->get_index(idx);
|
148
|
+
if (!col.validity.RowIsValid(col_idx)) {
|
149
|
+
if (isnull) {
|
150
|
+
// match: move to next value to compare
|
151
|
+
sel.set_index(match_count++, idx);
|
152
|
+
} else {
|
153
|
+
if (NO_MATCH_SEL) {
|
154
|
+
no_match->set_index(no_match_count++, idx);
|
155
|
+
}
|
156
|
+
}
|
157
|
+
} else {
|
158
|
+
if (!isnull) {
|
159
|
+
sel.set_index(match_count++, idx);
|
160
|
+
} else {
|
161
|
+
if (NO_MATCH_SEL) {
|
162
|
+
no_match->set_index(no_match_count++, idx);
|
163
|
+
}
|
164
|
+
}
|
165
|
+
}
|
166
|
+
}
|
167
|
+
} else {
|
168
|
+
for (idx_t i = 0; i < count; i++) {
|
169
|
+
auto idx = sel.get_index(i);
|
170
|
+
|
171
|
+
auto row = ptrs[idx];
|
172
|
+
ValidityBytes row_mask(row);
|
173
|
+
auto isnull = !row_mask.RowIsValid(row_mask.GetValidityEntry(entry_idx), idx_in_entry);
|
174
|
+
|
175
|
+
if (!isnull) {
|
176
|
+
sel.set_index(match_count++, idx);
|
177
|
+
} else {
|
178
|
+
if (NO_MATCH_SEL) {
|
179
|
+
no_match->set_index(no_match_count++, idx);
|
180
|
+
}
|
181
|
+
}
|
182
|
+
}
|
183
|
+
}
|
184
|
+
count = match_count;
|
185
|
+
|
186
|
+
// Now we construct row pointers to the structs
|
187
|
+
Vector struct_rows(LogicalTypeId::POINTER);
|
188
|
+
auto struct_ptrs = FlatVector::GetData<data_ptr_t>(struct_rows);
|
189
|
+
|
190
|
+
const auto col_offset = layout.GetOffsets()[col_no];
|
191
|
+
for (idx_t i = 0; i < count; i++) {
|
192
|
+
auto idx = sel.get_index(i);
|
193
|
+
auto row = ptrs[idx];
|
194
|
+
struct_ptrs[idx] = row + col_offset;
|
195
|
+
}
|
196
|
+
|
197
|
+
// Get the struct layout, child columns, then recurse
|
198
|
+
const auto &struct_layout = layout.GetStructLayout(col_no);
|
199
|
+
auto &struct_entries = StructVector::GetEntries(vec);
|
200
|
+
D_ASSERT(struct_layout.ColumnCount() == struct_entries.size());
|
201
|
+
for (idx_t struct_col_no = 0; struct_col_no < struct_layout.ColumnCount(); struct_col_no++) {
|
202
|
+
auto &struct_vec = *struct_entries[struct_col_no];
|
203
|
+
UnifiedVectorFormat struct_col;
|
204
|
+
struct_vec.ToUnifiedFormat(original_count, struct_col);
|
205
|
+
TemplatedMatchOp<OP, NO_MATCH_SEL>(struct_vec, struct_col, struct_layout, struct_rows, sel, count,
|
206
|
+
struct_col_no, no_match, no_match_count, original_count);
|
207
|
+
}
|
208
|
+
}
|
209
|
+
|
210
|
+
template <class OP, bool NO_MATCH_SEL>
|
211
|
+
static void TemplatedMatchList(Vector &col, Vector &rows, SelectionVector &sel, idx_t &count,
|
212
|
+
const TupleDataLayout &layout, const idx_t col_no, SelectionVector *no_match,
|
213
|
+
idx_t &no_match_count) {
|
214
|
+
// Gather a dense Vector containing the column values being matched
|
215
|
+
Vector key(col.GetType());
|
216
|
+
const auto gather_function = TupleDataCollection::GetGatherFunction(col.GetType());
|
217
|
+
gather_function.function(layout, rows, col_no, sel, count, key, *FlatVector::IncrementalSelectionVector(), key,
|
218
|
+
gather_function.child_functions);
|
219
|
+
|
220
|
+
// Densify the input column
|
221
|
+
Vector sliced(col, sel, count);
|
222
|
+
|
223
|
+
if (NO_MATCH_SEL) {
|
224
|
+
SelectionVector no_match_sel_offset(no_match->data() + no_match_count);
|
225
|
+
auto match_count = SelectComparison<OP>(sliced, key, sel, count, &sel, &no_match_sel_offset);
|
226
|
+
no_match_count += count - match_count;
|
227
|
+
count = match_count;
|
228
|
+
} else {
|
229
|
+
count = SelectComparison<OP>(sliced, key, sel, count, &sel, nullptr);
|
230
|
+
}
|
231
|
+
}
|
232
|
+
|
233
|
+
template <class OP, bool NO_MATCH_SEL>
|
234
|
+
static void TemplatedMatchOp(Vector &vec, UnifiedVectorFormat &col, const TupleDataLayout &layout, Vector &rows,
|
235
|
+
SelectionVector &sel, idx_t &count, idx_t col_no, SelectionVector *no_match,
|
236
|
+
idx_t &no_match_count, const idx_t original_count) {
|
237
|
+
if (count == 0) {
|
238
|
+
return;
|
239
|
+
}
|
240
|
+
auto col_offset = layout.GetOffsets()[col_no];
|
241
|
+
switch (layout.GetTypes()[col_no].InternalType()) {
|
242
|
+
case PhysicalType::BOOL:
|
243
|
+
case PhysicalType::INT8:
|
244
|
+
TemplatedMatchType<int8_t, OP, NO_MATCH_SEL>(col, rows, sel, count, col_offset, col_no, no_match,
|
245
|
+
no_match_count);
|
246
|
+
break;
|
247
|
+
case PhysicalType::INT16:
|
248
|
+
TemplatedMatchType<int16_t, OP, NO_MATCH_SEL>(col, rows, sel, count, col_offset, col_no, no_match,
|
249
|
+
no_match_count);
|
250
|
+
break;
|
251
|
+
case PhysicalType::INT32:
|
252
|
+
TemplatedMatchType<int32_t, OP, NO_MATCH_SEL>(col, rows, sel, count, col_offset, col_no, no_match,
|
253
|
+
no_match_count);
|
254
|
+
break;
|
255
|
+
case PhysicalType::INT64:
|
256
|
+
TemplatedMatchType<int64_t, OP, NO_MATCH_SEL>(col, rows, sel, count, col_offset, col_no, no_match,
|
257
|
+
no_match_count);
|
258
|
+
break;
|
259
|
+
case PhysicalType::UINT8:
|
260
|
+
TemplatedMatchType<uint8_t, OP, NO_MATCH_SEL>(col, rows, sel, count, col_offset, col_no, no_match,
|
261
|
+
no_match_count);
|
262
|
+
break;
|
263
|
+
case PhysicalType::UINT16:
|
264
|
+
TemplatedMatchType<uint16_t, OP, NO_MATCH_SEL>(col, rows, sel, count, col_offset, col_no, no_match,
|
265
|
+
no_match_count);
|
266
|
+
break;
|
267
|
+
case PhysicalType::UINT32:
|
268
|
+
TemplatedMatchType<uint32_t, OP, NO_MATCH_SEL>(col, rows, sel, count, col_offset, col_no, no_match,
|
269
|
+
no_match_count);
|
270
|
+
break;
|
271
|
+
case PhysicalType::UINT64:
|
272
|
+
TemplatedMatchType<uint64_t, OP, NO_MATCH_SEL>(col, rows, sel, count, col_offset, col_no, no_match,
|
273
|
+
no_match_count);
|
274
|
+
break;
|
275
|
+
case PhysicalType::INT128:
|
276
|
+
TemplatedMatchType<hugeint_t, OP, NO_MATCH_SEL>(col, rows, sel, count, col_offset, col_no, no_match,
|
277
|
+
no_match_count);
|
278
|
+
break;
|
279
|
+
case PhysicalType::FLOAT:
|
280
|
+
TemplatedMatchType<float, OP, NO_MATCH_SEL>(col, rows, sel, count, col_offset, col_no, no_match,
|
281
|
+
no_match_count);
|
282
|
+
break;
|
283
|
+
case PhysicalType::DOUBLE:
|
284
|
+
TemplatedMatchType<double, OP, NO_MATCH_SEL>(col, rows, sel, count, col_offset, col_no, no_match,
|
285
|
+
no_match_count);
|
286
|
+
break;
|
287
|
+
case PhysicalType::INTERVAL:
|
288
|
+
TemplatedMatchType<interval_t, OP, NO_MATCH_SEL>(col, rows, sel, count, col_offset, col_no, no_match,
|
289
|
+
no_match_count);
|
290
|
+
break;
|
291
|
+
case PhysicalType::VARCHAR:
|
292
|
+
TemplatedMatchType<string_t, OP, NO_MATCH_SEL>(col, rows, sel, count, col_offset, col_no, no_match,
|
293
|
+
no_match_count);
|
294
|
+
break;
|
295
|
+
case PhysicalType::STRUCT:
|
296
|
+
TemplatedMatchStruct<OP, NO_MATCH_SEL>(vec, col, layout, rows, sel, count, col_no, no_match, no_match_count,
|
297
|
+
original_count);
|
298
|
+
break;
|
299
|
+
case PhysicalType::LIST:
|
300
|
+
TemplatedMatchList<OP, NO_MATCH_SEL>(vec, rows, sel, count, layout, col_no, no_match, no_match_count);
|
301
|
+
break;
|
302
|
+
default:
|
303
|
+
throw InternalException("Unsupported column type for RowOperations::Match");
|
304
|
+
}
|
305
|
+
}
|
306
|
+
|
307
|
+
template <bool NO_MATCH_SEL>
|
308
|
+
static void TemplatedMatch(DataChunk &columns, UnifiedVectorFormat col_data[], const TupleDataLayout &layout,
|
309
|
+
Vector &rows, const Predicates &predicates, SelectionVector &sel, idx_t &count,
|
310
|
+
SelectionVector *no_match, idx_t &no_match_count) {
|
311
|
+
for (idx_t col_no = 0; col_no < predicates.size(); ++col_no) {
|
312
|
+
auto &vec = columns.data[col_no];
|
313
|
+
auto &col = col_data[col_no];
|
314
|
+
switch (predicates[col_no]) {
|
315
|
+
case ExpressionType::COMPARE_EQUAL:
|
316
|
+
case ExpressionType::COMPARE_NOT_DISTINCT_FROM:
|
317
|
+
case ExpressionType::COMPARE_DISTINCT_FROM:
|
318
|
+
TemplatedMatchOp<Equals, NO_MATCH_SEL>(vec, col, layout, rows, sel, count, col_no, no_match, no_match_count,
|
319
|
+
count);
|
320
|
+
break;
|
321
|
+
case ExpressionType::COMPARE_NOTEQUAL:
|
322
|
+
TemplatedMatchOp<NotEquals, NO_MATCH_SEL>(vec, col, layout, rows, sel, count, col_no, no_match,
|
323
|
+
no_match_count, count);
|
324
|
+
break;
|
325
|
+
case ExpressionType::COMPARE_GREATERTHAN:
|
326
|
+
TemplatedMatchOp<GreaterThan, NO_MATCH_SEL>(vec, col, layout, rows, sel, count, col_no, no_match,
|
327
|
+
no_match_count, count);
|
328
|
+
break;
|
329
|
+
case ExpressionType::COMPARE_GREATERTHANOREQUALTO:
|
330
|
+
TemplatedMatchOp<GreaterThanEquals, NO_MATCH_SEL>(vec, col, layout, rows, sel, count, col_no, no_match,
|
331
|
+
no_match_count, count);
|
332
|
+
break;
|
333
|
+
case ExpressionType::COMPARE_LESSTHAN:
|
334
|
+
TemplatedMatchOp<LessThan, NO_MATCH_SEL>(vec, col, layout, rows, sel, count, col_no, no_match,
|
335
|
+
no_match_count, count);
|
336
|
+
break;
|
337
|
+
case ExpressionType::COMPARE_LESSTHANOREQUALTO:
|
338
|
+
TemplatedMatchOp<LessThanEquals, NO_MATCH_SEL>(vec, col, layout, rows, sel, count, col_no, no_match,
|
339
|
+
no_match_count, count);
|
340
|
+
break;
|
341
|
+
default:
|
342
|
+
throw InternalException("Unsupported comparison type for RowOperations::Match");
|
343
|
+
}
|
344
|
+
}
|
345
|
+
}
|
346
|
+
|
347
|
+
idx_t RowOperations::Match(DataChunk &columns, UnifiedVectorFormat col_data[], const TupleDataLayout &layout,
|
348
|
+
Vector &rows, const Predicates &predicates, SelectionVector &sel, idx_t count,
|
349
|
+
SelectionVector *no_match, idx_t &no_match_count) {
|
350
|
+
if (no_match) {
|
351
|
+
TemplatedMatch<true>(columns, col_data, layout, rows, predicates, sel, count, no_match, no_match_count);
|
352
|
+
} else {
|
353
|
+
TemplatedMatch<false>(columns, col_data, layout, rows, predicates, sel, count, no_match, no_match_count);
|
354
|
+
}
|
355
|
+
|
356
|
+
return count;
|
357
|
+
}
|
358
|
+
|
359
|
+
} // namespace duckdb
|
@@ -0,0 +1,27 @@
|
|
1
|
+
#include "duckdb/common/serializer/buffered_deserializer.hpp"
|
2
|
+
|
3
|
+
#include <cstring>
|
4
|
+
|
5
|
+
namespace duckdb {
|
6
|
+
|
7
|
+
BufferedDeserializer::BufferedDeserializer(data_ptr_t ptr, idx_t data_size) : ptr(ptr), endptr(ptr + data_size) {
|
8
|
+
}
|
9
|
+
|
10
|
+
BufferedDeserializer::BufferedDeserializer(BufferedSerializer &serializer)
|
11
|
+
: BufferedDeserializer(serializer.data, serializer.maximum_size) {
|
12
|
+
SetVersion(serializer.GetVersion());
|
13
|
+
}
|
14
|
+
|
15
|
+
void BufferedDeserializer::ReadData(data_ptr_t buffer, idx_t read_size) {
|
16
|
+
if (ptr + read_size > endptr) {
|
17
|
+
throw SerializationException("Failed to deserialize: not enough data in buffer to fulfill read request");
|
18
|
+
}
|
19
|
+
memcpy(buffer, ptr, read_size);
|
20
|
+
ptr += read_size;
|
21
|
+
}
|
22
|
+
|
23
|
+
ClientContext &BufferedContextDeserializer::GetContext() {
|
24
|
+
return context;
|
25
|
+
}
|
26
|
+
|
27
|
+
} // namespace duckdb
|
@@ -0,0 +1,36 @@
|
|
1
|
+
#include "duckdb/common/serializer/buffered_serializer.hpp"
|
2
|
+
|
3
|
+
#include <cstring>
|
4
|
+
|
5
|
+
namespace duckdb {
|
6
|
+
|
7
|
+
BufferedSerializer::BufferedSerializer(idx_t maximum_size)
|
8
|
+
: BufferedSerializer(make_unsafe_uniq_array<data_t>(maximum_size), maximum_size) {
|
9
|
+
}
|
10
|
+
|
11
|
+
BufferedSerializer::BufferedSerializer(unsafe_unique_array<data_t> data, idx_t size)
|
12
|
+
: maximum_size(size), data(data.get()) {
|
13
|
+
blob.size = 0;
|
14
|
+
blob.data = std::move(data);
|
15
|
+
}
|
16
|
+
|
17
|
+
BufferedSerializer::BufferedSerializer(data_ptr_t data, idx_t size) : maximum_size(size), data(data) {
|
18
|
+
blob.size = 0;
|
19
|
+
}
|
20
|
+
|
21
|
+
void BufferedSerializer::WriteData(const_data_ptr_t buffer, idx_t write_size) {
|
22
|
+
if (blob.size + write_size >= maximum_size) {
|
23
|
+
do {
|
24
|
+
maximum_size *= 2;
|
25
|
+
} while (blob.size + write_size > maximum_size);
|
26
|
+
auto new_data = new data_t[maximum_size];
|
27
|
+
memcpy(new_data, data, blob.size);
|
28
|
+
data = new_data;
|
29
|
+
blob.data = unsafe_unique_array<data_t>(new_data);
|
30
|
+
}
|
31
|
+
|
32
|
+
memcpy(data + blob.size, buffer, write_size);
|
33
|
+
blob.size += write_size;
|
34
|
+
}
|
35
|
+
|
36
|
+
} // namespace duckdb
|
@@ -0,0 +1,15 @@
|
|
1
|
+
#include "duckdb/common/serializer/format_serializer.hpp"
|
2
|
+
|
3
|
+
namespace duckdb {
|
4
|
+
|
5
|
+
template <>
|
6
|
+
void FormatSerializer::WriteValue(const vector<bool> &vec) {
|
7
|
+
auto count = vec.size();
|
8
|
+
OnListBegin(count);
|
9
|
+
for (auto item : vec) {
|
10
|
+
WriteValue(item);
|
11
|
+
}
|
12
|
+
OnListEnd(count);
|
13
|
+
}
|
14
|
+
|
15
|
+
} // namespace duckdb
|
@@ -0,0 +1,24 @@
|
|
1
|
+
#include "duckdb/common/serializer.hpp"
|
2
|
+
|
3
|
+
namespace duckdb {
|
4
|
+
|
5
|
+
template <>
|
6
|
+
string Deserializer::Read() {
|
7
|
+
uint32_t size = Read<uint32_t>();
|
8
|
+
if (size == 0) {
|
9
|
+
return string();
|
10
|
+
}
|
11
|
+
auto buffer = make_unsafe_uniq_array<data_t>(size);
|
12
|
+
ReadData(buffer.get(), size);
|
13
|
+
return string(const_char_ptr_cast(buffer.get()), size);
|
14
|
+
}
|
15
|
+
|
16
|
+
void Deserializer::ReadStringVector(vector<string> &list) {
|
17
|
+
uint32_t sz = Read<uint32_t>();
|
18
|
+
list.resize(sz);
|
19
|
+
for (idx_t i = 0; i < sz; i++) {
|
20
|
+
list[i] = Read<string>();
|
21
|
+
}
|
22
|
+
}
|
23
|
+
|
24
|
+
} // namespace duckdb
|
@@ -24,7 +24,7 @@ bool Comparators::TieIsBreakable(const idx_t &tie_col, const data_ptr_t &row_ptr
|
|
24
24
|
}
|
25
25
|
const auto &tie_col_offset = row_layout.GetOffsets()[col_idx];
|
26
26
|
auto tie_string = Load<string_t>(row_ptr + tie_col_offset);
|
27
|
-
if (tie_string.GetSize() < sort_layout.prefix_lengths[tie_col]) {
|
27
|
+
if (tie_string.GetSize() < sort_layout.prefix_lengths[tie_col] && tie_string.GetSize() > 0) {
|
28
28
|
// No need to break the tie - we already compared the full string
|
29
29
|
return false;
|
30
30
|
}
|
@@ -71,7 +71,7 @@ int Comparators::BreakBlobTie(const idx_t &tie_col, const SBScanState &left, con
|
|
71
71
|
const SortLayout &sort_layout, const bool &external) {
|
72
72
|
data_ptr_t l_data_ptr = left.DataPtr(*left.sb->blob_sorting_data);
|
73
73
|
data_ptr_t r_data_ptr = right.DataPtr(*right.sb->blob_sorting_data);
|
74
|
-
if (!TieIsBreakable(tie_col, l_data_ptr, sort_layout)) {
|
74
|
+
if (!TieIsBreakable(tie_col, l_data_ptr, sort_layout) && !TieIsBreakable(tie_col, r_data_ptr, sort_layout)) {
|
75
75
|
// Quick check to see if ties can be broken
|
76
76
|
return 0;
|
77
77
|
}
|