duckdb 0.8.2-dev4142.0 → 0.8.2-dev4314.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/binding.gyp +0 -2
- package/lib/duckdb.js +3 -3
- package/package.json +1 -1
- package/src/connection.cpp +9 -8
- package/src/database.cpp +5 -8
- package/src/duckdb/extension/icu/icu-datepart.cpp +2 -2
- package/src/duckdb/extension/icu/icu-strptime.cpp +0 -9
- package/src/duckdb/extension/icu/icu_extension.cpp +3 -3
- package/src/duckdb/extension/icu/third_party/icu/i18n/unicode/gregocal.h +1 -1
- package/src/duckdb/extension/json/buffered_json_reader.cpp +3 -17
- package/src/duckdb/extension/json/include/buffered_json_reader.hpp +2 -5
- package/src/duckdb/extension/json/include/json_deserializer.hpp +2 -2
- package/src/duckdb/extension/json/include/json_scan.hpp +5 -12
- package/src/duckdb/extension/json/include/json_serializer.hpp +3 -3
- package/src/duckdb/extension/json/include/json_transform.hpp +2 -5
- package/src/duckdb/extension/json/json_functions/json_serialize_sql.cpp +1 -1
- package/src/duckdb/extension/json/json_functions/json_transform.cpp +2 -18
- package/src/duckdb/extension/json/json_scan.cpp +7 -76
- package/src/duckdb/extension/json/serialize_json.cpp +8 -8
- package/src/duckdb/extension/parquet/column_writer.cpp +46 -45
- package/src/duckdb/extension/parquet/include/column_writer.hpp +2 -2
- package/src/duckdb/extension/parquet/include/parquet_reader.hpp +2 -5
- package/src/duckdb/extension/parquet/include/parquet_rle_bp_encoder.hpp +4 -4
- package/src/duckdb/extension/parquet/parquet_extension.cpp +74 -55
- package/src/duckdb/extension/parquet/parquet_writer.cpp +3 -2
- package/src/duckdb/extension/parquet/serialize_parquet.cpp +4 -4
- package/src/duckdb/src/catalog/catalog_entry/index_catalog_entry.cpp +0 -1
- package/src/duckdb/src/catalog/catalog_entry/macro_catalog_entry.cpp +0 -1
- package/src/duckdb/src/catalog/catalog_entry/schema_catalog_entry.cpp +0 -1
- package/src/duckdb/src/catalog/catalog_entry/sequence_catalog_entry.cpp +0 -1
- package/src/duckdb/src/catalog/catalog_entry/table_catalog_entry.cpp +0 -2
- package/src/duckdb/src/catalog/catalog_entry/type_catalog_entry.cpp +1 -3
- package/src/duckdb/src/catalog/catalog_entry/view_catalog_entry.cpp +0 -1
- package/src/duckdb/src/catalog/catalog_entry.cpp +2 -11
- package/src/duckdb/src/catalog/catalog_set.cpp +16 -14
- package/src/duckdb/src/catalog/default/default_functions.cpp +2 -2
- package/src/duckdb/src/common/arrow/arrow_converter.cpp +0 -1
- package/src/duckdb/src/common/constants.cpp +0 -1
- package/src/duckdb/src/common/enum_util.cpp +0 -10
- package/src/duckdb/src/common/exception.cpp +1 -1
- package/src/duckdb/src/common/extra_type_info.cpp +20 -192
- package/src/duckdb/src/common/multi_file_reader.cpp +0 -68
- package/src/duckdb/src/common/serializer/binary_serializer.cpp +9 -4
- package/src/duckdb/src/common/serializer/buffered_file_reader.cpp +3 -11
- package/src/duckdb/src/common/serializer/buffered_file_writer.cpp +1 -1
- package/src/duckdb/src/common/serializer/memory_stream.cpp +61 -0
- package/src/duckdb/src/common/serializer/{format_serializer.cpp → serializer.cpp} +2 -2
- package/src/duckdb/src/common/sort/partition_state.cpp +107 -29
- package/src/duckdb/src/common/types/column/column_data_collection.cpp +4 -4
- package/src/duckdb/src/common/types/data_chunk.cpp +11 -43
- package/src/duckdb/src/common/types/hyperloglog.cpp +4 -23
- package/src/duckdb/src/common/types/interval.cpp +2 -2
- package/src/duckdb/src/common/types/value.cpp +10 -135
- package/src/duckdb/src/common/types/vector.cpp +17 -149
- package/src/duckdb/src/common/types.cpp +2 -20
- package/src/duckdb/src/core_functions/aggregate/algebraic/avg.cpp +0 -1
- package/src/duckdb/src/core_functions/aggregate/distributive/string_agg.cpp +6 -7
- package/src/duckdb/src/core_functions/aggregate/holistic/approximate_quantile.cpp +5 -28
- package/src/duckdb/src/core_functions/aggregate/holistic/quantile.cpp +30 -78
- package/src/duckdb/src/core_functions/aggregate/holistic/reservoir_quantile.cpp +5 -30
- package/src/duckdb/src/core_functions/scalar/date/date_part.cpp +6 -9
- package/src/duckdb/src/core_functions/scalar/list/list_aggregates.cpp +21 -16
- package/src/duckdb/src/core_functions/scalar/list/list_lambdas.cpp +15 -23
- package/src/duckdb/src/execution/index/art/art.cpp +5 -1
- package/src/duckdb/src/execution/index/art/leaf.cpp +13 -10
- package/src/duckdb/src/execution/index/art/node48.cpp +0 -2
- package/src/duckdb/src/execution/index/fixed_size_allocator.cpp +38 -73
- package/src/duckdb/src/execution/index/fixed_size_buffer.cpp +245 -27
- package/src/duckdb/src/execution/operator/aggregate/physical_window.cpp +2 -3
- package/src/duckdb/src/execution/operator/join/physical_asof_join.cpp +35 -20
- package/src/duckdb/src/function/macro_function.cpp +0 -42
- package/src/duckdb/src/function/scalar/compressed_materialization/compress_integral.cpp +10 -8
- package/src/duckdb/src/function/scalar/compressed_materialization/compress_string.cpp +13 -12
- package/src/duckdb/src/function/scalar/operators/arithmetic.cpp +9 -11
- package/src/duckdb/src/function/scalar/system/aggregate_export.cpp +7 -33
- package/src/duckdb/src/function/scalar_function.cpp +1 -2
- package/src/duckdb/src/function/scalar_macro_function.cpp +0 -10
- package/src/duckdb/src/function/table/copy_csv.cpp +38 -38
- package/src/duckdb/src/function/table/read_csv.cpp +5 -174
- package/src/duckdb/src/function/table/table_scan.cpp +5 -42
- package/src/duckdb/src/function/table/version/pragma_version.cpp +2 -2
- package/src/duckdb/src/function/table_function.cpp +3 -4
- package/src/duckdb/src/function/table_macro_function.cpp +0 -10
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/schema_catalog_entry.hpp +0 -2
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/sequence_catalog_entry.hpp +0 -2
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/type_catalog_entry.hpp +0 -2
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry.hpp +3 -8
- package/src/duckdb/src/include/duckdb/common/constants.hpp +4 -2
- package/src/duckdb/src/include/duckdb/common/extra_type_info.hpp +16 -46
- package/src/duckdb/src/include/duckdb/common/index_vector.hpp +4 -4
- package/src/duckdb/src/include/duckdb/common/multi_file_reader.hpp +2 -6
- package/src/duckdb/src/include/duckdb/common/multi_file_reader_options.hpp +0 -4
- package/src/duckdb/src/include/duckdb/common/serializer/binary_deserializer.hpp +44 -23
- package/src/duckdb/src/include/duckdb/common/serializer/binary_serializer.hpp +31 -23
- package/src/duckdb/src/include/duckdb/common/serializer/buffered_file_reader.hpp +4 -6
- package/src/duckdb/src/include/duckdb/common/serializer/buffered_file_writer.hpp +3 -3
- package/src/duckdb/src/include/duckdb/common/serializer/deserialization_data.hpp +17 -0
- package/src/duckdb/src/include/duckdb/common/serializer/{format_deserializer.hpp → deserializer.hpp} +13 -13
- package/src/duckdb/src/include/duckdb/common/serializer/memory_stream.hpp +62 -0
- package/src/duckdb/src/include/duckdb/common/serializer/read_stream.hpp +38 -0
- package/src/duckdb/src/include/duckdb/common/serializer/serialization_traits.hpp +15 -13
- package/src/duckdb/src/include/duckdb/common/serializer/{format_serializer.hpp → serializer.hpp} +13 -12
- package/src/duckdb/src/include/duckdb/common/serializer/write_stream.hpp +36 -0
- package/src/duckdb/src/include/duckdb/common/sort/partition_state.hpp +14 -4
- package/src/duckdb/src/include/duckdb/common/types/column/column_data_collection.hpp +2 -2
- package/src/duckdb/src/include/duckdb/common/types/data_chunk.hpp +3 -8
- package/src/duckdb/src/include/duckdb/common/types/hyperloglog.hpp +4 -10
- package/src/duckdb/src/include/duckdb/common/types/interval.hpp +4 -4
- package/src/duckdb/src/include/duckdb/common/types/value.hpp +1 -5
- package/src/duckdb/src/include/duckdb/common/types/vector.hpp +2 -7
- package/src/duckdb/src/include/duckdb/common/types.hpp +1 -10
- package/src/duckdb/src/include/duckdb/execution/index/art/leaf.hpp +2 -0
- package/src/duckdb/src/include/duckdb/execution/index/fixed_size_allocator.hpp +1 -7
- package/src/duckdb/src/include/duckdb/execution/index/fixed_size_buffer.hpp +38 -8
- package/src/duckdb/src/include/duckdb/execution/operator/scan/csv/csv_reader_options.hpp +2 -11
- package/src/duckdb/src/include/duckdb/function/aggregate_function.hpp +4 -14
- package/src/duckdb/src/include/duckdb/function/copy_function.hpp +3 -3
- package/src/duckdb/src/include/duckdb/function/function_serialization.hpp +15 -98
- package/src/duckdb/src/include/duckdb/function/macro_function.hpp +1 -7
- package/src/duckdb/src/include/duckdb/function/scalar/nested_functions.hpp +9 -10
- package/src/duckdb/src/include/duckdb/function/scalar/strftime_format.hpp +2 -2
- package/src/duckdb/src/include/duckdb/function/scalar_function.hpp +2 -12
- package/src/duckdb/src/include/duckdb/function/scalar_macro_function.hpp +2 -7
- package/src/duckdb/src/include/duckdb/function/table/read_csv.hpp +4 -16
- package/src/duckdb/src/include/duckdb/function/table_function.hpp +2 -11
- package/src/duckdb/src/include/duckdb/function/table_macro_function.hpp +2 -7
- package/src/duckdb/src/include/duckdb/main/relation.hpp +9 -2
- package/src/duckdb/src/include/duckdb/parser/column_definition.hpp +1 -4
- package/src/duckdb/src/include/duckdb/parser/column_list.hpp +2 -6
- package/src/duckdb/src/include/duckdb/parser/common_table_expression_info.hpp +2 -2
- package/src/duckdb/src/include/duckdb/parser/constraint.hpp +2 -12
- package/src/duckdb/src/include/duckdb/parser/constraints/check_constraint.hpp +2 -5
- package/src/duckdb/src/include/duckdb/parser/constraints/foreign_key_constraint.hpp +2 -7
- package/src/duckdb/src/include/duckdb/parser/constraints/not_null_constraint.hpp +2 -7
- package/src/duckdb/src/include/duckdb/parser/constraints/unique_constraint.hpp +2 -7
- package/src/duckdb/src/include/duckdb/parser/expression/between_expression.hpp +2 -5
- package/src/duckdb/src/include/duckdb/parser/expression/bound_expression.hpp +1 -4
- package/src/duckdb/src/include/duckdb/parser/expression/case_expression.hpp +4 -6
- package/src/duckdb/src/include/duckdb/parser/expression/cast_expression.hpp +2 -4
- package/src/duckdb/src/include/duckdb/parser/expression/collate_expression.hpp +2 -4
- package/src/duckdb/src/include/duckdb/parser/expression/columnref_expression.hpp +2 -4
- package/src/duckdb/src/include/duckdb/parser/expression/comparison_expression.hpp +2 -4
- package/src/duckdb/src/include/duckdb/parser/expression/conjunction_expression.hpp +2 -4
- package/src/duckdb/src/include/duckdb/parser/expression/constant_expression.hpp +2 -5
- package/src/duckdb/src/include/duckdb/parser/expression/default_expression.hpp +2 -4
- package/src/duckdb/src/include/duckdb/parser/expression/function_expression.hpp +2 -4
- package/src/duckdb/src/include/duckdb/parser/expression/lambda_expression.hpp +2 -4
- package/src/duckdb/src/include/duckdb/parser/expression/operator_expression.hpp +2 -4
- package/src/duckdb/src/include/duckdb/parser/expression/parameter_expression.hpp +2 -4
- package/src/duckdb/src/include/duckdb/parser/expression/positional_reference_expression.hpp +2 -4
- package/src/duckdb/src/include/duckdb/parser/expression/star_expression.hpp +2 -4
- package/src/duckdb/src/include/duckdb/parser/expression/subquery_expression.hpp +2 -4
- package/src/duckdb/src/include/duckdb/parser/expression/window_expression.hpp +2 -4
- package/src/duckdb/src/include/duckdb/parser/parsed_data/alter_info.hpp +2 -5
- package/src/duckdb/src/include/duckdb/parser/parsed_data/alter_scalar_function_info.hpp +0 -2
- package/src/duckdb/src/include/duckdb/parser/parsed_data/alter_table_function_info.hpp +0 -2
- package/src/duckdb/src/include/duckdb/parser/parsed_data/alter_table_info.hpp +24 -51
- package/src/duckdb/src/include/duckdb/parser/parsed_data/attach_info.hpp +1 -4
- package/src/duckdb/src/include/duckdb/parser/parsed_data/copy_info.hpp +2 -2
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_collation_info.hpp +0 -3
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_copy_function_info.hpp +0 -3
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_function_info.hpp +0 -5
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_index_info.hpp +2 -7
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_info.hpp +1 -13
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_macro_info.hpp +2 -8
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_schema_info.hpp +2 -12
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_sequence_info.hpp +2 -7
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_table_info.hpp +2 -7
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_type_info.hpp +2 -7
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_view_info.hpp +2 -7
- package/src/duckdb/src/include/duckdb/parser/parsed_data/detach_info.hpp +2 -4
- package/src/duckdb/src/include/duckdb/parser/parsed_data/drop_info.hpp +2 -5
- package/src/duckdb/src/include/duckdb/parser/parsed_data/load_info.hpp +2 -21
- package/src/duckdb/src/include/duckdb/parser/parsed_data/parse_info.hpp +2 -2
- package/src/duckdb/src/include/duckdb/parser/parsed_data/pragma_info.hpp +2 -2
- package/src/duckdb/src/include/duckdb/parser/parsed_data/sample_options.hpp +2 -4
- package/src/duckdb/src/include/duckdb/parser/parsed_data/transaction_info.hpp +1 -4
- package/src/duckdb/src/include/duckdb/parser/parsed_data/vacuum_info.hpp +5 -7
- package/src/duckdb/src/include/duckdb/parser/parsed_expression.hpp +3 -16
- package/src/duckdb/src/include/duckdb/parser/query_node/cte_node.hpp +2 -4
- package/src/duckdb/src/include/duckdb/parser/query_node/recursive_cte_node.hpp +2 -4
- package/src/duckdb/src/include/duckdb/parser/query_node/select_node.hpp +2 -4
- package/src/duckdb/src/include/duckdb/parser/query_node/set_operation_node.hpp +2 -4
- package/src/duckdb/src/include/duckdb/parser/query_node.hpp +7 -14
- package/src/duckdb/src/include/duckdb/parser/result_modifier.hpp +14 -32
- package/src/duckdb/src/include/duckdb/parser/statement/select_statement.hpp +4 -9
- package/src/duckdb/src/include/duckdb/parser/tableref/basetableref.hpp +2 -6
- package/src/duckdb/src/include/duckdb/parser/tableref/emptytableref.hpp +2 -6
- package/src/duckdb/src/include/duckdb/parser/tableref/expressionlistref.hpp +2 -6
- package/src/duckdb/src/include/duckdb/parser/tableref/joinref.hpp +2 -6
- package/src/duckdb/src/include/duckdb/parser/tableref/pivotref.hpp +6 -14
- package/src/duckdb/src/include/duckdb/parser/tableref/subqueryref.hpp +2 -6
- package/src/duckdb/src/include/duckdb/parser/tableref/table_function_ref.hpp +2 -6
- package/src/duckdb/src/include/duckdb/parser/tableref.hpp +2 -10
- package/src/duckdb/src/include/duckdb/parser/transformer.hpp +1 -0
- package/src/duckdb/src/include/duckdb/planner/bound_constraint.hpp +0 -1
- package/src/duckdb/src/include/duckdb/planner/bound_result_modifier.hpp +2 -8
- package/src/duckdb/src/include/duckdb/planner/column_binding.hpp +4 -4
- package/src/duckdb/src/include/duckdb/planner/expression/bound_aggregate_expression.hpp +2 -4
- package/src/duckdb/src/include/duckdb/planner/expression/bound_between_expression.hpp +2 -4
- package/src/duckdb/src/include/duckdb/planner/expression/bound_case_expression.hpp +3 -9
- package/src/duckdb/src/include/duckdb/planner/expression/bound_cast_expression.hpp +2 -5
- package/src/duckdb/src/include/duckdb/planner/expression/bound_columnref_expression.hpp +2 -8
- package/src/duckdb/src/include/duckdb/planner/expression/bound_comparison_expression.hpp +2 -4
- package/src/duckdb/src/include/duckdb/planner/expression/bound_conjunction_expression.hpp +2 -5
- package/src/duckdb/src/include/duckdb/planner/expression/bound_constant_expression.hpp +2 -5
- package/src/duckdb/src/include/duckdb/planner/expression/bound_default_expression.hpp +2 -5
- package/src/duckdb/src/include/duckdb/planner/expression/bound_function_expression.hpp +2 -5
- package/src/duckdb/src/include/duckdb/planner/expression/bound_lambda_expression.hpp +2 -4
- package/src/duckdb/src/include/duckdb/planner/expression/bound_lambdaref_expression.hpp +2 -8
- package/src/duckdb/src/include/duckdb/planner/expression/bound_operator_expression.hpp +2 -5
- package/src/duckdb/src/include/duckdb/planner/expression/bound_parameter_data.hpp +2 -19
- package/src/duckdb/src/include/duckdb/planner/expression/bound_parameter_expression.hpp +2 -5
- package/src/duckdb/src/include/duckdb/planner/expression/bound_reference_expression.hpp +2 -5
- package/src/duckdb/src/include/duckdb/planner/expression/bound_subquery_expression.hpp +0 -3
- package/src/duckdb/src/include/duckdb/planner/expression/bound_unnest_expression.hpp +2 -5
- package/src/duckdb/src/include/duckdb/planner/expression/bound_window_expression.hpp +2 -5
- package/src/duckdb/src/include/duckdb/planner/expression.hpp +2 -14
- package/src/duckdb/src/include/duckdb/planner/filter/conjunction_filter.hpp +4 -8
- package/src/duckdb/src/include/duckdb/planner/filter/constant_filter.hpp +2 -4
- package/src/duckdb/src/include/duckdb/planner/filter/null_filter.hpp +4 -8
- package/src/duckdb/src/include/duckdb/planner/joinside.hpp +1 -6
- package/src/duckdb/src/include/duckdb/planner/logical_operator.hpp +2 -17
- package/src/duckdb/src/include/duckdb/planner/operator/logical_aggregate.hpp +2 -4
- package/src/duckdb/src/include/duckdb/planner/operator/logical_any_join.hpp +2 -4
- package/src/duckdb/src/include/duckdb/planner/operator/logical_column_data_get.hpp +2 -5
- package/src/duckdb/src/include/duckdb/planner/operator/logical_comparison_join.hpp +2 -6
- package/src/duckdb/src/include/duckdb/planner/operator/logical_copy_to_file.hpp +2 -4
- package/src/duckdb/src/include/duckdb/planner/operator/logical_create.hpp +2 -5
- package/src/duckdb/src/include/duckdb/planner/operator/logical_create_index.hpp +2 -5
- package/src/duckdb/src/include/duckdb/planner/operator/logical_create_table.hpp +2 -5
- package/src/duckdb/src/include/duckdb/planner/operator/logical_cross_product.hpp +2 -5
- package/src/duckdb/src/include/duckdb/planner/operator/logical_cteref.hpp +2 -4
- package/src/duckdb/src/include/duckdb/planner/operator/logical_delete.hpp +2 -5
- package/src/duckdb/src/include/duckdb/planner/operator/logical_delim_get.hpp +2 -4
- package/src/duckdb/src/include/duckdb/planner/operator/logical_dependent_join.hpp +0 -1
- package/src/duckdb/src/include/duckdb/planner/operator/logical_distinct.hpp +2 -4
- package/src/duckdb/src/include/duckdb/planner/operator/logical_dummy_scan.hpp +2 -4
- package/src/duckdb/src/include/duckdb/planner/operator/logical_empty_result.hpp +2 -4
- package/src/duckdb/src/include/duckdb/planner/operator/logical_execute.hpp +0 -2
- package/src/duckdb/src/include/duckdb/planner/operator/logical_explain.hpp +2 -5
- package/src/duckdb/src/include/duckdb/planner/operator/logical_export.hpp +0 -3
- package/src/duckdb/src/include/duckdb/planner/operator/logical_expression_get.hpp +2 -4
- package/src/duckdb/src/include/duckdb/planner/operator/logical_extension_operator.hpp +2 -4
- package/src/duckdb/src/include/duckdb/planner/operator/logical_filter.hpp +2 -4
- package/src/duckdb/src/include/duckdb/planner/operator/logical_get.hpp +2 -4
- package/src/duckdb/src/include/duckdb/planner/operator/logical_insert.hpp +2 -5
- package/src/duckdb/src/include/duckdb/planner/operator/logical_join.hpp +0 -2
- package/src/duckdb/src/include/duckdb/planner/operator/logical_limit.hpp +2 -5
- package/src/duckdb/src/include/duckdb/planner/operator/logical_limit_percent.hpp +2 -5
- package/src/duckdb/src/include/duckdb/planner/operator/logical_materialized_cte.hpp +2 -4
- package/src/duckdb/src/include/duckdb/planner/operator/logical_order.hpp +2 -5
- package/src/duckdb/src/include/duckdb/planner/operator/logical_pivot.hpp +2 -4
- package/src/duckdb/src/include/duckdb/planner/operator/logical_positional_join.hpp +2 -5
- package/src/duckdb/src/include/duckdb/planner/operator/logical_pragma.hpp +0 -2
- package/src/duckdb/src/include/duckdb/planner/operator/logical_prepare.hpp +0 -2
- package/src/duckdb/src/include/duckdb/planner/operator/logical_projection.hpp +2 -4
- package/src/duckdb/src/include/duckdb/planner/operator/logical_recursive_cte.hpp +2 -4
- package/src/duckdb/src/include/duckdb/planner/operator/logical_reset.hpp +2 -5
- package/src/duckdb/src/include/duckdb/planner/operator/logical_sample.hpp +2 -5
- package/src/duckdb/src/include/duckdb/planner/operator/logical_set.hpp +2 -5
- package/src/duckdb/src/include/duckdb/planner/operator/logical_set_operation.hpp +2 -5
- package/src/duckdb/src/include/duckdb/planner/operator/logical_show.hpp +2 -5
- package/src/duckdb/src/include/duckdb/planner/operator/logical_simple.hpp +2 -5
- package/src/duckdb/src/include/duckdb/planner/operator/logical_top_n.hpp +2 -4
- package/src/duckdb/src/include/duckdb/planner/operator/logical_unnest.hpp +2 -4
- package/src/duckdb/src/include/duckdb/planner/operator/logical_update.hpp +2 -4
- package/src/duckdb/src/include/duckdb/planner/operator/logical_window.hpp +2 -4
- package/src/duckdb/src/include/duckdb/planner/operator_extension.hpp +1 -3
- package/src/duckdb/src/include/duckdb/planner/parsed_data/bound_create_table_info.hpp +0 -5
- package/src/duckdb/src/include/duckdb/planner/table_filter.hpp +3 -12
- package/src/duckdb/src/include/duckdb/planner/tableref/bound_pivotref.hpp +2 -2
- package/src/duckdb/src/include/duckdb/storage/block.hpp +7 -4
- package/src/duckdb/src/include/duckdb/storage/checkpoint/row_group_writer.hpp +3 -2
- package/src/duckdb/src/include/duckdb/storage/checkpoint/table_data_writer.hpp +6 -6
- package/src/duckdb/src/include/duckdb/storage/checkpoint_manager.hpp +18 -18
- package/src/duckdb/src/include/duckdb/storage/data_pointer.hpp +6 -0
- package/src/duckdb/src/include/duckdb/storage/data_table.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/metadata/metadata_manager.hpp +4 -5
- package/src/duckdb/src/include/duckdb/storage/metadata/metadata_reader.hpp +2 -1
- package/src/duckdb/src/include/duckdb/storage/metadata/metadata_writer.hpp +2 -2
- package/src/duckdb/src/include/duckdb/storage/partial_block_manager.hpp +35 -19
- package/src/duckdb/src/include/duckdb/storage/statistics/base_statistics.hpp +2 -11
- package/src/duckdb/src/include/duckdb/storage/statistics/column_statistics.hpp +3 -5
- package/src/duckdb/src/include/duckdb/storage/statistics/distinct_statistics.hpp +3 -11
- package/src/duckdb/src/include/duckdb/storage/statistics/list_stats.hpp +2 -7
- package/src/duckdb/src/include/duckdb/storage/statistics/node_statistics.hpp +0 -26
- package/src/duckdb/src/include/duckdb/storage/statistics/numeric_stats.hpp +2 -7
- package/src/duckdb/src/include/duckdb/storage/statistics/string_stats.hpp +2 -7
- package/src/duckdb/src/include/duckdb/storage/statistics/struct_stats.hpp +2 -7
- package/src/duckdb/src/include/duckdb/storage/storage_info.hpp +4 -6
- package/src/duckdb/src/include/duckdb/storage/table/chunk_info.hpp +8 -17
- package/src/duckdb/src/include/duckdb/storage/table/column_checkpoint_state.hpp +5 -20
- package/src/duckdb/src/include/duckdb/storage/table/column_data.hpp +2 -2
- package/src/duckdb/src/include/duckdb/storage/table/list_column_data.hpp +1 -1
- package/src/duckdb/src/include/duckdb/storage/table/row_group.hpp +2 -7
- package/src/duckdb/src/include/duckdb/storage/table/standard_column_data.hpp +2 -2
- package/src/duckdb/src/include/duckdb/storage/table/table_statistics.hpp +4 -7
- package/src/duckdb/src/include/duckdb/storage/write_ahead_log.hpp +27 -29
- package/src/duckdb/src/include/duckdb/verification/statement_verifier.hpp +0 -2
- package/src/duckdb/src/main/client_context.cpp +0 -6
- package/src/duckdb/src/main/client_verify.cpp +0 -2
- package/src/duckdb/src/main/extension/extension_helper.cpp +1 -0
- package/src/duckdb/src/main/relation.cpp +15 -2
- package/src/duckdb/src/parser/column_definition.cpp +0 -25
- package/src/duckdb/src/parser/column_list.cpp +0 -13
- package/src/duckdb/src/parser/constraint.cpp +0 -33
- package/src/duckdb/src/parser/constraints/check_constraint.cpp +0 -11
- package/src/duckdb/src/parser/constraints/foreign_key_constraint.cpp +0 -27
- package/src/duckdb/src/parser/constraints/not_null_constraint.cpp +0 -11
- package/src/duckdb/src/parser/constraints/unique_constraint.cpp +0 -24
- package/src/duckdb/src/parser/expression/between_expression.cpp +2 -16
- package/src/duckdb/src/parser/expression/case_expression.cpp +2 -29
- package/src/duckdb/src/parser/expression/cast_expression.cpp +2 -16
- package/src/duckdb/src/parser/expression/collate_expression.cpp +2 -14
- package/src/duckdb/src/parser/expression/columnref_expression.cpp +2 -13
- package/src/duckdb/src/parser/expression/comparison_expression.cpp +2 -14
- package/src/duckdb/src/parser/expression/conjunction_expression.cpp +2 -13
- package/src/duckdb/src/parser/expression/constant_expression.cpp +2 -12
- package/src/duckdb/src/parser/expression/default_expression.cpp +2 -9
- package/src/duckdb/src/parser/expression/function_expression.cpp +2 -32
- package/src/duckdb/src/parser/expression/lambda_expression.cpp +2 -14
- package/src/duckdb/src/parser/expression/operator_expression.cpp +2 -13
- package/src/duckdb/src/parser/expression/parameter_expression.cpp +2 -13
- package/src/duckdb/src/parser/expression/positional_reference_expression.cpp +2 -12
- package/src/duckdb/src/parser/expression/star_expression.cpp +2 -43
- package/src/duckdb/src/parser/expression/subquery_expression.cpp +2 -28
- package/src/duckdb/src/parser/expression/window_expression.cpp +2 -53
- package/src/duckdb/src/parser/parsed_data/alter_info.cpp +0 -35
- package/src/duckdb/src/parser/parsed_data/alter_scalar_function_info.cpp +0 -18
- package/src/duckdb/src/parser/parsed_data/alter_table_function_info.cpp +0 -13
- package/src/duckdb/src/parser/parsed_data/alter_table_info.cpp +1 -189
- package/src/duckdb/src/parser/parsed_data/attach_info.cpp +0 -29
- package/src/duckdb/src/parser/parsed_data/create_collation_info.cpp +0 -4
- package/src/duckdb/src/parser/parsed_data/create_copy_function_info.cpp +0 -4
- package/src/duckdb/src/parser/parsed_data/create_index_info.cpp +0 -48
- package/src/duckdb/src/parser/parsed_data/create_info.cpp +0 -47
- package/src/duckdb/src/parser/parsed_data/create_macro_info.cpp +1 -28
- package/src/duckdb/src/parser/parsed_data/create_sequence_info.cpp +0 -31
- package/src/duckdb/src/parser/parsed_data/create_table_info.cpp +0 -23
- package/src/duckdb/src/parser/parsed_data/create_type_info.cpp +0 -22
- package/src/duckdb/src/parser/parsed_data/create_view_info.cpp +0 -23
- package/src/duckdb/src/parser/parsed_data/detach_info.cpp +0 -19
- package/src/duckdb/src/parser/parsed_data/drop_info.cpp +0 -26
- package/src/duckdb/src/parser/parsed_data/sample_options.cpp +2 -25
- package/src/duckdb/src/parser/parsed_data/transaction_info.cpp +0 -16
- package/src/duckdb/src/parser/parsed_data/vacuum_info.cpp +0 -20
- package/src/duckdb/src/parser/parsed_expression.cpp +2 -79
- package/src/duckdb/src/parser/query_node/cte_node.cpp +2 -19
- package/src/duckdb/src/parser/query_node/recursive_cte_node.cpp +2 -21
- package/src/duckdb/src/parser/query_node/select_node.cpp +2 -47
- package/src/duckdb/src/parser/query_node/set_operation_node.cpp +2 -17
- package/src/duckdb/src/parser/query_node.cpp +2 -62
- package/src/duckdb/src/parser/result_modifier.cpp +2 -96
- package/src/duckdb/src/parser/statement/select_statement.cpp +2 -13
- package/src/duckdb/src/parser/tableref/basetableref.cpp +2 -21
- package/src/duckdb/src/parser/tableref/emptytableref.cpp +0 -9
- package/src/duckdb/src/parser/tableref/expressionlistref.cpp +2 -28
- package/src/duckdb/src/parser/tableref/joinref.cpp +2 -23
- package/src/duckdb/src/parser/tableref/pivotref.cpp +0 -61
- package/src/duckdb/src/parser/tableref/subqueryref.cpp +2 -15
- package/src/duckdb/src/parser/tableref/table_function.cpp +2 -17
- package/src/duckdb/src/parser/tableref.cpp +2 -52
- package/src/duckdb/src/planner/binder/expression/bind_subquery_expression.cpp +1 -4
- package/src/duckdb/src/planner/bound_result_modifier.cpp +0 -33
- package/src/duckdb/src/planner/expression/bound_aggregate_expression.cpp +6 -30
- package/src/duckdb/src/planner/expression/bound_between_expression.cpp +0 -19
- package/src/duckdb/src/planner/expression/bound_case_expression.cpp +0 -36
- package/src/duckdb/src/planner/expression/bound_cast_expression.cpp +0 -15
- package/src/duckdb/src/planner/expression/bound_columnref_expression.cpp +0 -20
- package/src/duckdb/src/planner/expression/bound_comparison_expression.cpp +0 -13
- package/src/duckdb/src/planner/expression/bound_conjunction_expression.cpp +0 -13
- package/src/duckdb/src/planner/expression/bound_constant_expression.cpp +0 -11
- package/src/duckdb/src/planner/expression/bound_expression.cpp +1 -5
- package/src/duckdb/src/planner/expression/bound_function_expression.cpp +8 -28
- package/src/duckdb/src/planner/expression/bound_lambda_expression.cpp +0 -4
- package/src/duckdb/src/planner/expression/bound_lambdaref_expression.cpp +0 -23
- package/src/duckdb/src/planner/expression/bound_operator_expression.cpp +0 -16
- package/src/duckdb/src/planner/expression/bound_parameter_expression.cpp +0 -18
- package/src/duckdb/src/planner/expression/bound_reference_expression.cpp +0 -16
- package/src/duckdb/src/planner/expression/bound_subquery_expression.cpp +0 -4
- package/src/duckdb/src/planner/expression/bound_unnest_expression.cpp +0 -15
- package/src/duckdb/src/planner/expression/bound_window_expression.cpp +7 -60
- package/src/duckdb/src/planner/expression.cpp +0 -74
- package/src/duckdb/src/planner/filter/conjunction_filter.cpp +0 -21
- package/src/duckdb/src/planner/filter/constant_filter.cpp +0 -12
- package/src/duckdb/src/planner/filter/null_filter.cpp +0 -14
- package/src/duckdb/src/planner/joinside.cpp +0 -24
- package/src/duckdb/src/planner/logical_operator.cpp +15 -215
- package/src/duckdb/src/planner/operator/logical_aggregate.cpp +0 -46
- package/src/duckdb/src/planner/operator/logical_any_join.cpp +0 -14
- package/src/duckdb/src/planner/operator/logical_column_data_get.cpp +0 -23
- package/src/duckdb/src/planner/operator/logical_comparison_join.cpp +0 -23
- package/src/duckdb/src/planner/operator/logical_copy_to_file.cpp +2 -56
- package/src/duckdb/src/planner/operator/logical_create.cpp +0 -12
- package/src/duckdb/src/planner/operator/logical_create_index.cpp +0 -25
- package/src/duckdb/src/planner/operator/logical_create_table.cpp +0 -10
- package/src/duckdb/src/planner/operator/logical_cross_product.cpp +0 -9
- package/src/duckdb/src/planner/operator/logical_cteref.cpp +0 -18
- package/src/duckdb/src/planner/operator/logical_delete.cpp +0 -22
- package/src/duckdb/src/planner/operator/logical_delim_get.cpp +0 -12
- package/src/duckdb/src/planner/operator/logical_dependent_join.cpp +0 -4
- package/src/duckdb/src/planner/operator/logical_distinct.cpp +0 -16
- package/src/duckdb/src/planner/operator/logical_dummy_scan.cpp +0 -10
- package/src/duckdb/src/planner/operator/logical_empty_result.cpp +0 -15
- package/src/duckdb/src/planner/operator/logical_expression_get.cpp +0 -24
- package/src/duckdb/src/planner/operator/logical_extension_operator.cpp +6 -19
- package/src/duckdb/src/planner/operator/logical_filter.cpp +0 -15
- package/src/duckdb/src/planner/operator/logical_get.cpp +12 -97
- package/src/duckdb/src/planner/operator/logical_insert.cpp +0 -77
- package/src/duckdb/src/planner/operator/logical_join.cpp +0 -17
- package/src/duckdb/src/planner/operator/logical_limit.cpp +0 -16
- package/src/duckdb/src/planner/operator/logical_limit_percent.cpp +0 -16
- package/src/duckdb/src/planner/operator/logical_materialized_cte.cpp +0 -13
- package/src/duckdb/src/planner/operator/logical_order.cpp +0 -15
- package/src/duckdb/src/planner/operator/logical_pivot.cpp +0 -20
- package/src/duckdb/src/planner/operator/logical_positional_join.cpp +0 -10
- package/src/duckdb/src/planner/operator/logical_pragma.cpp +0 -8
- package/src/duckdb/src/planner/operator/logical_prepare.cpp +0 -8
- package/src/duckdb/src/planner/operator/logical_projection.cpp +0 -12
- package/src/duckdb/src/planner/operator/logical_recursive_cte.cpp +0 -15
- package/src/duckdb/src/planner/operator/logical_reset.cpp +0 -12
- package/src/duckdb/src/planner/operator/logical_sample.cpp +0 -11
- package/src/duckdb/src/planner/operator/logical_set.cpp +0 -14
- package/src/duckdb/src/planner/operator/logical_set_operation.cpp +0 -13
- package/src/duckdb/src/planner/operator/logical_simple.cpp +0 -60
- package/src/duckdb/src/planner/operator/logical_top_n.cpp +0 -14
- package/src/duckdb/src/planner/operator/logical_unnest.cpp +0 -14
- package/src/duckdb/src/planner/operator/logical_update.cpp +0 -28
- package/src/duckdb/src/planner/operator/logical_window.cpp +0 -13
- package/src/duckdb/src/planner/planner.cpp +13 -22
- package/src/duckdb/src/planner/table_filter.cpp +0 -59
- package/src/duckdb/src/storage/checkpoint/row_group_writer.cpp +7 -17
- package/src/duckdb/src/storage/checkpoint/table_data_reader.cpp +7 -4
- package/src/duckdb/src/storage/checkpoint/table_data_writer.cpp +24 -22
- package/src/duckdb/src/storage/checkpoint_manager.cpp +203 -180
- package/src/duckdb/src/storage/data_table.cpp +2 -2
- package/src/duckdb/src/storage/metadata/metadata_manager.cpp +11 -9
- package/src/duckdb/src/storage/partial_block_manager.cpp +42 -15
- package/src/duckdb/src/storage/serialization/serialize_constraint.cpp +20 -20
- package/src/duckdb/src/storage/serialization/serialize_create_info.cpp +46 -42
- package/src/duckdb/src/storage/serialization/serialize_expression.cpp +63 -63
- package/src/duckdb/src/storage/serialization/serialize_logical_operator.cpp +167 -165
- package/src/duckdb/src/storage/serialization/serialize_macro_function.cpp +12 -12
- package/src/duckdb/src/storage/serialization/serialize_nodes.cpp +54 -54
- package/src/duckdb/src/storage/serialization/serialize_parse_info.cpp +88 -88
- package/src/duckdb/src/storage/serialization/serialize_parsed_expression.cpp +72 -72
- package/src/duckdb/src/storage/serialization/serialize_query_node.cpp +20 -20
- package/src/duckdb/src/storage/serialization/serialize_result_modifier.cpp +22 -22
- package/src/duckdb/src/storage/serialization/serialize_statement.cpp +4 -4
- package/src/duckdb/src/storage/serialization/serialize_storage.cpp +41 -6
- package/src/duckdb/src/storage/serialization/serialize_table_filter.cpp +24 -24
- package/src/duckdb/src/storage/serialization/serialize_tableref.cpp +32 -32
- package/src/duckdb/src/storage/serialization/serialize_types.cpp +29 -29
- package/src/duckdb/src/storage/single_file_block_manager.cpp +17 -22
- package/src/duckdb/src/storage/statistics/base_statistics.cpp +31 -85
- package/src/duckdb/src/storage/statistics/column_statistics.cpp +6 -19
- package/src/duckdb/src/storage/statistics/distinct_statistics.cpp +0 -26
- package/src/duckdb/src/storage/statistics/list_stats.cpp +6 -22
- package/src/duckdb/src/storage/statistics/numeric_stats.cpp +20 -135
- package/src/duckdb/src/storage/statistics/string_stats.cpp +5 -28
- package/src/duckdb/src/storage/statistics/struct_stats.cpp +8 -30
- package/src/duckdb/src/storage/storage_info.cpp +1 -1
- package/src/duckdb/src/storage/table/chunk_info.cpp +9 -88
- package/src/duckdb/src/storage/table/column_checkpoint_state.cpp +28 -34
- package/src/duckdb/src/storage/table/column_data.cpp +20 -25
- package/src/duckdb/src/storage/table/list_column_data.cpp +16 -9
- package/src/duckdb/src/storage/table/row_group.cpp +16 -92
- package/src/duckdb/src/storage/table/row_group_collection.cpp +5 -1
- package/src/duckdb/src/storage/table/standard_column_data.cpp +10 -7
- package/src/duckdb/src/storage/table/struct_column_data.cpp +17 -11
- package/src/duckdb/src/storage/table/table_statistics.cpp +13 -22
- package/src/duckdb/src/storage/wal_replay.cpp +108 -106
- package/src/duckdb/src/storage/write_ahead_log.cpp +135 -64
- package/src/duckdb/src/transaction/commit_state.cpp +22 -8
- package/src/duckdb/src/verification/deserialized_statement_verifier.cpp +11 -6
- package/src/duckdb/src/verification/statement_verifier.cpp +0 -5
- package/src/duckdb/third_party/parquet/parquet_types.h +1 -1
- package/src/duckdb/ub_src_common.cpp +0 -4
- package/src/duckdb/ub_src_common_serializer.cpp +2 -4
- package/src/duckdb/ub_src_planner.cpp +0 -2
- package/src/duckdb/ub_src_planner_expression.cpp +0 -2
- package/src/duckdb/ub_src_planner_operator.cpp +0 -8
- package/src/duckdb_node.cpp +6 -12
- package/src/duckdb_node.hpp +23 -13
- package/src/statement.cpp +15 -16
- package/test/database_fail.test.ts +20 -0
- package/test/worker.js +7 -0
- package/src/duckdb/src/common/field_writer.cpp +0 -97
- package/src/duckdb/src/common/serializer/buffered_deserializer.cpp +0 -27
- package/src/duckdb/src/common/serializer/buffered_serializer.cpp +0 -36
- package/src/duckdb/src/common/serializer.cpp +0 -24
- package/src/duckdb/src/include/duckdb/common/field_writer.hpp +0 -379
- package/src/duckdb/src/include/duckdb/common/serializer/buffered_deserializer.hpp +0 -41
- package/src/duckdb/src/include/duckdb/common/serializer/buffered_serializer.hpp +0 -50
- package/src/duckdb/src/include/duckdb/common/serializer.hpp +0 -151
- package/src/duckdb/src/include/duckdb/planner/plan_serialization.hpp +0 -44
- package/src/duckdb/src/include/duckdb/verification/deserialized_statement_verifier_v2.hpp +0 -32
- package/src/duckdb/src/planner/expression/bound_default_expression.cpp +0 -16
- package/src/duckdb/src/planner/operator/logical_execute.cpp +0 -12
- package/src/duckdb/src/planner/operator/logical_explain.cpp +0 -22
- package/src/duckdb/src/planner/operator/logical_export.cpp +0 -13
- package/src/duckdb/src/planner/operator/logical_show.cpp +0 -21
- package/src/duckdb/src/planner/parsed_data/bound_create_table_info.cpp +0 -22
- package/src/duckdb/src/planner/plan_serialization.cpp +0 -20
- package/src/duckdb/src/verification/deserialized_statement_verifier_v2.cpp +0 -34
- package/src/duckdb/ub_src_planner_parsed_data.cpp +0 -2
@@ -1,13 +1,12 @@
|
|
1
1
|
#include "duckdb/common/exception.hpp"
|
2
|
-
#include "duckdb/common/field_writer.hpp"
|
3
2
|
#include "duckdb/common/string_util.hpp"
|
4
3
|
#include "duckdb/common/types/vector.hpp"
|
5
4
|
#include "duckdb/storage/statistics/base_statistics.hpp"
|
6
5
|
#include "duckdb/storage/statistics/list_stats.hpp"
|
7
6
|
#include "duckdb/storage/statistics/struct_stats.hpp"
|
8
7
|
|
9
|
-
#include "duckdb/common/serializer/
|
10
|
-
#include "duckdb/common/serializer/
|
8
|
+
#include "duckdb/common/serializer/serializer.hpp"
|
9
|
+
#include "duckdb/common/serializer/deserializer.hpp"
|
11
10
|
|
12
11
|
namespace duckdb {
|
13
12
|
|
@@ -275,59 +274,30 @@ void BaseStatistics::SetDistinctCount(idx_t count) {
|
|
275
274
|
}
|
276
275
|
|
277
276
|
void BaseStatistics::Serialize(Serializer &serializer) const {
|
278
|
-
FieldWriter writer(serializer);
|
279
|
-
writer.WriteField<bool>(has_null);
|
280
|
-
writer.WriteField<bool>(has_no_null);
|
281
|
-
writer.WriteField<idx_t>(distinct_count);
|
282
|
-
Serialize(writer);
|
283
|
-
writer.Finalize();
|
284
|
-
}
|
285
|
-
|
286
|
-
void BaseStatistics::Serialize(FieldWriter &writer) const {
|
287
|
-
switch (GetStatsType()) {
|
288
|
-
case StatisticsType::NUMERIC_STATS:
|
289
|
-
NumericStats::Serialize(*this, writer);
|
290
|
-
break;
|
291
|
-
case StatisticsType::STRING_STATS:
|
292
|
-
StringStats::Serialize(*this, writer);
|
293
|
-
break;
|
294
|
-
case StatisticsType::LIST_STATS:
|
295
|
-
ListStats::Serialize(*this, writer);
|
296
|
-
break;
|
297
|
-
case StatisticsType::STRUCT_STATS:
|
298
|
-
StructStats::Serialize(*this, writer);
|
299
|
-
break;
|
300
|
-
default:
|
301
|
-
break;
|
302
|
-
}
|
303
|
-
}
|
304
|
-
|
305
|
-
void BaseStatistics::FormatSerialize(FormatSerializer &serializer) const {
|
306
277
|
serializer.WriteProperty(100, "has_null", has_null);
|
307
278
|
serializer.WriteProperty(101, "has_no_null", has_no_null);
|
308
279
|
serializer.WriteProperty(102, "distinct_count", distinct_count);
|
309
|
-
serializer.
|
310
|
-
serializer.WriteObject(104, "stats", [this](FormatSerializer &serializer) {
|
280
|
+
serializer.WriteObject(103, "type_stats", [&](Serializer &serializer) {
|
311
281
|
switch (GetStatsType()) {
|
312
282
|
case StatisticsType::NUMERIC_STATS:
|
313
|
-
NumericStats::
|
283
|
+
NumericStats::Serialize(*this, serializer);
|
314
284
|
break;
|
315
285
|
case StatisticsType::STRING_STATS:
|
316
|
-
StringStats::
|
286
|
+
StringStats::Serialize(*this, serializer);
|
317
287
|
break;
|
318
288
|
case StatisticsType::LIST_STATS:
|
319
|
-
ListStats::
|
289
|
+
ListStats::Serialize(*this, serializer);
|
320
290
|
break;
|
321
291
|
case StatisticsType::STRUCT_STATS:
|
322
|
-
StructStats::
|
292
|
+
StructStats::Serialize(*this, serializer);
|
323
293
|
break;
|
324
294
|
default:
|
325
|
-
|
295
|
+
break;
|
326
296
|
}
|
327
297
|
});
|
328
298
|
}
|
329
299
|
|
330
|
-
BaseStatistics BaseStatistics::
|
300
|
+
BaseStatistics BaseStatistics::Deserialize(Deserializer &deserializer) {
|
331
301
|
auto has_null = deserializer.ReadProperty<bool>(100, "has_null");
|
332
302
|
auto has_no_null = deserializer.ReadProperty<bool>(101, "has_no_null");
|
333
303
|
auto distinct_count = deserializer.ReadProperty<idx_t>(102, "distinct_count");
|
@@ -335,58 +305,34 @@ BaseStatistics BaseStatistics::FormatDeserialize(FormatDeserializer &deserialize
|
|
335
305
|
// Get the logical type from the deserializer context.
|
336
306
|
auto type = deserializer.Get<LogicalType &>();
|
337
307
|
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
stats = NumericStats::FormatDeserialize(deserializer, type);
|
342
|
-
break;
|
343
|
-
case StatisticsType::STRING_STATS:
|
344
|
-
stats = StringStats::FormatDeserialize(deserializer, type);
|
345
|
-
break;
|
346
|
-
case StatisticsType::LIST_STATS:
|
347
|
-
stats = ListStats::FormatDeserialize(deserializer, type);
|
348
|
-
break;
|
349
|
-
case StatisticsType::STRUCT_STATS:
|
350
|
-
stats = StructStats::FormatDeserialize(deserializer, type);
|
351
|
-
break;
|
352
|
-
default:
|
353
|
-
stats = BaseStatistics(std::move(type));
|
354
|
-
break;
|
355
|
-
}
|
308
|
+
auto stats_type = GetStatsType(type);
|
309
|
+
|
310
|
+
BaseStatistics stats(std::move(type));
|
356
311
|
|
357
312
|
stats.has_null = has_null;
|
358
313
|
stats.has_no_null = has_no_null;
|
359
314
|
stats.distinct_count = distinct_count;
|
360
315
|
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
}
|
316
|
+
deserializer.ReadObject(103, "type_stats", [&](Deserializer &obj) {
|
317
|
+
switch (stats_type) {
|
318
|
+
case StatisticsType::NUMERIC_STATS:
|
319
|
+
NumericStats::Deserialize(obj, stats);
|
320
|
+
break;
|
321
|
+
case StatisticsType::STRING_STATS:
|
322
|
+
StringStats::Deserialize(obj, stats);
|
323
|
+
break;
|
324
|
+
case StatisticsType::LIST_STATS:
|
325
|
+
ListStats::Deserialize(obj, stats);
|
326
|
+
break;
|
327
|
+
case StatisticsType::STRUCT_STATS:
|
328
|
+
StructStats::Deserialize(obj, stats);
|
329
|
+
break;
|
330
|
+
default:
|
331
|
+
break;
|
332
|
+
}
|
333
|
+
});
|
378
334
|
|
379
|
-
|
380
|
-
FieldReader reader(source);
|
381
|
-
bool has_null = reader.ReadRequired<bool>();
|
382
|
-
bool has_no_null = reader.ReadRequired<bool>();
|
383
|
-
idx_t distinct_count = reader.ReadRequired<idx_t>();
|
384
|
-
auto result = DeserializeType(reader, std::move(type));
|
385
|
-
result.has_null = has_null;
|
386
|
-
result.has_no_null = has_no_null;
|
387
|
-
result.distinct_count = distinct_count;
|
388
|
-
reader.Finalize();
|
389
|
-
return result;
|
335
|
+
return stats;
|
390
336
|
}
|
391
337
|
|
392
338
|
string BaseStatistics::ToString() const {
|
@@ -1,7 +1,6 @@
|
|
1
1
|
#include "duckdb/storage/statistics/column_statistics.hpp"
|
2
|
-
#include "duckdb/common/serializer.hpp"
|
3
|
-
#include "duckdb/common/serializer/
|
4
|
-
#include "duckdb/common/serializer/format_serializer.hpp"
|
2
|
+
#include "duckdb/common/serializer/deserializer.hpp"
|
3
|
+
#include "duckdb/common/serializer/serializer.hpp"
|
5
4
|
|
6
5
|
namespace duckdb {
|
7
6
|
|
@@ -55,29 +54,17 @@ void ColumnStatistics::UpdateDistinctStatistics(Vector &v, idx_t count) {
|
|
55
54
|
shared_ptr<ColumnStatistics> ColumnStatistics::Copy() const {
|
56
55
|
return make_shared<ColumnStatistics>(stats.Copy(), distinct_stats ? distinct_stats->Copy() : nullptr);
|
57
56
|
}
|
58
|
-
void ColumnStatistics::Serialize(Serializer &serializer) const {
|
59
|
-
stats.Serialize(serializer);
|
60
|
-
serializer.WriteOptional(distinct_stats);
|
61
|
-
}
|
62
57
|
|
63
|
-
|
64
|
-
auto stats = BaseStatistics::Deserialize(source, type);
|
65
|
-
auto distinct_stats = source.ReadOptional<DistinctStatistics>();
|
66
|
-
return make_shared<ColumnStatistics>(stats.Copy(), std::move(distinct_stats));
|
67
|
-
}
|
68
|
-
|
69
|
-
void ColumnStatistics::FormatSerialize(FormatSerializer &serializer) const {
|
58
|
+
void ColumnStatistics::Serialize(Serializer &serializer) const {
|
70
59
|
serializer.WriteProperty(100, "statistics", stats);
|
71
60
|
serializer.WritePropertyWithDefault(101, "distinct", distinct_stats, unique_ptr<DistinctStatistics>());
|
72
61
|
}
|
73
62
|
|
74
|
-
shared_ptr<ColumnStatistics> ColumnStatistics::
|
75
|
-
|
76
|
-
// we have this sort of pseudo inheritance going on here which is annoying
|
77
|
-
auto stats = BaseStatistics::FormatDeserialize(deserializer);
|
63
|
+
shared_ptr<ColumnStatistics> ColumnStatistics::Deserialize(Deserializer &deserializer) {
|
64
|
+
auto stats = deserializer.ReadProperty<BaseStatistics>(100, "statistics");
|
78
65
|
auto distinct_stats = deserializer.ReadPropertyWithDefault<unique_ptr<DistinctStatistics>>(
|
79
66
|
101, "distinct", unique_ptr<DistinctStatistics>());
|
80
|
-
return make_shared<ColumnStatistics>(stats
|
67
|
+
return make_shared<ColumnStatistics>(std::move(stats), std::move(distinct_stats));
|
81
68
|
}
|
82
69
|
|
83
70
|
} // namespace duckdb
|
@@ -1,6 +1,5 @@
|
|
1
1
|
#include "duckdb/storage/statistics/distinct_statistics.hpp"
|
2
2
|
|
3
|
-
#include "duckdb/common/field_writer.hpp"
|
4
3
|
#include "duckdb/common/string_util.hpp"
|
5
4
|
|
6
5
|
#include <math.h>
|
@@ -24,31 +23,6 @@ void DistinctStatistics::Merge(const DistinctStatistics &other) {
|
|
24
23
|
total_count += other.total_count;
|
25
24
|
}
|
26
25
|
|
27
|
-
void DistinctStatistics::Serialize(Serializer &serializer) const {
|
28
|
-
FieldWriter writer(serializer);
|
29
|
-
Serialize(writer);
|
30
|
-
writer.Finalize();
|
31
|
-
}
|
32
|
-
|
33
|
-
void DistinctStatistics::Serialize(FieldWriter &writer) const {
|
34
|
-
writer.WriteField<idx_t>(sample_count);
|
35
|
-
writer.WriteField<idx_t>(total_count);
|
36
|
-
log->Serialize(writer);
|
37
|
-
}
|
38
|
-
|
39
|
-
unique_ptr<DistinctStatistics> DistinctStatistics::Deserialize(Deserializer &source) {
|
40
|
-
FieldReader reader(source);
|
41
|
-
auto result = Deserialize(reader);
|
42
|
-
reader.Finalize();
|
43
|
-
return result;
|
44
|
-
}
|
45
|
-
|
46
|
-
unique_ptr<DistinctStatistics> DistinctStatistics::Deserialize(FieldReader &reader) {
|
47
|
-
auto sample_count = reader.ReadRequired<idx_t>();
|
48
|
-
auto total_count = reader.ReadRequired<idx_t>();
|
49
|
-
return make_uniq<DistinctStatistics>(HyperLogLog::Deserialize(reader), sample_count, total_count);
|
50
|
-
}
|
51
|
-
|
52
26
|
void DistinctStatistics::Update(Vector &v, idx_t count, bool sample) {
|
53
27
|
UnifiedVectorFormat vdata;
|
54
28
|
v.ToUnifiedFormat(count, vdata);
|
@@ -1,11 +1,10 @@
|
|
1
1
|
#include "duckdb/storage/statistics/list_stats.hpp"
|
2
2
|
#include "duckdb/storage/statistics/base_statistics.hpp"
|
3
|
-
#include "duckdb/common/field_writer.hpp"
|
4
3
|
#include "duckdb/common/string_util.hpp"
|
5
4
|
#include "duckdb/common/types/vector.hpp"
|
6
5
|
|
7
|
-
#include "duckdb/common/serializer/
|
8
|
-
#include "duckdb/common/serializer/
|
6
|
+
#include "duckdb/common/serializer/serializer.hpp"
|
7
|
+
#include "duckdb/common/serializer/deserializer.hpp"
|
9
8
|
|
10
9
|
namespace duckdb {
|
11
10
|
|
@@ -69,35 +68,20 @@ void ListStats::Merge(BaseStatistics &stats, const BaseStatistics &other) {
|
|
69
68
|
child_stats.Merge(other_child_stats);
|
70
69
|
}
|
71
70
|
|
72
|
-
void ListStats::Serialize(const BaseStatistics &stats,
|
73
|
-
auto &child_stats = ListStats::GetChildStats(stats);
|
74
|
-
writer.WriteSerializable(child_stats);
|
75
|
-
}
|
76
|
-
|
77
|
-
BaseStatistics ListStats::Deserialize(FieldReader &reader, LogicalType type) {
|
78
|
-
D_ASSERT(type.InternalType() == PhysicalType::LIST);
|
79
|
-
auto &child_type = ListType::GetChildType(type);
|
80
|
-
BaseStatistics result(std::move(type));
|
81
|
-
result.child_stats[0].Copy(reader.ReadRequiredSerializable<BaseStatistics, BaseStatistics>(child_type));
|
82
|
-
return result;
|
83
|
-
}
|
84
|
-
|
85
|
-
void ListStats::FormatSerialize(const BaseStatistics &stats, FormatSerializer &serializer) {
|
71
|
+
void ListStats::Serialize(const BaseStatistics &stats, Serializer &serializer) {
|
86
72
|
auto &child_stats = ListStats::GetChildStats(stats);
|
87
73
|
serializer.WriteProperty(200, "child_stats", child_stats);
|
88
74
|
}
|
89
75
|
|
90
|
-
|
76
|
+
void ListStats::Deserialize(Deserializer &deserializer, BaseStatistics &base) {
|
77
|
+
auto &type = base.GetType();
|
91
78
|
D_ASSERT(type.InternalType() == PhysicalType::LIST);
|
92
79
|
auto &child_type = ListType::GetChildType(type);
|
93
|
-
BaseStatistics result(std::move(type));
|
94
80
|
|
95
81
|
// Push the logical type of the child type to the deserialization context
|
96
82
|
deserializer.Set<LogicalType &>(const_cast<LogicalType &>(child_type));
|
97
|
-
|
83
|
+
base.child_stats[0].Copy(deserializer.ReadProperty<BaseStatistics>(200, "child_stats"));
|
98
84
|
deserializer.Unset<LogicalType>();
|
99
|
-
|
100
|
-
return result;
|
101
85
|
}
|
102
86
|
|
103
87
|
string ListStats::ToString(const BaseStatistics &stats) {
|
@@ -1,11 +1,10 @@
|
|
1
1
|
#include "duckdb/storage/statistics/numeric_stats.hpp"
|
2
2
|
#include "duckdb/storage/statistics/base_statistics.hpp"
|
3
|
-
#include "duckdb/common/field_writer.hpp"
|
4
3
|
#include "duckdb/common/types/vector.hpp"
|
5
4
|
#include "duckdb/common/operator/comparison_operators.hpp"
|
6
5
|
|
7
|
-
#include "duckdb/common/serializer/
|
8
|
-
#include "duckdb/common/serializer/
|
6
|
+
#include "duckdb/common/serializer/serializer.hpp"
|
7
|
+
#include "duckdb/common/serializer/deserializer.hpp"
|
9
8
|
|
10
9
|
namespace duckdb {
|
11
10
|
|
@@ -407,119 +406,7 @@ Value NumericStats::MaxOrNull(const BaseStatistics &stats) {
|
|
407
406
|
}
|
408
407
|
|
409
408
|
static void SerializeNumericStatsValue(const LogicalType &type, NumericValueUnion val, bool has_value,
|
410
|
-
|
411
|
-
writer.WriteField<bool>(!has_value);
|
412
|
-
if (!has_value) {
|
413
|
-
return;
|
414
|
-
}
|
415
|
-
switch (type.InternalType()) {
|
416
|
-
case PhysicalType::BOOL:
|
417
|
-
writer.WriteField<bool>(val.value_.boolean);
|
418
|
-
break;
|
419
|
-
case PhysicalType::INT8:
|
420
|
-
writer.WriteField<int8_t>(val.value_.tinyint);
|
421
|
-
break;
|
422
|
-
case PhysicalType::INT16:
|
423
|
-
writer.WriteField<int16_t>(val.value_.smallint);
|
424
|
-
break;
|
425
|
-
case PhysicalType::INT32:
|
426
|
-
writer.WriteField<int32_t>(val.value_.integer);
|
427
|
-
break;
|
428
|
-
case PhysicalType::INT64:
|
429
|
-
writer.WriteField<int64_t>(val.value_.bigint);
|
430
|
-
break;
|
431
|
-
case PhysicalType::UINT8:
|
432
|
-
writer.WriteField<int8_t>(val.value_.utinyint);
|
433
|
-
break;
|
434
|
-
case PhysicalType::UINT16:
|
435
|
-
writer.WriteField<int16_t>(val.value_.usmallint);
|
436
|
-
break;
|
437
|
-
case PhysicalType::UINT32:
|
438
|
-
writer.WriteField<int32_t>(val.value_.uinteger);
|
439
|
-
break;
|
440
|
-
case PhysicalType::UINT64:
|
441
|
-
writer.WriteField<int64_t>(val.value_.ubigint);
|
442
|
-
break;
|
443
|
-
case PhysicalType::INT128:
|
444
|
-
writer.WriteField<hugeint_t>(val.value_.hugeint);
|
445
|
-
break;
|
446
|
-
case PhysicalType::FLOAT:
|
447
|
-
writer.WriteField<float>(val.value_.float_);
|
448
|
-
break;
|
449
|
-
case PhysicalType::DOUBLE:
|
450
|
-
writer.WriteField<double>(val.value_.double_);
|
451
|
-
break;
|
452
|
-
default:
|
453
|
-
throw InternalException("Unsupported type for serializing numeric statistics");
|
454
|
-
}
|
455
|
-
}
|
456
|
-
|
457
|
-
void NumericStats::Serialize(const BaseStatistics &stats, FieldWriter &writer) {
|
458
|
-
auto &numeric_stats = NumericStats::GetDataUnsafe(stats);
|
459
|
-
SerializeNumericStatsValue(stats.GetType(), numeric_stats.min, numeric_stats.has_min, writer);
|
460
|
-
SerializeNumericStatsValue(stats.GetType(), numeric_stats.max, numeric_stats.has_max, writer);
|
461
|
-
}
|
462
|
-
|
463
|
-
void DeserializeNumericStatsValue(const LogicalType &type, FieldReader &reader, NumericValueUnion &result,
|
464
|
-
bool &has_stats) {
|
465
|
-
auto is_null = reader.ReadRequired<bool>();
|
466
|
-
if (is_null) {
|
467
|
-
has_stats = false;
|
468
|
-
return;
|
469
|
-
}
|
470
|
-
has_stats = true;
|
471
|
-
switch (type.InternalType()) {
|
472
|
-
case PhysicalType::BOOL:
|
473
|
-
result.value_.boolean = reader.ReadRequired<bool>();
|
474
|
-
break;
|
475
|
-
case PhysicalType::INT8:
|
476
|
-
result.value_.tinyint = reader.ReadRequired<int8_t>();
|
477
|
-
break;
|
478
|
-
case PhysicalType::INT16:
|
479
|
-
result.value_.smallint = reader.ReadRequired<int16_t>();
|
480
|
-
break;
|
481
|
-
case PhysicalType::INT32:
|
482
|
-
result.value_.integer = reader.ReadRequired<int32_t>();
|
483
|
-
break;
|
484
|
-
case PhysicalType::INT64:
|
485
|
-
result.value_.bigint = reader.ReadRequired<int64_t>();
|
486
|
-
break;
|
487
|
-
case PhysicalType::UINT8:
|
488
|
-
result.value_.utinyint = reader.ReadRequired<uint8_t>();
|
489
|
-
break;
|
490
|
-
case PhysicalType::UINT16:
|
491
|
-
result.value_.usmallint = reader.ReadRequired<uint16_t>();
|
492
|
-
break;
|
493
|
-
case PhysicalType::UINT32:
|
494
|
-
result.value_.uinteger = reader.ReadRequired<uint32_t>();
|
495
|
-
break;
|
496
|
-
case PhysicalType::UINT64:
|
497
|
-
result.value_.ubigint = reader.ReadRequired<uint64_t>();
|
498
|
-
break;
|
499
|
-
case PhysicalType::INT128:
|
500
|
-
result.value_.hugeint = reader.ReadRequired<hugeint_t>();
|
501
|
-
break;
|
502
|
-
case PhysicalType::FLOAT:
|
503
|
-
result.value_.float_ = reader.ReadRequired<float>();
|
504
|
-
break;
|
505
|
-
case PhysicalType::DOUBLE:
|
506
|
-
result.value_.double_ = reader.ReadRequired<double>();
|
507
|
-
break;
|
508
|
-
default:
|
509
|
-
throw InternalException("Unsupported type for deserializing numeric statistics");
|
510
|
-
}
|
511
|
-
}
|
512
|
-
|
513
|
-
BaseStatistics NumericStats::Deserialize(FieldReader &reader, LogicalType type) {
|
514
|
-
BaseStatistics result(std::move(type));
|
515
|
-
auto &numeric_stats = NumericStats::GetDataUnsafe(result);
|
516
|
-
DeserializeNumericStatsValue(result.GetType(), reader, numeric_stats.min, numeric_stats.has_min);
|
517
|
-
DeserializeNumericStatsValue(result.GetType(), reader, numeric_stats.max, numeric_stats.has_max);
|
518
|
-
return result;
|
519
|
-
}
|
520
|
-
|
521
|
-
static void FormatSerializeNumericStatsValue(const LogicalType &type, NumericValueUnion val, bool has_value,
|
522
|
-
FormatSerializer &serializer) {
|
409
|
+
Serializer &serializer) {
|
523
410
|
serializer.WriteProperty(100, "has_value", has_value);
|
524
411
|
if (!has_value) {
|
525
412
|
return;
|
@@ -566,18 +453,8 @@ static void FormatSerializeNumericStatsValue(const LogicalType &type, NumericVal
|
|
566
453
|
}
|
567
454
|
}
|
568
455
|
|
569
|
-
void
|
570
|
-
|
571
|
-
serializer.WriteObject(200, "max", [&](FormatSerializer &object) {
|
572
|
-
FormatSerializeNumericStatsValue(stats.GetType(), numeric_stats.min, numeric_stats.has_min, object);
|
573
|
-
});
|
574
|
-
serializer.WriteObject(201, "min", [&](FormatSerializer &object) {
|
575
|
-
FormatSerializeNumericStatsValue(stats.GetType(), numeric_stats.max, numeric_stats.has_max, object);
|
576
|
-
});
|
577
|
-
}
|
578
|
-
|
579
|
-
static void FormatDeserializeNumericStatsValue(const LogicalType &type, NumericValueUnion &result, bool &has_stats,
|
580
|
-
FormatDeserializer &deserializer) {
|
456
|
+
static void DeserializeNumericStatsValue(const LogicalType &type, NumericValueUnion &result, bool &has_stats,
|
457
|
+
Deserializer &deserializer) {
|
581
458
|
auto has_value = deserializer.ReadProperty<bool>(100, "has_value");
|
582
459
|
if (!has_value) {
|
583
460
|
has_stats = false;
|
@@ -626,17 +503,25 @@ static void FormatDeserializeNumericStatsValue(const LogicalType &type, NumericV
|
|
626
503
|
}
|
627
504
|
}
|
628
505
|
|
629
|
-
|
630
|
-
|
506
|
+
void NumericStats::Serialize(const BaseStatistics &stats, Serializer &serializer) {
|
507
|
+
auto &numeric_stats = NumericStats::GetDataUnsafe(stats);
|
508
|
+
serializer.WriteObject(200, "max", [&](Serializer &object) {
|
509
|
+
SerializeNumericStatsValue(stats.GetType(), numeric_stats.min, numeric_stats.has_min, object);
|
510
|
+
});
|
511
|
+
serializer.WriteObject(201, "min", [&](Serializer &object) {
|
512
|
+
SerializeNumericStatsValue(stats.GetType(), numeric_stats.max, numeric_stats.has_max, object);
|
513
|
+
});
|
514
|
+
}
|
515
|
+
|
516
|
+
void NumericStats::Deserialize(Deserializer &deserializer, BaseStatistics &result) {
|
631
517
|
auto &numeric_stats = NumericStats::GetDataUnsafe(result);
|
632
518
|
|
633
|
-
deserializer.ReadObject(200, "max", [&](
|
634
|
-
|
519
|
+
deserializer.ReadObject(200, "max", [&](Deserializer &object) {
|
520
|
+
DeserializeNumericStatsValue(result.GetType(), numeric_stats.min, numeric_stats.has_min, object);
|
635
521
|
});
|
636
|
-
deserializer.ReadObject(201, "min", [&](
|
637
|
-
|
522
|
+
deserializer.ReadObject(201, "min", [&](Deserializer &object) {
|
523
|
+
DeserializeNumericStatsValue(result.GetType(), numeric_stats.max, numeric_stats.has_max, object);
|
638
524
|
});
|
639
|
-
return result;
|
640
525
|
}
|
641
526
|
|
642
527
|
string NumericStats::ToString(const BaseStatistics &stats) {
|
@@ -1,14 +1,13 @@
|
|
1
1
|
#include "duckdb/storage/statistics/string_stats.hpp"
|
2
2
|
|
3
|
-
#include "duckdb/common/field_writer.hpp"
|
4
3
|
#include "duckdb/common/string_util.hpp"
|
5
4
|
#include "duckdb/common/types/vector.hpp"
|
6
5
|
#include "duckdb/main/error_manager.hpp"
|
7
6
|
#include "duckdb/storage/statistics/base_statistics.hpp"
|
8
7
|
#include "utf8proc_wrapper.hpp"
|
9
8
|
|
10
|
-
#include "duckdb/common/serializer/
|
11
|
-
#include "duckdb/common/serializer/
|
9
|
+
#include "duckdb/common/serializer/serializer.hpp"
|
10
|
+
#include "duckdb/common/serializer/deserializer.hpp"
|
12
11
|
|
13
12
|
namespace duckdb {
|
14
13
|
|
@@ -97,16 +96,7 @@ void StringStats::SetContainsUnicode(BaseStatistics &stats) {
|
|
97
96
|
StringStats::GetDataUnsafe(stats).has_unicode = true;
|
98
97
|
}
|
99
98
|
|
100
|
-
void StringStats::Serialize(const BaseStatistics &stats,
|
101
|
-
auto &string_data = StringStats::GetDataUnsafe(stats);
|
102
|
-
writer.WriteBlob(string_data.min, StringStatsData::MAX_STRING_MINMAX_SIZE);
|
103
|
-
writer.WriteBlob(string_data.max, StringStatsData::MAX_STRING_MINMAX_SIZE);
|
104
|
-
writer.WriteField<bool>(string_data.has_unicode);
|
105
|
-
writer.WriteField<bool>(string_data.has_max_string_length);
|
106
|
-
writer.WriteField<uint32_t>(string_data.max_string_length);
|
107
|
-
}
|
108
|
-
|
109
|
-
void StringStats::FormatSerialize(const BaseStatistics &stats, FormatSerializer &serializer) {
|
99
|
+
void StringStats::Serialize(const BaseStatistics &stats, Serializer &serializer) {
|
110
100
|
auto &string_data = StringStats::GetDataUnsafe(stats);
|
111
101
|
serializer.WriteProperty(200, "min", string_data.min, StringStatsData::MAX_STRING_MINMAX_SIZE);
|
112
102
|
serializer.WriteProperty(201, "max", string_data.max, StringStatsData::MAX_STRING_MINMAX_SIZE);
|
@@ -115,26 +105,13 @@ void StringStats::FormatSerialize(const BaseStatistics &stats, FormatSerializer
|
|
115
105
|
serializer.WriteProperty(204, "max_string_length", string_data.max_string_length);
|
116
106
|
}
|
117
107
|
|
118
|
-
|
119
|
-
|
120
|
-
auto &string_data = StringStats::GetDataUnsafe(result);
|
121
|
-
reader.ReadBlob(string_data.min, StringStatsData::MAX_STRING_MINMAX_SIZE);
|
122
|
-
reader.ReadBlob(string_data.max, StringStatsData::MAX_STRING_MINMAX_SIZE);
|
123
|
-
string_data.has_unicode = reader.ReadRequired<bool>();
|
124
|
-
string_data.has_max_string_length = reader.ReadRequired<bool>();
|
125
|
-
string_data.max_string_length = reader.ReadRequired<uint32_t>();
|
126
|
-
return result;
|
127
|
-
}
|
128
|
-
|
129
|
-
BaseStatistics StringStats::FormatDeserialize(FormatDeserializer &deserializer, LogicalType type) {
|
130
|
-
BaseStatistics result(std::move(type));
|
131
|
-
auto &string_data = StringStats::GetDataUnsafe(result);
|
108
|
+
void StringStats::Deserialize(Deserializer &deserializer, BaseStatistics &base) {
|
109
|
+
auto &string_data = StringStats::GetDataUnsafe(base);
|
132
110
|
deserializer.ReadProperty(200, "min", string_data.min, StringStatsData::MAX_STRING_MINMAX_SIZE);
|
133
111
|
deserializer.ReadProperty(201, "max", string_data.max, StringStatsData::MAX_STRING_MINMAX_SIZE);
|
134
112
|
deserializer.ReadProperty(202, "has_unicode", string_data.has_unicode);
|
135
113
|
deserializer.ReadProperty(203, "has_max_string_length", string_data.has_max_string_length);
|
136
114
|
deserializer.ReadProperty(204, "max_string_length", string_data.max_string_length);
|
137
|
-
return result;
|
138
115
|
}
|
139
116
|
|
140
117
|
static int StringValueComparison(const_data_ptr_t data, idx_t len, const_data_ptr_t comparison) {
|
@@ -1,10 +1,9 @@
|
|
1
1
|
#include "duckdb/storage/statistics/struct_stats.hpp"
|
2
2
|
#include "duckdb/storage/statistics/base_statistics.hpp"
|
3
|
-
#include "duckdb/common/field_writer.hpp"
|
4
3
|
#include "duckdb/common/types/vector.hpp"
|
5
4
|
|
6
|
-
#include "duckdb/common/serializer/
|
7
|
-
#include "duckdb/common/serializer/
|
5
|
+
#include "duckdb/common/serializer/serializer.hpp"
|
6
|
+
#include "duckdb/common/serializer/deserializer.hpp"
|
8
7
|
|
9
8
|
namespace duckdb {
|
10
9
|
|
@@ -93,47 +92,26 @@ void StructStats::Merge(BaseStatistics &stats, const BaseStatistics &other) {
|
|
93
92
|
}
|
94
93
|
}
|
95
94
|
|
96
|
-
void StructStats::Serialize(const BaseStatistics &stats,
|
97
|
-
auto child_stats = StructStats::GetChildStats(stats);
|
98
|
-
auto child_count = StructType::GetChildCount(stats.GetType());
|
99
|
-
for (idx_t i = 0; i < child_count; i++) {
|
100
|
-
writer.WriteSerializable(child_stats[i]);
|
101
|
-
}
|
102
|
-
}
|
103
|
-
|
104
|
-
BaseStatistics StructStats::Deserialize(FieldReader &reader, LogicalType type) {
|
105
|
-
D_ASSERT(type.InternalType() == PhysicalType::STRUCT);
|
106
|
-
auto &child_types = StructType::GetChildTypes(type);
|
107
|
-
BaseStatistics result(std::move(type));
|
108
|
-
for (idx_t i = 0; i < child_types.size(); i++) {
|
109
|
-
result.child_stats[i].Copy(
|
110
|
-
reader.ReadRequiredSerializable<BaseStatistics, BaseStatistics>(child_types[i].second));
|
111
|
-
}
|
112
|
-
return result;
|
113
|
-
}
|
114
|
-
|
115
|
-
void StructStats::FormatSerialize(const BaseStatistics &stats, FormatSerializer &serializer) {
|
95
|
+
void StructStats::Serialize(const BaseStatistics &stats, Serializer &serializer) {
|
116
96
|
auto child_stats = StructStats::GetChildStats(stats);
|
117
97
|
auto child_count = StructType::GetChildCount(stats.GetType());
|
118
98
|
|
119
99
|
serializer.WriteList(200, "child_stats", child_count,
|
120
|
-
[&](
|
100
|
+
[&](Serializer::List &list, idx_t i) { list.WriteElement(child_stats[i]); });
|
121
101
|
}
|
122
102
|
|
123
|
-
|
103
|
+
void StructStats::Deserialize(Deserializer &deserializer, BaseStatistics &base) {
|
104
|
+
auto &type = base.GetType();
|
124
105
|
D_ASSERT(type.InternalType() == PhysicalType::STRUCT);
|
125
106
|
|
126
107
|
auto &child_types = StructType::GetChildTypes(type);
|
127
|
-
BaseStatistics result(std::move(type));
|
128
108
|
|
129
|
-
deserializer.ReadList(200, "child_stats", [&](
|
109
|
+
deserializer.ReadList(200, "child_stats", [&](Deserializer::List &list, idx_t i) {
|
130
110
|
deserializer.Set<LogicalType &>(const_cast<LogicalType &>(child_types[i].second));
|
131
111
|
auto stat = list.ReadElement<BaseStatistics>();
|
132
|
-
|
112
|
+
base.child_stats[i].Copy(stat);
|
133
113
|
deserializer.Unset<LogicalType>();
|
134
114
|
});
|
135
|
-
|
136
|
-
return result;
|
137
115
|
}
|
138
116
|
|
139
117
|
string StructStats::ToString(const BaseStatistics &stats) {
|