duckdb 0.8.2-dev1862.0 → 0.8.2-dev2044.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 +9 -9
- package/package.json +1 -1
- package/src/duckdb/src/catalog/catalog.cpp +1 -1
- package/src/duckdb/src/catalog/catalog_entry/index_catalog_entry.cpp +17 -41
- package/src/duckdb/src/catalog/catalog_entry/macro_catalog_entry.cpp +2 -10
- package/src/duckdb/src/catalog/catalog_entry/schema_catalog_entry.cpp +4 -14
- package/src/duckdb/src/catalog/catalog_entry/sequence_catalog_entry.cpp +11 -28
- package/src/duckdb/src/catalog/catalog_entry/table_catalog_entry.cpp +11 -38
- package/src/duckdb/src/catalog/catalog_entry/view_catalog_entry.cpp +11 -27
- package/src/duckdb/src/catalog/catalog_entry.cpp +25 -1
- package/src/duckdb/src/common/enum_util.cpp +187 -0
- package/src/duckdb/src/common/extra_type_info.cpp +1 -2
- package/src/duckdb/src/common/serializer/binary_deserializer.cpp +3 -0
- package/src/duckdb/src/common/serializer/binary_serializer.cpp +4 -4
- package/src/duckdb/src/common/types/column/column_data_collection.cpp +43 -0
- package/src/duckdb/src/common/types/hugeint.cpp +40 -0
- package/src/duckdb/src/common/types/vector.cpp +1 -1
- package/src/duckdb/src/common/types.cpp +0 -12
- package/src/duckdb/src/core_functions/function_list.cpp +1 -0
- package/src/duckdb/src/core_functions/scalar/string/to_base.cpp +66 -0
- package/src/duckdb/src/execution/operator/aggregate/physical_hash_aggregate.cpp +14 -11
- package/src/duckdb/src/execution/operator/aggregate/physical_perfecthash_aggregate.cpp +6 -4
- package/src/duckdb/src/execution/operator/aggregate/physical_ungrouped_aggregate.cpp +14 -12
- package/src/duckdb/src/execution/operator/aggregate/physical_window.cpp +6 -4
- package/src/duckdb/src/execution/operator/helper/physical_batch_collector.cpp +8 -6
- package/src/duckdb/src/execution/operator/helper/physical_explain_analyze.cpp +2 -2
- package/src/duckdb/src/execution/operator/helper/physical_limit.cpp +5 -3
- package/src/duckdb/src/execution/operator/helper/physical_materialized_collector.cpp +7 -5
- package/src/duckdb/src/execution/operator/helper/physical_vacuum.cpp +7 -5
- package/src/duckdb/src/execution/operator/join/physical_asof_join.cpp +5 -4
- package/src/duckdb/src/execution/operator/join/physical_blockwise_nl_join.cpp +2 -2
- package/src/duckdb/src/execution/operator/join/physical_delim_join.cpp +13 -6
- package/src/duckdb/src/execution/operator/join/physical_hash_join.cpp +7 -5
- package/src/duckdb/src/execution/operator/join/physical_iejoin.cpp +7 -5
- package/src/duckdb/src/execution/operator/join/physical_nested_loop_join.cpp +7 -4
- package/src/duckdb/src/execution/operator/join/physical_piecewise_merge_join.cpp +8 -6
- package/src/duckdb/src/execution/operator/order/physical_order.cpp +7 -5
- package/src/duckdb/src/execution/operator/order/physical_top_n.cpp +7 -5
- package/src/duckdb/src/execution/operator/persistent/physical_batch_copy_to_file.cpp +8 -6
- package/src/duckdb/src/execution/operator/persistent/physical_batch_insert.cpp +8 -7
- package/src/duckdb/src/execution/operator/persistent/physical_copy_to_file.cpp +8 -6
- package/src/duckdb/src/execution/operator/persistent/physical_fixed_batch_copy.cpp +11 -9
- package/src/duckdb/src/execution/operator/persistent/physical_insert.cpp +10 -10
- package/src/duckdb/src/execution/operator/persistent/physical_update.cpp +4 -2
- package/src/duckdb/src/execution/operator/schema/physical_create_index.cpp +7 -6
- package/src/duckdb/src/execution/physical_operator.cpp +3 -2
- package/src/duckdb/src/execution/physical_plan/plan_comparison_join.cpp +1 -1
- package/src/duckdb/src/function/table/version/pragma_version.cpp +2 -2
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/index_catalog_entry.hpp +1 -2
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/macro_catalog_entry.hpp +1 -4
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/schema_catalog_entry.hpp +2 -5
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/sequence_catalog_entry.hpp +1 -6
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/table_catalog_entry.hpp +2 -11
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry/view_catalog_entry.hpp +2 -5
- package/src/duckdb/src/include/duckdb/catalog/catalog_entry.hpp +14 -0
- package/src/duckdb/src/include/duckdb/common/bitpacking.hpp +70 -55
- package/src/duckdb/src/include/duckdb/common/constants.hpp +2 -0
- package/src/duckdb/src/include/duckdb/common/enum_util.hpp +40 -0
- package/src/duckdb/src/include/duckdb/common/enums/index_type.hpp +1 -1
- package/src/duckdb/src/include/duckdb/common/enums/operator_result_type.hpp +5 -1
- package/src/duckdb/src/include/duckdb/common/hugeint.hpp +15 -0
- package/src/duckdb/src/include/duckdb/common/index_vector.hpp +12 -0
- package/src/duckdb/src/include/duckdb/common/limits.hpp +52 -149
- package/src/duckdb/src/include/duckdb/common/numeric_utils.hpp +48 -0
- package/src/duckdb/src/include/duckdb/common/serializer/binary_deserializer.hpp +28 -4
- package/src/duckdb/src/include/duckdb/common/serializer/binary_serializer.hpp +12 -5
- package/src/duckdb/src/include/duckdb/common/serializer/deserialization_data.hpp +110 -0
- package/src/duckdb/src/include/duckdb/common/serializer/format_deserializer.hpp +46 -1
- package/src/duckdb/src/include/duckdb/common/serializer/format_serializer.hpp +23 -21
- package/src/duckdb/src/include/duckdb/common/serializer/serialization_traits.hpp +12 -4
- package/src/duckdb/src/include/duckdb/common/types/column/column_data_collection.hpp +3 -0
- package/src/duckdb/src/include/duckdb/core_functions/aggregate/distributive_functions.hpp +1 -1
- package/src/duckdb/src/include/duckdb/core_functions/scalar/operators_functions.hpp +1 -1
- package/src/duckdb/src/include/duckdb/core_functions/scalar/string_functions.hpp +9 -0
- package/src/duckdb/src/include/duckdb/execution/operator/aggregate/physical_hash_aggregate.hpp +3 -3
- package/src/duckdb/src/include/duckdb/execution/operator/aggregate/physical_perfecthash_aggregate.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/aggregate/physical_ungrouped_aggregate.hpp +3 -3
- package/src/duckdb/src/include/duckdb/execution/operator/aggregate/physical_window.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_batch_collector.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_explain_analyze.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_limit.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_materialized_collector.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_vacuum.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_asof_join.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_blockwise_nl_join.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_delim_join.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_hash_join.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_iejoin.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_nested_loop_join.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/join/physical_piecewise_merge_join.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/order/physical_order.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/order/physical_top_n.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_batch_copy_to_file.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_batch_insert.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_copy_to_file.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_fixed_batch_copy.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_insert.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_update.hpp +1 -1
- package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_create_index.hpp +2 -2
- package/src/duckdb/src/include/duckdb/execution/physical_operator.hpp +3 -3
- package/src/duckdb/src/include/duckdb/execution/physical_operator_states.hpp +11 -0
- package/src/duckdb/src/include/duckdb/function/macro_function.hpp +3 -0
- package/src/duckdb/src/include/duckdb/function/scalar_macro_function.hpp +3 -0
- package/src/duckdb/src/include/duckdb/function/table_macro_function.hpp +3 -0
- package/src/duckdb/src/include/duckdb/main/extension_entries.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parallel/pipeline.hpp +0 -3
- package/src/duckdb/src/include/duckdb/parallel/pipeline_executor.hpp +3 -2
- package/src/duckdb/src/include/duckdb/parser/column_definition.hpp +6 -5
- package/src/duckdb/src/include/duckdb/parser/column_list.hpp +4 -0
- package/src/duckdb/src/include/duckdb/parser/constraint.hpp +5 -0
- package/src/duckdb/src/include/duckdb/parser/constraints/check_constraint.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/constraints/foreign_key_constraint.hpp +6 -0
- package/src/duckdb/src/include/duckdb/parser/constraints/not_null_constraint.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/constraints/unique_constraint.hpp +6 -0
- package/src/duckdb/src/include/duckdb/parser/expression/between_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/case_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/cast_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/collate_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/columnref_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/comparison_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/conjunction_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/constant_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/default_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/function_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/lambda_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/operator_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/parameter_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/positional_reference_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/star_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/subquery_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/expression/window_expression.hpp +1 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/alter_info.hpp +12 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/alter_table_info.hpp +66 -2
- package/src/duckdb/src/include/duckdb/parser/parsed_data/attach_info.hpp +8 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/copy_info.hpp +8 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_index_info.hpp +4 -1
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_info.hpp +9 -2
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_macro_info.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_schema_info.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_sequence_info.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_table_info.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_type_info.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/create_view_info.hpp +3 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/detach_info.hpp +7 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/drop_info.hpp +7 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/exported_table_data.hpp +7 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/load_info.hpp +13 -3
- package/src/duckdb/src/include/duckdb/parser/parsed_data/parse_info.hpp +22 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/pragma_info.hpp +10 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/show_select_info.hpp +7 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/transaction_info.hpp +10 -0
- package/src/duckdb/src/include/duckdb/parser/parsed_data/vacuum_info.hpp +10 -0
- package/src/duckdb/src/include/duckdb/planner/bound_constraint.hpp +0 -8
- package/src/duckdb/src/include/duckdb/planner/bound_result_modifier.hpp +6 -0
- package/src/duckdb/src/include/duckdb/planner/column_binding.hpp +5 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_between_expression.hpp +6 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_case_expression.hpp +6 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_cast_expression.hpp +6 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_columnref_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_comparison_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_conjunction_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_constant_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_default_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_lambda_expression.hpp +3 -1
- package/src/duckdb/src/include/duckdb/planner/expression/bound_lambdaref_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_operator_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_parameter_data.hpp +5 -2
- package/src/duckdb/src/include/duckdb/planner/expression/bound_parameter_expression.hpp +7 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_reference_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/expression/bound_unnest_expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/expression/list.hpp +1 -0
- package/src/duckdb/src/include/duckdb/planner/expression.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/joinside.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/logical_operator.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_aggregate.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_any_join.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_column_data_get.hpp +4 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_comparison_join.hpp +9 -2
- package/src/duckdb/src/include/duckdb/planner/operator/logical_create.hpp +9 -6
- package/src/duckdb/src/include/duckdb/planner/operator/logical_create_index.hpp +2 -16
- package/src/duckdb/src/include/duckdb/planner/operator/logical_create_table.hpp +10 -6
- package/src/duckdb/src/include/duckdb/planner/operator/logical_cross_product.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_cteref.hpp +2 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_delete.hpp +7 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_delim_get.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_distinct.hpp +6 -10
- package/src/duckdb/src/include/duckdb/planner/operator/logical_dummy_scan.hpp +2 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_empty_result.hpp +2 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_explain.hpp +4 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_expression_get.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_filter.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_insert.hpp +6 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_limit.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_limit_percent.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_materialized_cte.hpp +5 -2
- package/src/duckdb/src/include/duckdb/planner/operator/logical_order.hpp +7 -35
- package/src/duckdb/src/include/duckdb/planner/operator/logical_pivot.hpp +6 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_positional_join.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_projection.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_recursive_cte.hpp +5 -3
- package/src/duckdb/src/include/duckdb/planner/operator/logical_reset.hpp +4 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_sample.hpp +6 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_set.hpp +4 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_set_operation.hpp +4 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_show.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_simple.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_top_n.hpp +4 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_unnest.hpp +2 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_update.hpp +6 -0
- package/src/duckdb/src/include/duckdb/planner/operator/logical_window.hpp +3 -0
- package/src/duckdb/src/include/duckdb/planner/tableref/bound_pivotref.hpp +3 -0
- package/src/duckdb/src/main/relation/join_relation.cpp +1 -1
- package/src/duckdb/src/optimizer/deliminator.cpp +5 -3
- package/src/duckdb/src/parallel/pipeline.cpp +0 -17
- package/src/duckdb/src/parallel/pipeline_executor.cpp +26 -7
- package/src/duckdb/src/parallel/pipeline_finish_event.cpp +55 -1
- package/src/duckdb/src/parser/column_definition.cpp +20 -32
- package/src/duckdb/src/parser/column_list.cpp +8 -0
- package/src/duckdb/src/parser/constraints/foreign_key_constraint.cpp +3 -0
- package/src/duckdb/src/parser/constraints/unique_constraint.cpp +3 -0
- package/src/duckdb/src/parser/expression/case_expression.cpp +0 -12
- package/src/duckdb/src/parser/parsed_data/alter_info.cpp +5 -2
- package/src/duckdb/src/parser/parsed_data/alter_table_info.cpp +38 -0
- package/src/duckdb/src/parser/parsed_data/create_index_info.cpp +3 -1
- package/src/duckdb/src/parser/parsed_data/create_sequence_info.cpp +2 -0
- package/src/duckdb/src/parser/parsed_data/detach_info.cpp +1 -1
- package/src/duckdb/src/parser/parsed_data/drop_info.cpp +1 -1
- package/src/duckdb/src/parser/parsed_data/sample_options.cpp +0 -18
- package/src/duckdb/src/parser/parsed_data/transaction_info.cpp +4 -1
- package/src/duckdb/src/parser/parsed_data/vacuum_info.cpp +1 -1
- package/src/duckdb/src/parser/query_node.cpp +0 -10
- package/src/duckdb/src/parser/result_modifier.cpp +0 -13
- package/src/duckdb/src/parser/statement/select_statement.cpp +0 -10
- package/src/duckdb/src/parser/tableref/pivotref.cpp +0 -16
- package/src/duckdb/src/parser/transform/statement/transform_create_index.cpp +5 -4
- package/src/duckdb/src/planner/binder/query_node/plan_subquery.cpp +1 -1
- package/src/duckdb/src/planner/binder/statement/bind_create.cpp +6 -1
- package/src/duckdb/src/planner/binder/tableref/bind_basetableref.cpp +13 -3
- package/src/duckdb/src/planner/expression/bound_between_expression.cpp +4 -0
- package/src/duckdb/src/planner/expression/bound_cast_expression.cpp +13 -6
- package/src/duckdb/src/planner/expression/bound_parameter_expression.cpp +20 -12
- package/src/duckdb/src/planner/logical_operator.cpp +13 -1
- package/src/duckdb/src/planner/operator/logical_comparison_join.cpp +16 -2
- package/src/duckdb/src/planner/operator/logical_create.cpp +14 -0
- package/src/duckdb/src/planner/operator/logical_create_index.cpp +20 -0
- package/src/duckdb/src/planner/operator/logical_create_table.cpp +16 -0
- package/src/duckdb/src/planner/operator/logical_delete.cpp +9 -2
- package/src/duckdb/src/planner/operator/logical_delim_join.cpp +2 -4
- package/src/duckdb/src/planner/operator/logical_distinct.cpp +13 -0
- package/src/duckdb/src/planner/operator/logical_explain.cpp +1 -1
- package/src/duckdb/src/planner/operator/logical_insert.cpp +8 -2
- package/src/duckdb/src/planner/operator/logical_materialized_cte.cpp +3 -2
- package/src/duckdb/src/planner/operator/logical_order.cpp +39 -0
- package/src/duckdb/src/planner/operator/logical_pivot.cpp +3 -0
- package/src/duckdb/src/planner/operator/logical_recursive_cte.cpp +5 -5
- package/src/duckdb/src/planner/operator/logical_sample.cpp +3 -0
- package/src/duckdb/src/planner/operator/logical_update.cpp +8 -2
- package/src/duckdb/src/planner/parsed_data/bound_create_table_info.cpp +4 -2
- package/src/duckdb/src/planner/planner.cpp +11 -0
- package/src/duckdb/src/storage/checkpoint_manager.cpp +23 -23
- package/src/duckdb/src/storage/compression/bitpacking.cpp +87 -63
- package/src/duckdb/src/storage/compression/bitpacking_hugeint.cpp +295 -0
- package/src/duckdb/src/storage/serialization/serialize_constraint.cpp +98 -0
- package/src/duckdb/src/storage/serialization/serialize_create_info.cpp +188 -0
- package/src/duckdb/src/storage/serialization/serialize_expression.cpp +274 -0
- package/src/duckdb/src/storage/serialization/serialize_logical_operator.cpp +729 -0
- package/src/duckdb/src/storage/serialization/serialize_macro_function.cpp +62 -0
- package/src/duckdb/src/storage/serialization/serialize_nodes.cpp +242 -0
- package/src/duckdb/src/storage/serialization/serialize_parse_info.cpp +419 -0
- package/src/duckdb/src/storage/serialization/serialize_parsed_expression.cpp +40 -38
- package/src/duckdb/src/storage/serialization/serialize_query_node.cpp +36 -36
- package/src/duckdb/src/storage/serialization/serialize_result_modifier.cpp +25 -14
- package/src/duckdb/src/storage/serialization/serialize_statement.cpp +22 -0
- package/src/duckdb/src/storage/serialization/serialize_tableref.cpp +47 -47
- package/src/duckdb/src/storage/serialization/serialize_types.cpp +25 -25
- package/src/duckdb/src/storage/storage_info.cpp +3 -2
- package/src/duckdb/src/storage/wal_replay.cpp +20 -19
- package/src/duckdb/ub_extension_icu_third_party_icu_i18n.cpp +6 -6
- package/src/duckdb/ub_src_core_functions_scalar_string.cpp +2 -0
- package/src/duckdb/ub_src_parser.cpp +0 -2
- package/src/duckdb/ub_src_storage_compression.cpp +2 -0
- package/src/duckdb/ub_src_storage_serialization.cpp +16 -0
- package/src/duckdb/src/parser/common_table_expression_info.cpp +0 -21
@@ -8,8 +8,11 @@
|
|
8
8
|
|
9
9
|
#pragma once
|
10
10
|
|
11
|
+
#include "duckdb/common/hugeint.hpp"
|
11
12
|
#include "duckdb/common/types.hpp"
|
12
13
|
|
14
|
+
#include <type_traits>
|
15
|
+
|
13
16
|
// Undef annoying windows macro
|
14
17
|
#undef max
|
15
18
|
|
@@ -21,75 +24,16 @@ template <class T>
|
|
21
24
|
struct NumericLimits {
|
22
25
|
static constexpr T Minimum() {
|
23
26
|
return std::numeric_limits<T>::lowest();
|
24
|
-
}
|
27
|
+
}
|
25
28
|
static constexpr T Maximum() {
|
26
29
|
return std::numeric_limits<T>::max();
|
27
|
-
};
|
28
|
-
DUCKDB_API static bool IsSigned();
|
29
|
-
DUCKDB_API static idx_t Digits();
|
30
|
-
};
|
31
|
-
|
32
|
-
template <>
|
33
|
-
struct NumericLimits<int8_t> {
|
34
|
-
static constexpr int8_t Minimum() {
|
35
|
-
return std::numeric_limits<int8_t>::lowest();
|
36
|
-
};
|
37
|
-
static constexpr int8_t Maximum() {
|
38
|
-
return std::numeric_limits<int8_t>::max();
|
39
|
-
};
|
40
|
-
static bool IsSigned() {
|
41
|
-
return true;
|
42
|
-
}
|
43
|
-
static idx_t Digits() {
|
44
|
-
return 3;
|
45
|
-
}
|
46
|
-
};
|
47
|
-
template <>
|
48
|
-
struct NumericLimits<int16_t> {
|
49
|
-
static constexpr int16_t Minimum() {
|
50
|
-
return std::numeric_limits<int16_t>::lowest();
|
51
|
-
};
|
52
|
-
static constexpr int16_t Maximum() {
|
53
|
-
return std::numeric_limits<int16_t>::max();
|
54
|
-
};
|
55
|
-
static bool IsSigned() {
|
56
|
-
return true;
|
57
|
-
}
|
58
|
-
static idx_t Digits() {
|
59
|
-
return 5;
|
60
|
-
}
|
61
|
-
};
|
62
|
-
template <>
|
63
|
-
struct NumericLimits<int32_t> {
|
64
|
-
static constexpr int32_t Minimum() {
|
65
|
-
return std::numeric_limits<int32_t>::lowest();
|
66
|
-
};
|
67
|
-
static constexpr int32_t Maximum() {
|
68
|
-
return std::numeric_limits<int32_t>::max();
|
69
|
-
};
|
70
|
-
static bool IsSigned() {
|
71
|
-
return true;
|
72
30
|
}
|
73
|
-
static
|
74
|
-
return
|
31
|
+
DUCKDB_API static constexpr bool IsSigned() {
|
32
|
+
return std::is_signed<T>::value;
|
75
33
|
}
|
34
|
+
DUCKDB_API static constexpr idx_t Digits();
|
76
35
|
};
|
77
36
|
|
78
|
-
template <>
|
79
|
-
struct NumericLimits<int64_t> {
|
80
|
-
static constexpr int64_t Minimum() {
|
81
|
-
return std::numeric_limits<int64_t>::lowest();
|
82
|
-
};
|
83
|
-
static constexpr int64_t Maximum() {
|
84
|
-
return std::numeric_limits<int64_t>::max();
|
85
|
-
};
|
86
|
-
static bool IsSigned() {
|
87
|
-
return true;
|
88
|
-
}
|
89
|
-
static idx_t Digits() {
|
90
|
-
return 19;
|
91
|
-
}
|
92
|
-
};
|
93
37
|
template <>
|
94
38
|
struct NumericLimits<hugeint_t> {
|
95
39
|
static constexpr hugeint_t Minimum() {
|
@@ -98,104 +42,63 @@ struct NumericLimits<hugeint_t> {
|
|
98
42
|
static constexpr hugeint_t Maximum() {
|
99
43
|
return {std::numeric_limits<int64_t>::max(), std::numeric_limits<uint64_t>::max()};
|
100
44
|
};
|
101
|
-
static bool IsSigned() {
|
45
|
+
static constexpr bool IsSigned() {
|
102
46
|
return true;
|
103
47
|
}
|
104
|
-
|
48
|
+
|
49
|
+
static constexpr idx_t Digits() {
|
105
50
|
return 39;
|
106
51
|
}
|
107
52
|
};
|
108
53
|
|
109
54
|
template <>
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
};
|
114
|
-
static constexpr uint8_t Maximum() {
|
115
|
-
return std::numeric_limits<uint8_t>::max();
|
116
|
-
};
|
117
|
-
static bool IsSigned() {
|
118
|
-
return false;
|
119
|
-
}
|
120
|
-
static idx_t Digits() {
|
121
|
-
return 3;
|
122
|
-
}
|
123
|
-
};
|
55
|
+
constexpr idx_t NumericLimits<int8_t>::Digits() {
|
56
|
+
return 3;
|
57
|
+
}
|
124
58
|
|
125
59
|
template <>
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
static constexpr uint16_t Maximum() {
|
131
|
-
return std::numeric_limits<uint16_t>::max();
|
132
|
-
};
|
133
|
-
static bool IsSigned() {
|
134
|
-
return false;
|
135
|
-
}
|
136
|
-
static idx_t Digits() {
|
137
|
-
return 5;
|
138
|
-
}
|
139
|
-
};
|
60
|
+
constexpr idx_t NumericLimits<int16_t>::Digits() {
|
61
|
+
return 5;
|
62
|
+
}
|
63
|
+
|
140
64
|
template <>
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
static constexpr uint32_t Maximum() {
|
146
|
-
return std::numeric_limits<uint32_t>::max();
|
147
|
-
};
|
148
|
-
static bool IsSigned() {
|
149
|
-
return false;
|
150
|
-
}
|
151
|
-
static idx_t Digits() {
|
152
|
-
return 10;
|
153
|
-
}
|
154
|
-
};
|
65
|
+
constexpr idx_t NumericLimits<int32_t>::Digits() {
|
66
|
+
return 10;
|
67
|
+
}
|
68
|
+
|
155
69
|
template <>
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
static constexpr uint64_t Maximum() {
|
161
|
-
return std::numeric_limits<uint64_t>::max();
|
162
|
-
};
|
163
|
-
static bool IsSigned() {
|
164
|
-
return false;
|
165
|
-
}
|
166
|
-
static idx_t Digits() {
|
167
|
-
return 20;
|
168
|
-
}
|
169
|
-
};
|
70
|
+
constexpr idx_t NumericLimits<int64_t>::Digits() {
|
71
|
+
return 19;
|
72
|
+
}
|
73
|
+
|
170
74
|
template <>
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
static constexpr float Maximum() {
|
176
|
-
return std::numeric_limits<float>::max();
|
177
|
-
};
|
178
|
-
static bool IsSigned() {
|
179
|
-
return true;
|
180
|
-
}
|
181
|
-
static idx_t Digits() {
|
182
|
-
return 127;
|
183
|
-
}
|
184
|
-
};
|
75
|
+
constexpr idx_t NumericLimits<uint8_t>::Digits() {
|
76
|
+
return 3;
|
77
|
+
}
|
78
|
+
|
185
79
|
template <>
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
80
|
+
constexpr idx_t NumericLimits<uint16_t>::Digits() {
|
81
|
+
return 5;
|
82
|
+
}
|
83
|
+
|
84
|
+
template <>
|
85
|
+
constexpr idx_t NumericLimits<uint32_t>::Digits() {
|
86
|
+
return 10;
|
87
|
+
}
|
88
|
+
|
89
|
+
template <>
|
90
|
+
constexpr idx_t NumericLimits<uint64_t>::Digits() {
|
91
|
+
return 20;
|
92
|
+
}
|
93
|
+
|
94
|
+
template <>
|
95
|
+
constexpr idx_t NumericLimits<float>::Digits() {
|
96
|
+
return 127;
|
97
|
+
}
|
98
|
+
|
99
|
+
template <>
|
100
|
+
constexpr idx_t NumericLimits<double>::Digits() {
|
101
|
+
return 250;
|
102
|
+
}
|
200
103
|
|
201
104
|
} // namespace duckdb
|
@@ -0,0 +1,48 @@
|
|
1
|
+
//===----------------------------------------------------------------------===//
|
2
|
+
// DuckDB
|
3
|
+
//
|
4
|
+
// duckdb/common/numeric_utils.hpp
|
5
|
+
//
|
6
|
+
//
|
7
|
+
//===----------------------------------------------------------------------===//
|
8
|
+
|
9
|
+
#pragma once
|
10
|
+
|
11
|
+
#include <type_traits>
|
12
|
+
#include "duckdb/common/hugeint.hpp"
|
13
|
+
|
14
|
+
namespace duckdb {
|
15
|
+
|
16
|
+
template <class T>
|
17
|
+
struct MakeSigned {
|
18
|
+
using type = typename std::make_signed<T>::type;
|
19
|
+
};
|
20
|
+
|
21
|
+
template <>
|
22
|
+
struct MakeSigned<hugeint_t> {
|
23
|
+
using type = hugeint_t;
|
24
|
+
};
|
25
|
+
|
26
|
+
template <class T>
|
27
|
+
struct MakeUnsigned {
|
28
|
+
using type = typename std::make_unsigned<T>::type;
|
29
|
+
};
|
30
|
+
|
31
|
+
// hugeint_t does not actually have an unsigned variant (yet), but this is required to make compression work
|
32
|
+
// if an unsigned variant gets implemented this (probably) can be changed without breaking anything
|
33
|
+
template <>
|
34
|
+
struct MakeUnsigned<hugeint_t> {
|
35
|
+
using type = hugeint_t;
|
36
|
+
};
|
37
|
+
|
38
|
+
template <class T>
|
39
|
+
struct IsIntegral {
|
40
|
+
static constexpr bool value = std::is_integral<T>::value;
|
41
|
+
};
|
42
|
+
|
43
|
+
template <>
|
44
|
+
struct IsIntegral<hugeint_t> {
|
45
|
+
static constexpr bool value = true;
|
46
|
+
};
|
47
|
+
|
48
|
+
} // namespace duckdb
|
@@ -1,17 +1,41 @@
|
|
1
|
+
//===----------------------------------------------------------------------===//
|
2
|
+
// DuckDB
|
3
|
+
//
|
4
|
+
// duckdb/common/serializer/binary_deserializer.hpp
|
5
|
+
//
|
6
|
+
//
|
7
|
+
//===----------------------------------------------------------------------===//
|
8
|
+
|
1
9
|
#pragma once
|
10
|
+
|
2
11
|
#include "duckdb/common/serializer/format_deserializer.hpp"
|
3
12
|
|
4
13
|
namespace duckdb {
|
14
|
+
class ClientContext;
|
5
15
|
|
6
16
|
class BinaryDeserializer : public FormatDeserializer {
|
7
17
|
public:
|
18
|
+
template <class T>
|
19
|
+
unique_ptr<T> Deserialize() {
|
20
|
+
OnObjectBegin();
|
21
|
+
auto result = T::FormatDeserialize(*this);
|
22
|
+
OnObjectEnd();
|
23
|
+
return result;
|
24
|
+
}
|
25
|
+
|
8
26
|
template <class T>
|
9
27
|
static unique_ptr<T> Deserialize(data_ptr_t ptr, idx_t length) {
|
10
28
|
BinaryDeserializer deserializer(ptr, length);
|
11
|
-
deserializer.
|
12
|
-
|
13
|
-
|
14
|
-
|
29
|
+
return deserializer.template Deserialize<T>();
|
30
|
+
}
|
31
|
+
|
32
|
+
template <class T>
|
33
|
+
static unique_ptr<T> Deserialize(ClientContext &context, bound_parameter_map_t ¶meters, data_ptr_t ptr,
|
34
|
+
idx_t length) {
|
35
|
+
BinaryDeserializer deserializer(ptr, length);
|
36
|
+
deserializer.Set<ClientContext &>(context);
|
37
|
+
deserializer.Set<bound_parameter_map_t &>(parameters);
|
38
|
+
return deserializer.template Deserialize<T>();
|
15
39
|
}
|
16
40
|
|
17
41
|
private:
|
@@ -1,3 +1,11 @@
|
|
1
|
+
//===----------------------------------------------------------------------===//
|
2
|
+
// DuckDB
|
3
|
+
//
|
4
|
+
// duckdb/common/serializer/binary_serializer.hpp
|
5
|
+
//
|
6
|
+
//
|
7
|
+
//===----------------------------------------------------------------------===//
|
8
|
+
|
1
9
|
#pragma once
|
2
10
|
|
3
11
|
#include "duckdb/common/serializer/format_serializer.hpp"
|
@@ -5,7 +13,6 @@
|
|
5
13
|
namespace duckdb {
|
6
14
|
|
7
15
|
struct BinarySerializer : public FormatSerializer {
|
8
|
-
|
9
16
|
private:
|
10
17
|
struct State {
|
11
18
|
// how many fields are present in the object
|
@@ -24,14 +31,14 @@ private:
|
|
24
31
|
template <class T>
|
25
32
|
void Write(T element) {
|
26
33
|
static_assert(std::is_trivially_destructible<T>(), "Write element must be trivially destructible");
|
27
|
-
|
34
|
+
WriteDataInternal(const_data_ptr_cast(&element), sizeof(T));
|
28
35
|
}
|
29
|
-
void
|
36
|
+
void WriteDataInternal(const_data_ptr_t buffer, idx_t write_size) {
|
30
37
|
data.insert(data.end(), buffer, buffer + write_size);
|
31
38
|
stack.back().size += write_size;
|
32
39
|
}
|
33
|
-
void
|
34
|
-
|
40
|
+
void WriteDataInternal(const char *ptr, idx_t write_size) {
|
41
|
+
WriteDataInternal(const_data_ptr_cast(ptr), write_size);
|
35
42
|
}
|
36
43
|
|
37
44
|
explicit BinarySerializer() {
|
@@ -0,0 +1,110 @@
|
|
1
|
+
//===----------------------------------------------------------------------===//
|
2
|
+
// DuckDB
|
3
|
+
//
|
4
|
+
// duckdb/common/serializer/deserialization_data.hpp
|
5
|
+
//
|
6
|
+
//
|
7
|
+
//===----------------------------------------------------------------------===//
|
8
|
+
|
9
|
+
#pragma once
|
10
|
+
|
11
|
+
#include "duckdb/common/common.hpp"
|
12
|
+
#include "duckdb/common/stack.hpp"
|
13
|
+
#include "duckdb/planner/bound_parameter_map.hpp"
|
14
|
+
|
15
|
+
namespace duckdb {
|
16
|
+
class ClientContext;
|
17
|
+
class Catalog;
|
18
|
+
enum class ExpressionType : uint8_t;
|
19
|
+
|
20
|
+
struct DeserializationData {
|
21
|
+
stack<reference<ClientContext>> contexts;
|
22
|
+
stack<idx_t> enums;
|
23
|
+
stack<reference<bound_parameter_map_t>> parameter_data;
|
24
|
+
|
25
|
+
template <class T>
|
26
|
+
void Set(T entry) = delete;
|
27
|
+
|
28
|
+
template <class T>
|
29
|
+
T Get() = delete;
|
30
|
+
|
31
|
+
template <class T>
|
32
|
+
void Unset() = delete;
|
33
|
+
|
34
|
+
template <class T>
|
35
|
+
inline void AssertNotEmpty(const stack<T> &e) {
|
36
|
+
if (e.empty()) {
|
37
|
+
throw InternalException("DeserializationData - unexpected empty stack");
|
38
|
+
}
|
39
|
+
}
|
40
|
+
};
|
41
|
+
|
42
|
+
template <>
|
43
|
+
inline void DeserializationData::Set(ExpressionType type) {
|
44
|
+
enums.push(idx_t(type));
|
45
|
+
}
|
46
|
+
|
47
|
+
template <>
|
48
|
+
inline ExpressionType DeserializationData::Get() {
|
49
|
+
AssertNotEmpty(enums);
|
50
|
+
return ExpressionType(enums.top());
|
51
|
+
}
|
52
|
+
|
53
|
+
template <>
|
54
|
+
inline void DeserializationData::Unset<ExpressionType>() {
|
55
|
+
AssertNotEmpty(enums);
|
56
|
+
enums.pop();
|
57
|
+
}
|
58
|
+
|
59
|
+
template <>
|
60
|
+
inline void DeserializationData::Set(LogicalOperatorType type) {
|
61
|
+
enums.push(idx_t(type));
|
62
|
+
}
|
63
|
+
|
64
|
+
template <>
|
65
|
+
inline LogicalOperatorType DeserializationData::Get() {
|
66
|
+
AssertNotEmpty(enums);
|
67
|
+
return LogicalOperatorType(enums.top());
|
68
|
+
}
|
69
|
+
|
70
|
+
template <>
|
71
|
+
inline void DeserializationData::Unset<LogicalOperatorType>() {
|
72
|
+
AssertNotEmpty(enums);
|
73
|
+
enums.pop();
|
74
|
+
}
|
75
|
+
|
76
|
+
template <>
|
77
|
+
inline void DeserializationData::Set(ClientContext &context) {
|
78
|
+
contexts.push(context);
|
79
|
+
}
|
80
|
+
|
81
|
+
template <>
|
82
|
+
inline ClientContext &DeserializationData::Get() {
|
83
|
+
AssertNotEmpty(contexts);
|
84
|
+
return contexts.top();
|
85
|
+
}
|
86
|
+
|
87
|
+
template <>
|
88
|
+
inline void DeserializationData::Unset<ClientContext>() {
|
89
|
+
AssertNotEmpty(contexts);
|
90
|
+
contexts.pop();
|
91
|
+
}
|
92
|
+
|
93
|
+
template <>
|
94
|
+
inline void DeserializationData::Set(bound_parameter_map_t &context) {
|
95
|
+
parameter_data.push(context);
|
96
|
+
}
|
97
|
+
|
98
|
+
template <>
|
99
|
+
inline bound_parameter_map_t &DeserializationData::Get() {
|
100
|
+
AssertNotEmpty(parameter_data);
|
101
|
+
return parameter_data.top();
|
102
|
+
}
|
103
|
+
|
104
|
+
template <>
|
105
|
+
inline void DeserializationData::Unset<bound_parameter_map_t>() {
|
106
|
+
AssertNotEmpty(parameter_data);
|
107
|
+
parameter_data.pop();
|
108
|
+
}
|
109
|
+
|
110
|
+
} // namespace duckdb
|
@@ -12,6 +12,7 @@
|
|
12
12
|
#include "duckdb/common/serializer.hpp"
|
13
13
|
#include "duckdb/common/enum_util.hpp"
|
14
14
|
#include "duckdb/common/serializer/serialization_traits.hpp"
|
15
|
+
#include "duckdb/common/serializer/deserialization_data.hpp"
|
15
16
|
#include "duckdb/common/types/interval.hpp"
|
16
17
|
#include "duckdb/common/types/string_type.hpp"
|
17
18
|
#include "duckdb/common/unordered_map.hpp"
|
@@ -24,6 +25,7 @@ class FormatDeserializer {
|
|
24
25
|
|
25
26
|
protected:
|
26
27
|
bool deserialize_enum_from_string = false;
|
28
|
+
DeserializationData data;
|
27
29
|
|
28
30
|
public:
|
29
31
|
// Read into an existing value
|
@@ -107,6 +109,24 @@ public:
|
|
107
109
|
ReadDataPtr(ret, count);
|
108
110
|
}
|
109
111
|
|
112
|
+
//! Set a serialization property
|
113
|
+
template <class T>
|
114
|
+
void Set(T entry) {
|
115
|
+
return data.Set<T>(entry);
|
116
|
+
}
|
117
|
+
|
118
|
+
//! Retrieve the last set serialization property of this type
|
119
|
+
template <class T>
|
120
|
+
T Get() {
|
121
|
+
return data.Get<T>();
|
122
|
+
}
|
123
|
+
|
124
|
+
//! Unset a serialization property
|
125
|
+
template <class T>
|
126
|
+
void Unset() {
|
127
|
+
return data.Unset<T>();
|
128
|
+
}
|
129
|
+
|
110
130
|
private:
|
111
131
|
// Deserialize anything implementing a FormatDeserialize method
|
112
132
|
template <typename T = void>
|
@@ -152,6 +172,19 @@ private:
|
|
152
172
|
return vec;
|
153
173
|
}
|
154
174
|
|
175
|
+
template <typename T = void>
|
176
|
+
inline typename std::enable_if<is_unsafe_vector<T>::value, T>::type Read() {
|
177
|
+
using ELEMENT_TYPE = typename is_unsafe_vector<T>::ELEMENT_TYPE;
|
178
|
+
T vec;
|
179
|
+
auto size = OnListBegin();
|
180
|
+
for (idx_t i = 0; i < size; i++) {
|
181
|
+
vec.push_back(Read<ELEMENT_TYPE>());
|
182
|
+
}
|
183
|
+
OnListEnd();
|
184
|
+
|
185
|
+
return vec;
|
186
|
+
}
|
187
|
+
|
155
188
|
// Deserialize a map
|
156
189
|
template <typename T = void>
|
157
190
|
inline typename std::enable_if<is_unordered_map<T>::value, T>::type Read() {
|
@@ -308,12 +341,24 @@ private:
|
|
308
341
|
return ReadInterval();
|
309
342
|
}
|
310
343
|
|
311
|
-
// Deserialize a
|
344
|
+
// Deserialize a hugeint_t
|
312
345
|
template <typename T = void>
|
313
346
|
inline typename std::enable_if<std::is_same<T, hugeint_t>::value, T>::type Read() {
|
314
347
|
return ReadHugeInt();
|
315
348
|
}
|
316
349
|
|
350
|
+
// Deserialize a LogicalIndex
|
351
|
+
template <typename T = void>
|
352
|
+
inline typename std::enable_if<std::is_same<T, LogicalIndex>::value, T>::type Read() {
|
353
|
+
return LogicalIndex(ReadUnsignedInt64());
|
354
|
+
}
|
355
|
+
|
356
|
+
// Deserialize a PhysicalIndex
|
357
|
+
template <typename T = void>
|
358
|
+
inline typename std::enable_if<std::is_same<T, PhysicalIndex>::value, T>::type Read() {
|
359
|
+
return PhysicalIndex(ReadUnsignedInt64());
|
360
|
+
}
|
361
|
+
|
317
362
|
protected:
|
318
363
|
virtual void SetTag(const char *tag) {
|
319
364
|
(void)tag;
|
@@ -28,7 +28,7 @@ protected:
|
|
28
28
|
public:
|
29
29
|
// Serialize a value
|
30
30
|
template <class T>
|
31
|
-
typename std::enable_if<!std::is_enum<T>::value, void>::type WriteProperty(const char *tag, T &value) {
|
31
|
+
typename std::enable_if<!std::is_enum<T>::value, void>::type WriteProperty(const char *tag, const T &value) {
|
32
32
|
SetTag(tag);
|
33
33
|
WriteValue(value);
|
34
34
|
}
|
@@ -48,22 +48,8 @@ public:
|
|
48
48
|
}
|
49
49
|
|
50
50
|
// Optional pointer
|
51
|
-
template <class
|
52
|
-
void WriteOptionalProperty(const char *tag,
|
53
|
-
SetTag(tag);
|
54
|
-
if (ptr == nullptr) {
|
55
|
-
OnOptionalBegin(false);
|
56
|
-
OnOptionalEnd(false);
|
57
|
-
} else {
|
58
|
-
OnOptionalBegin(true);
|
59
|
-
WriteValue(*ptr);
|
60
|
-
OnOptionalEnd(true);
|
61
|
-
}
|
62
|
-
}
|
63
|
-
|
64
|
-
// Optional unique_ptr
|
65
|
-
template <class T>
|
66
|
-
void WriteOptionalProperty(const char *tag, const unique_ptr<T> &ptr) {
|
51
|
+
template <class POINTER>
|
52
|
+
void WriteOptionalProperty(const char *tag, POINTER &&ptr) {
|
67
53
|
SetTag(tag);
|
68
54
|
if (ptr == nullptr) {
|
69
55
|
OnOptionalBegin(false);
|
@@ -122,10 +108,20 @@ protected:
|
|
122
108
|
OnListEnd(count);
|
123
109
|
}
|
124
110
|
|
111
|
+
template <class T>
|
112
|
+
void WriteValue(const unsafe_vector<T> &vec) {
|
113
|
+
auto count = vec.size();
|
114
|
+
OnListBegin(count);
|
115
|
+
for (auto &item : vec) {
|
116
|
+
WriteValue(item);
|
117
|
+
}
|
118
|
+
OnListEnd(count);
|
119
|
+
}
|
120
|
+
|
125
121
|
// UnorderedSet
|
126
122
|
// Serialized the same way as a list/vector
|
127
123
|
template <class T, class HASH, class CMP>
|
128
|
-
void WriteValue(const unordered_set<T, HASH, CMP> &set) {
|
124
|
+
void WriteValue(const duckdb::unordered_set<T, HASH, CMP> &set) {
|
129
125
|
auto count = set.size();
|
130
126
|
OnListBegin(count);
|
131
127
|
for (auto &item : set) {
|
@@ -137,7 +133,7 @@ protected:
|
|
137
133
|
// Set
|
138
134
|
// Serialized the same way as a list/vector
|
139
135
|
template <class T, class HASH, class CMP>
|
140
|
-
void WriteValue(const set<T, HASH, CMP> &set) {
|
136
|
+
void WriteValue(const duckdb::set<T, HASH, CMP> &set) {
|
141
137
|
auto count = set.size();
|
142
138
|
OnListBegin(count);
|
143
139
|
for (auto &item : set) {
|
@@ -148,7 +144,7 @@ protected:
|
|
148
144
|
|
149
145
|
// Map
|
150
146
|
template <class K, class V, class HASH, class CMP>
|
151
|
-
void WriteValue(const
|
147
|
+
void WriteValue(const duckdb::unordered_map<K, V, HASH, CMP> &map) {
|
152
148
|
auto count = map.size();
|
153
149
|
OnMapBegin(count);
|
154
150
|
for (auto &item : map) {
|
@@ -166,7 +162,7 @@ protected:
|
|
166
162
|
|
167
163
|
// class or struct implementing `FormatSerialize(FormatSerializer& FormatSerializer)`;
|
168
164
|
template <typename T>
|
169
|
-
typename std::enable_if<has_serialize<T>::value>::type WriteValue(T &value) {
|
165
|
+
typename std::enable_if<has_serialize<T>::value>::type WriteValue(const T &value) {
|
170
166
|
// Else, we defer to the .FormatSerialize method
|
171
167
|
OnObjectBegin();
|
172
168
|
value.FormatSerialize(*this);
|
@@ -243,6 +239,12 @@ protected:
|
|
243
239
|
virtual void WriteValue(const char *str) = 0;
|
244
240
|
virtual void WriteValue(interval_t value) = 0;
|
245
241
|
virtual void WriteDataPtr(const_data_ptr_t ptr, idx_t count) = 0;
|
242
|
+
void WriteValue(LogicalIndex value) {
|
243
|
+
WriteValue(value.index);
|
244
|
+
}
|
245
|
+
void WriteValue(PhysicalIndex value) {
|
246
|
+
WriteValue(value.index);
|
247
|
+
}
|
246
248
|
};
|
247
249
|
|
248
250
|
} // namespace duckdb
|