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,12 +1,11 @@
|
|
1
1
|
#include "duckdb/parser/expression/window_expression.hpp"
|
2
2
|
|
3
3
|
#include "duckdb/common/limits.hpp"
|
4
|
-
#include "duckdb/common/field_writer.hpp"
|
5
4
|
#include "duckdb/common/string_util.hpp"
|
6
5
|
|
7
6
|
#include "duckdb/common/enum_util.hpp"
|
8
|
-
#include "duckdb/common/serializer/
|
9
|
-
#include "duckdb/common/serializer/
|
7
|
+
#include "duckdb/common/serializer/serializer.hpp"
|
8
|
+
#include "duckdb/common/serializer/deserializer.hpp"
|
10
9
|
|
11
10
|
namespace duckdb {
|
12
11
|
|
@@ -137,54 +136,4 @@ unique_ptr<ParsedExpression> WindowExpression::Copy() const {
|
|
137
136
|
return std::move(new_window);
|
138
137
|
}
|
139
138
|
|
140
|
-
void WindowExpression::Serialize(FieldWriter &writer) const {
|
141
|
-
auto &serializer = writer.GetSerializer();
|
142
|
-
|
143
|
-
writer.WriteString(function_name);
|
144
|
-
writer.WriteString(schema);
|
145
|
-
writer.WriteSerializableList(children);
|
146
|
-
writer.WriteSerializableList(partitions);
|
147
|
-
// FIXME: should not use serializer here (probably)?
|
148
|
-
D_ASSERT(orders.size() <= NumericLimits<uint32_t>::Maximum());
|
149
|
-
writer.WriteField<uint32_t>((uint32_t)orders.size());
|
150
|
-
for (auto &order : orders) {
|
151
|
-
order.Serialize(serializer);
|
152
|
-
}
|
153
|
-
writer.WriteField<WindowBoundary>(start);
|
154
|
-
writer.WriteField<WindowBoundary>(end);
|
155
|
-
|
156
|
-
writer.WriteOptional(start_expr);
|
157
|
-
writer.WriteOptional(end_expr);
|
158
|
-
writer.WriteOptional(offset_expr);
|
159
|
-
writer.WriteOptional(default_expr);
|
160
|
-
writer.WriteField<bool>(ignore_nulls);
|
161
|
-
writer.WriteOptional(filter_expr);
|
162
|
-
writer.WriteString(catalog);
|
163
|
-
}
|
164
|
-
|
165
|
-
unique_ptr<ParsedExpression> WindowExpression::Deserialize(ExpressionType type, FieldReader &reader) {
|
166
|
-
auto function_name = reader.ReadRequired<string>();
|
167
|
-
auto schema = reader.ReadRequired<string>();
|
168
|
-
auto expr = make_uniq<WindowExpression>(type, INVALID_CATALOG, std::move(schema), function_name);
|
169
|
-
expr->children = reader.ReadRequiredSerializableList<ParsedExpression>();
|
170
|
-
expr->partitions = reader.ReadRequiredSerializableList<ParsedExpression>();
|
171
|
-
|
172
|
-
auto order_count = reader.ReadRequired<uint32_t>();
|
173
|
-
auto &source = reader.GetSource();
|
174
|
-
for (idx_t i = 0; i < order_count; i++) {
|
175
|
-
expr->orders.push_back(OrderByNode::Deserialize(source));
|
176
|
-
}
|
177
|
-
expr->start = reader.ReadRequired<WindowBoundary>();
|
178
|
-
expr->end = reader.ReadRequired<WindowBoundary>();
|
179
|
-
|
180
|
-
expr->start_expr = reader.ReadOptional<ParsedExpression>(nullptr);
|
181
|
-
expr->end_expr = reader.ReadOptional<ParsedExpression>(nullptr);
|
182
|
-
expr->offset_expr = reader.ReadOptional<ParsedExpression>(nullptr);
|
183
|
-
expr->default_expr = reader.ReadOptional<ParsedExpression>(nullptr);
|
184
|
-
expr->ignore_nulls = reader.ReadRequired<bool>();
|
185
|
-
expr->filter_expr = reader.ReadOptional<ParsedExpression>(nullptr);
|
186
|
-
expr->catalog = reader.ReadField<string>(INVALID_CATALOG);
|
187
|
-
return std::move(expr);
|
188
|
-
}
|
189
|
-
|
190
139
|
} // namespace duckdb
|
@@ -3,8 +3,6 @@
|
|
3
3
|
#include "duckdb/parser/parsed_data/alter_scalar_function_info.hpp"
|
4
4
|
#include "duckdb/parser/parsed_data/alter_table_function_info.hpp"
|
5
5
|
|
6
|
-
#include "duckdb/common/field_writer.hpp"
|
7
|
-
|
8
6
|
namespace duckdb {
|
9
7
|
|
10
8
|
AlterInfo::AlterInfo(AlterType type, string catalog_p, string schema_p, string name_p, OnEntryNotFound if_not_found)
|
@@ -18,39 +16,6 @@ AlterInfo::AlterInfo(AlterType type) : ParseInfo(TYPE), type(type) {
|
|
18
16
|
AlterInfo::~AlterInfo() {
|
19
17
|
}
|
20
18
|
|
21
|
-
void AlterInfo::Serialize(Serializer &serializer) const {
|
22
|
-
FieldWriter writer(serializer);
|
23
|
-
writer.WriteField<AlterType>(type);
|
24
|
-
Serialize(writer);
|
25
|
-
writer.Finalize();
|
26
|
-
}
|
27
|
-
|
28
|
-
unique_ptr<AlterInfo> AlterInfo::Deserialize(Deserializer &source) {
|
29
|
-
FieldReader reader(source);
|
30
|
-
auto type = reader.ReadRequired<AlterType>();
|
31
|
-
|
32
|
-
unique_ptr<AlterInfo> result;
|
33
|
-
switch (type) {
|
34
|
-
case AlterType::ALTER_TABLE:
|
35
|
-
result = AlterTableInfo::Deserialize(reader);
|
36
|
-
break;
|
37
|
-
case AlterType::ALTER_VIEW:
|
38
|
-
result = AlterViewInfo::Deserialize(reader);
|
39
|
-
break;
|
40
|
-
case AlterType::ALTER_SCALAR_FUNCTION:
|
41
|
-
result = AlterScalarFunctionInfo::Deserialize(reader);
|
42
|
-
break;
|
43
|
-
case AlterType::ALTER_TABLE_FUNCTION:
|
44
|
-
result = AlterTableFunctionInfo::Deserialize(reader);
|
45
|
-
break;
|
46
|
-
default:
|
47
|
-
throw SerializationException("Unknown alter type for deserialization!");
|
48
|
-
}
|
49
|
-
reader.Finalize();
|
50
|
-
|
51
|
-
return result;
|
52
|
-
}
|
53
|
-
|
54
19
|
AlterEntryData AlterInfo::GetAlterEntryData() const {
|
55
20
|
AlterEntryData data;
|
56
21
|
data.catalog = catalog;
|
@@ -1,6 +1,5 @@
|
|
1
1
|
#include "duckdb/parser/parsed_data/alter_scalar_function_info.hpp"
|
2
2
|
|
3
|
-
#include "duckdb/common/field_writer.hpp"
|
4
3
|
#include "duckdb/parser/constraint.hpp"
|
5
4
|
|
6
5
|
namespace duckdb {
|
@@ -20,23 +19,6 @@ CatalogType AlterScalarFunctionInfo::GetCatalogType() const {
|
|
20
19
|
return CatalogType::SCALAR_FUNCTION_ENTRY;
|
21
20
|
}
|
22
21
|
|
23
|
-
void AlterScalarFunctionInfo::Serialize(FieldWriter &writer) const {
|
24
|
-
writer.WriteField<AlterScalarFunctionType>(alter_scalar_function_type);
|
25
|
-
writer.WriteString(catalog);
|
26
|
-
writer.WriteString(schema);
|
27
|
-
writer.WriteString(name);
|
28
|
-
writer.WriteField(if_not_found);
|
29
|
-
}
|
30
|
-
|
31
|
-
unique_ptr<AlterInfo> AlterScalarFunctionInfo::Deserialize(FieldReader &reader) {
|
32
|
-
// auto type = reader.ReadRequired<AlterScalarFunctionType>();
|
33
|
-
// auto schema = reader.ReadRequired<string>();
|
34
|
-
// auto table = reader.ReadRequired<string>();
|
35
|
-
// auto if_exists = reader.ReadRequired<bool>();
|
36
|
-
|
37
|
-
throw NotImplementedException("AlterScalarFunctionInfo cannot be deserialized");
|
38
|
-
}
|
39
|
-
|
40
22
|
//===--------------------------------------------------------------------===//
|
41
23
|
// AddScalarFunctionOverloadInfo
|
42
24
|
//===--------------------------------------------------------------------===//
|
@@ -1,6 +1,5 @@
|
|
1
1
|
#include "duckdb/parser/parsed_data/alter_table_function_info.hpp"
|
2
2
|
|
3
|
-
#include "duckdb/common/field_writer.hpp"
|
4
3
|
#include "duckdb/parser/constraint.hpp"
|
5
4
|
|
6
5
|
namespace duckdb {
|
@@ -20,18 +19,6 @@ CatalogType AlterTableFunctionInfo::GetCatalogType() const {
|
|
20
19
|
return CatalogType::TABLE_FUNCTION_ENTRY;
|
21
20
|
}
|
22
21
|
|
23
|
-
void AlterTableFunctionInfo::Serialize(FieldWriter &writer) const {
|
24
|
-
writer.WriteField<AlterTableFunctionType>(alter_table_function_type);
|
25
|
-
writer.WriteString(catalog);
|
26
|
-
writer.WriteString(schema);
|
27
|
-
writer.WriteString(name);
|
28
|
-
writer.WriteField(if_not_found);
|
29
|
-
}
|
30
|
-
|
31
|
-
unique_ptr<AlterInfo> AlterTableFunctionInfo::Deserialize(FieldReader &reader) {
|
32
|
-
throw NotImplementedException("AlterTableFunctionInfo cannot be deserialized");
|
33
|
-
}
|
34
|
-
|
35
22
|
//===--------------------------------------------------------------------===//
|
36
23
|
// AddTableFunctionOverloadInfo
|
37
24
|
//===--------------------------------------------------------------------===//
|
@@ -1,6 +1,5 @@
|
|
1
1
|
#include "duckdb/parser/parsed_data/alter_table_info.hpp"
|
2
2
|
|
3
|
-
#include "duckdb/common/field_writer.hpp"
|
4
3
|
#include "duckdb/parser/constraint.hpp"
|
5
4
|
|
6
5
|
namespace duckdb {
|
@@ -26,10 +25,6 @@ unique_ptr<AlterInfo> ChangeOwnershipInfo::Copy() const {
|
|
26
25
|
owner_name, if_not_found);
|
27
26
|
}
|
28
27
|
|
29
|
-
void ChangeOwnershipInfo::Serialize(FieldWriter &writer) const {
|
30
|
-
throw InternalException("ChangeOwnershipInfo cannot be serialized");
|
31
|
-
}
|
32
|
-
|
33
28
|
//===--------------------------------------------------------------------===//
|
34
29
|
// AlterTableInfo
|
35
30
|
//===--------------------------------------------------------------------===//
|
@@ -47,49 +42,6 @@ AlterTableInfo::~AlterTableInfo() {
|
|
47
42
|
CatalogType AlterTableInfo::GetCatalogType() const {
|
48
43
|
return CatalogType::TABLE_ENTRY;
|
49
44
|
}
|
50
|
-
|
51
|
-
void AlterTableInfo::Serialize(FieldWriter &writer) const {
|
52
|
-
writer.WriteField<AlterTableType>(alter_table_type);
|
53
|
-
writer.WriteString(catalog);
|
54
|
-
writer.WriteString(schema);
|
55
|
-
writer.WriteString(name);
|
56
|
-
writer.WriteField(if_not_found);
|
57
|
-
SerializeAlterTable(writer);
|
58
|
-
}
|
59
|
-
|
60
|
-
unique_ptr<AlterInfo> AlterTableInfo::Deserialize(FieldReader &reader) {
|
61
|
-
auto type = reader.ReadRequired<AlterTableType>();
|
62
|
-
AlterEntryData data;
|
63
|
-
data.catalog = reader.ReadRequired<string>();
|
64
|
-
data.schema = reader.ReadRequired<string>();
|
65
|
-
data.name = reader.ReadRequired<string>();
|
66
|
-
data.if_not_found = reader.ReadRequired<OnEntryNotFound>();
|
67
|
-
|
68
|
-
unique_ptr<AlterTableInfo> info;
|
69
|
-
switch (type) {
|
70
|
-
case AlterTableType::RENAME_COLUMN:
|
71
|
-
return RenameColumnInfo::Deserialize(reader, std::move(data));
|
72
|
-
case AlterTableType::RENAME_TABLE:
|
73
|
-
return RenameTableInfo::Deserialize(reader, std::move(data));
|
74
|
-
case AlterTableType::ADD_COLUMN:
|
75
|
-
return AddColumnInfo::Deserialize(reader, std::move(data));
|
76
|
-
case AlterTableType::REMOVE_COLUMN:
|
77
|
-
return RemoveColumnInfo::Deserialize(reader, std::move(data));
|
78
|
-
case AlterTableType::ALTER_COLUMN_TYPE:
|
79
|
-
return ChangeColumnTypeInfo::Deserialize(reader, std::move(data));
|
80
|
-
case AlterTableType::SET_DEFAULT:
|
81
|
-
return SetDefaultInfo::Deserialize(reader, std::move(data));
|
82
|
-
case AlterTableType::FOREIGN_KEY_CONSTRAINT:
|
83
|
-
return AlterForeignKeyInfo::Deserialize(reader, std::move(data));
|
84
|
-
case AlterTableType::SET_NOT_NULL:
|
85
|
-
return SetNotNullInfo::Deserialize(reader, std::move(data));
|
86
|
-
case AlterTableType::DROP_NOT_NULL:
|
87
|
-
return DropNotNullInfo::Deserialize(reader, std::move(data));
|
88
|
-
default:
|
89
|
-
throw SerializationException("Unknown alter table type for deserialization!");
|
90
|
-
}
|
91
|
-
}
|
92
|
-
|
93
45
|
//===--------------------------------------------------------------------===//
|
94
46
|
// RenameColumnInfo
|
95
47
|
//===--------------------------------------------------------------------===//
|
@@ -108,17 +60,6 @@ unique_ptr<AlterInfo> RenameColumnInfo::Copy() const {
|
|
108
60
|
return make_uniq_base<AlterInfo, RenameColumnInfo>(GetAlterEntryData(), old_name, new_name);
|
109
61
|
}
|
110
62
|
|
111
|
-
void RenameColumnInfo::SerializeAlterTable(FieldWriter &writer) const {
|
112
|
-
writer.WriteString(old_name);
|
113
|
-
writer.WriteString(new_name);
|
114
|
-
}
|
115
|
-
|
116
|
-
unique_ptr<AlterInfo> RenameColumnInfo::Deserialize(FieldReader &reader, AlterEntryData data) {
|
117
|
-
auto old_name = reader.ReadRequired<string>();
|
118
|
-
auto new_name = reader.ReadRequired<string>();
|
119
|
-
return make_uniq<RenameColumnInfo>(std::move(data), old_name, new_name);
|
120
|
-
}
|
121
|
-
|
122
63
|
//===--------------------------------------------------------------------===//
|
123
64
|
// RenameTableInfo
|
124
65
|
//===--------------------------------------------------------------------===//
|
@@ -136,15 +77,6 @@ unique_ptr<AlterInfo> RenameTableInfo::Copy() const {
|
|
136
77
|
return make_uniq_base<AlterInfo, RenameTableInfo>(GetAlterEntryData(), new_table_name);
|
137
78
|
}
|
138
79
|
|
139
|
-
void RenameTableInfo::SerializeAlterTable(FieldWriter &writer) const {
|
140
|
-
writer.WriteString(new_table_name);
|
141
|
-
}
|
142
|
-
|
143
|
-
unique_ptr<AlterInfo> RenameTableInfo::Deserialize(FieldReader &reader, AlterEntryData data) {
|
144
|
-
auto new_name = reader.ReadRequired<string>();
|
145
|
-
return make_uniq<RenameTableInfo>(std::move(data), new_name);
|
146
|
-
}
|
147
|
-
|
148
80
|
//===--------------------------------------------------------------------===//
|
149
81
|
// AddColumnInfo
|
150
82
|
//===--------------------------------------------------------------------===//
|
@@ -164,17 +96,6 @@ unique_ptr<AlterInfo> AddColumnInfo::Copy() const {
|
|
164
96
|
return make_uniq_base<AlterInfo, AddColumnInfo>(GetAlterEntryData(), new_column.Copy(), if_column_not_exists);
|
165
97
|
}
|
166
98
|
|
167
|
-
void AddColumnInfo::SerializeAlterTable(FieldWriter &writer) const {
|
168
|
-
writer.WriteSerializable(new_column);
|
169
|
-
writer.WriteField<bool>(if_column_not_exists);
|
170
|
-
}
|
171
|
-
|
172
|
-
unique_ptr<AlterInfo> AddColumnInfo::Deserialize(FieldReader &reader, AlterEntryData data) {
|
173
|
-
auto new_column = reader.ReadRequiredSerializable<ColumnDefinition, ColumnDefinition>();
|
174
|
-
auto if_column_not_exists = reader.ReadRequired<bool>();
|
175
|
-
return make_uniq<AddColumnInfo>(std::move(data), std::move(new_column), if_column_not_exists);
|
176
|
-
}
|
177
|
-
|
178
99
|
//===--------------------------------------------------------------------===//
|
179
100
|
// RemoveColumnInfo
|
180
101
|
//===--------------------------------------------------------------------===//
|
@@ -192,19 +113,6 @@ unique_ptr<AlterInfo> RemoveColumnInfo::Copy() const {
|
|
192
113
|
return make_uniq_base<AlterInfo, RemoveColumnInfo>(GetAlterEntryData(), removed_column, if_column_exists, cascade);
|
193
114
|
}
|
194
115
|
|
195
|
-
void RemoveColumnInfo::SerializeAlterTable(FieldWriter &writer) const {
|
196
|
-
writer.WriteString(removed_column);
|
197
|
-
writer.WriteField<bool>(if_column_exists);
|
198
|
-
writer.WriteField<bool>(cascade);
|
199
|
-
}
|
200
|
-
|
201
|
-
unique_ptr<AlterInfo> RemoveColumnInfo::Deserialize(FieldReader &reader, AlterEntryData data) {
|
202
|
-
auto new_name = reader.ReadRequired<string>();
|
203
|
-
auto if_column_exists = reader.ReadRequired<bool>();
|
204
|
-
auto cascade = reader.ReadRequired<bool>();
|
205
|
-
return make_uniq<RemoveColumnInfo>(std::move(data), std::move(new_name), if_column_exists, cascade);
|
206
|
-
}
|
207
|
-
|
208
116
|
//===--------------------------------------------------------------------===//
|
209
117
|
// ChangeColumnTypeInfo
|
210
118
|
//===--------------------------------------------------------------------===//
|
@@ -224,20 +132,6 @@ unique_ptr<AlterInfo> ChangeColumnTypeInfo::Copy() const {
|
|
224
132
|
expression->Copy());
|
225
133
|
}
|
226
134
|
|
227
|
-
void ChangeColumnTypeInfo::SerializeAlterTable(FieldWriter &writer) const {
|
228
|
-
writer.WriteString(column_name);
|
229
|
-
writer.WriteSerializable(target_type);
|
230
|
-
writer.WriteOptional(expression);
|
231
|
-
}
|
232
|
-
|
233
|
-
unique_ptr<AlterInfo> ChangeColumnTypeInfo::Deserialize(FieldReader &reader, AlterEntryData data) {
|
234
|
-
auto column_name = reader.ReadRequired<string>();
|
235
|
-
auto target_type = reader.ReadRequiredSerializable<LogicalType, LogicalType>();
|
236
|
-
auto expression = reader.ReadOptional<ParsedExpression>(nullptr);
|
237
|
-
return make_uniq<ChangeColumnTypeInfo>(std::move(data), std::move(column_name), std::move(target_type),
|
238
|
-
std::move(expression));
|
239
|
-
}
|
240
|
-
|
241
135
|
//===--------------------------------------------------------------------===//
|
242
136
|
// SetDefaultInfo
|
243
137
|
//===--------------------------------------------------------------------===//
|
@@ -256,17 +150,6 @@ unique_ptr<AlterInfo> SetDefaultInfo::Copy() const {
|
|
256
150
|
expression ? expression->Copy() : nullptr);
|
257
151
|
}
|
258
152
|
|
259
|
-
void SetDefaultInfo::SerializeAlterTable(FieldWriter &writer) const {
|
260
|
-
writer.WriteString(column_name);
|
261
|
-
writer.WriteOptional(expression);
|
262
|
-
}
|
263
|
-
|
264
|
-
unique_ptr<AlterInfo> SetDefaultInfo::Deserialize(FieldReader &reader, AlterEntryData data) {
|
265
|
-
auto column_name = reader.ReadRequired<string>();
|
266
|
-
auto new_default = reader.ReadOptional<ParsedExpression>(nullptr);
|
267
|
-
return make_uniq<SetDefaultInfo>(std::move(data), std::move(column_name), std::move(new_default));
|
268
|
-
}
|
269
|
-
|
270
153
|
//===--------------------------------------------------------------------===//
|
271
154
|
// SetNotNullInfo
|
272
155
|
//===--------------------------------------------------------------------===//
|
@@ -283,15 +166,6 @@ unique_ptr<AlterInfo> SetNotNullInfo::Copy() const {
|
|
283
166
|
return make_uniq_base<AlterInfo, SetNotNullInfo>(GetAlterEntryData(), column_name);
|
284
167
|
}
|
285
168
|
|
286
|
-
void SetNotNullInfo::SerializeAlterTable(FieldWriter &writer) const {
|
287
|
-
writer.WriteString(column_name);
|
288
|
-
}
|
289
|
-
|
290
|
-
unique_ptr<AlterInfo> SetNotNullInfo::Deserialize(FieldReader &reader, AlterEntryData data) {
|
291
|
-
auto column_name = reader.ReadRequired<string>();
|
292
|
-
return make_uniq<SetNotNullInfo>(std::move(data), std::move(column_name));
|
293
|
-
}
|
294
|
-
|
295
169
|
//===--------------------------------------------------------------------===//
|
296
170
|
// DropNotNullInfo
|
297
171
|
//===--------------------------------------------------------------------===//
|
@@ -308,15 +182,6 @@ unique_ptr<AlterInfo> DropNotNullInfo::Copy() const {
|
|
308
182
|
return make_uniq_base<AlterInfo, DropNotNullInfo>(GetAlterEntryData(), column_name);
|
309
183
|
}
|
310
184
|
|
311
|
-
void DropNotNullInfo::SerializeAlterTable(FieldWriter &writer) const {
|
312
|
-
writer.WriteString(column_name);
|
313
|
-
}
|
314
|
-
|
315
|
-
unique_ptr<AlterInfo> DropNotNullInfo::Deserialize(FieldReader &reader, AlterEntryData data) {
|
316
|
-
auto column_name = reader.ReadRequired<string>();
|
317
|
-
return make_uniq<DropNotNullInfo>(std::move(data), std::move(column_name));
|
318
|
-
}
|
319
|
-
|
320
185
|
//===--------------------------------------------------------------------===//
|
321
186
|
// AlterForeignKeyInfo
|
322
187
|
//===--------------------------------------------------------------------===//
|
@@ -338,30 +203,10 @@ unique_ptr<AlterInfo> AlterForeignKeyInfo::Copy() const {
|
|
338
203
|
pk_keys, fk_keys, type);
|
339
204
|
}
|
340
205
|
|
341
|
-
void AlterForeignKeyInfo::SerializeAlterTable(FieldWriter &writer) const {
|
342
|
-
writer.WriteString(fk_table);
|
343
|
-
writer.WriteList<string>(pk_columns);
|
344
|
-
writer.WriteList<string>(fk_columns);
|
345
|
-
writer.WriteIndexList<PhysicalIndex>(pk_keys);
|
346
|
-
writer.WriteIndexList<PhysicalIndex>(fk_keys);
|
347
|
-
writer.WriteField<AlterForeignKeyType>(type);
|
348
|
-
}
|
349
|
-
|
350
|
-
unique_ptr<AlterInfo> AlterForeignKeyInfo::Deserialize(FieldReader &reader, AlterEntryData data) {
|
351
|
-
auto fk_table = reader.ReadRequired<string>();
|
352
|
-
auto pk_columns = reader.ReadRequiredList<string>();
|
353
|
-
auto fk_columns = reader.ReadRequiredList<string>();
|
354
|
-
auto pk_keys = reader.ReadRequiredIndexList<PhysicalIndex>();
|
355
|
-
auto fk_keys = reader.ReadRequiredIndexList<PhysicalIndex>();
|
356
|
-
auto type = reader.ReadRequired<AlterForeignKeyType>();
|
357
|
-
return make_uniq<AlterForeignKeyInfo>(std::move(data), std::move(fk_table), std::move(pk_columns),
|
358
|
-
std::move(fk_columns), std::move(pk_keys), std::move(fk_keys), type);
|
359
|
-
}
|
360
|
-
|
361
206
|
//===--------------------------------------------------------------------===//
|
362
207
|
// Alter View
|
363
208
|
//===--------------------------------------------------------------------===//
|
364
|
-
AlterViewInfo::AlterViewInfo(AlterViewType type) : AlterInfo(AlterType::ALTER_VIEW) {
|
209
|
+
AlterViewInfo::AlterViewInfo(AlterViewType type) : AlterInfo(AlterType::ALTER_VIEW), alter_view_type(type) {
|
365
210
|
}
|
366
211
|
|
367
212
|
AlterViewInfo::AlterViewInfo(AlterViewType type, AlterEntryData data)
|
@@ -376,31 +221,6 @@ CatalogType AlterViewInfo::GetCatalogType() const {
|
|
376
221
|
return CatalogType::VIEW_ENTRY;
|
377
222
|
}
|
378
223
|
|
379
|
-
void AlterViewInfo::Serialize(FieldWriter &writer) const {
|
380
|
-
writer.WriteField<AlterViewType>(alter_view_type);
|
381
|
-
writer.WriteString(catalog);
|
382
|
-
writer.WriteString(schema);
|
383
|
-
writer.WriteString(name);
|
384
|
-
writer.WriteField<OnEntryNotFound>(if_not_found);
|
385
|
-
SerializeAlterView(writer);
|
386
|
-
}
|
387
|
-
|
388
|
-
unique_ptr<AlterInfo> AlterViewInfo::Deserialize(FieldReader &reader) {
|
389
|
-
auto type = reader.ReadRequired<AlterViewType>();
|
390
|
-
AlterEntryData data;
|
391
|
-
data.catalog = reader.ReadRequired<string>();
|
392
|
-
data.schema = reader.ReadRequired<string>();
|
393
|
-
data.name = reader.ReadRequired<string>();
|
394
|
-
data.if_not_found = reader.ReadRequired<OnEntryNotFound>();
|
395
|
-
unique_ptr<AlterViewInfo> info;
|
396
|
-
switch (type) {
|
397
|
-
case AlterViewType::RENAME_VIEW:
|
398
|
-
return RenameViewInfo::Deserialize(reader, std::move(data));
|
399
|
-
default:
|
400
|
-
throw SerializationException("Unknown alter view type for deserialization!");
|
401
|
-
}
|
402
|
-
}
|
403
|
-
|
404
224
|
//===--------------------------------------------------------------------===//
|
405
225
|
// RenameViewInfo
|
406
226
|
//===--------------------------------------------------------------------===//
|
@@ -416,12 +236,4 @@ unique_ptr<AlterInfo> RenameViewInfo::Copy() const {
|
|
416
236
|
return make_uniq_base<AlterInfo, RenameViewInfo>(GetAlterEntryData(), new_view_name);
|
417
237
|
}
|
418
238
|
|
419
|
-
void RenameViewInfo::SerializeAlterView(FieldWriter &writer) const {
|
420
|
-
writer.WriteString(new_view_name);
|
421
|
-
}
|
422
|
-
|
423
|
-
unique_ptr<AlterInfo> RenameViewInfo::Deserialize(FieldReader &reader, AlterEntryData data) {
|
424
|
-
auto new_name = reader.ReadRequired<string>();
|
425
|
-
return make_uniq<RenameViewInfo>(std::move(data), new_name);
|
426
|
-
}
|
427
239
|
} // namespace duckdb
|
@@ -1,5 +1,4 @@
|
|
1
1
|
#include "duckdb/parser/parsed_data/attach_info.hpp"
|
2
|
-
#include "duckdb/common/field_writer.hpp"
|
3
2
|
|
4
3
|
namespace duckdb {
|
5
4
|
|
@@ -11,32 +10,4 @@ unique_ptr<AttachInfo> AttachInfo::Copy() const {
|
|
11
10
|
return result;
|
12
11
|
}
|
13
12
|
|
14
|
-
void AttachInfo::Serialize(Serializer &main_serializer) const {
|
15
|
-
FieldWriter writer(main_serializer);
|
16
|
-
writer.WriteString(name);
|
17
|
-
writer.WriteString(path);
|
18
|
-
writer.WriteField<uint32_t>(options.size());
|
19
|
-
auto &serializer = writer.GetSerializer();
|
20
|
-
for (auto &kv : options) {
|
21
|
-
serializer.WriteString(kv.first);
|
22
|
-
kv.second.Serialize(serializer);
|
23
|
-
}
|
24
|
-
writer.Finalize();
|
25
|
-
}
|
26
|
-
|
27
|
-
unique_ptr<ParseInfo> AttachInfo::Deserialize(Deserializer &deserializer) {
|
28
|
-
FieldReader reader(deserializer);
|
29
|
-
auto attach_info = make_uniq<AttachInfo>();
|
30
|
-
attach_info->name = reader.ReadRequired<string>();
|
31
|
-
attach_info->path = reader.ReadRequired<string>();
|
32
|
-
auto default_attach_count = reader.ReadRequired<uint32_t>();
|
33
|
-
auto &source = reader.GetSource();
|
34
|
-
for (idx_t i = 0; i < default_attach_count; i++) {
|
35
|
-
auto name = source.Read<string>();
|
36
|
-
attach_info->options[name] = Value::Deserialize(source);
|
37
|
-
}
|
38
|
-
reader.Finalize();
|
39
|
-
return std::move(attach_info);
|
40
|
-
}
|
41
|
-
|
42
13
|
} // namespace duckdb
|
@@ -10,10 +10,6 @@ CreateCollationInfo::CreateCollationInfo(string name_p, ScalarFunction function_
|
|
10
10
|
internal = true;
|
11
11
|
}
|
12
12
|
|
13
|
-
void CreateCollationInfo::SerializeInternal(Serializer &) const {
|
14
|
-
throw NotImplementedException("Cannot serialize '%s'", CatalogTypeToString(type));
|
15
|
-
}
|
16
|
-
|
17
13
|
unique_ptr<CreateInfo> CreateCollationInfo::Copy() const {
|
18
14
|
auto result = make_uniq<CreateCollationInfo>(name, function, combinable, not_required_for_equality);
|
19
15
|
CopyProperties(*result);
|
@@ -8,10 +8,6 @@ CreateCopyFunctionInfo::CreateCopyFunctionInfo(CopyFunction function_p)
|
|
8
8
|
internal = true;
|
9
9
|
}
|
10
10
|
|
11
|
-
void CreateCopyFunctionInfo::SerializeInternal(Serializer &) const {
|
12
|
-
throw NotImplementedException("Cannot serialize '%s'", CatalogTypeToString(type));
|
13
|
-
}
|
14
|
-
|
15
11
|
unique_ptr<CreateInfo> CreateCopyFunctionInfo::Copy() const {
|
16
12
|
auto result = make_uniq<CreateCopyFunctionInfo>(function);
|
17
13
|
CopyProperties(*result);
|
@@ -1,7 +1,5 @@
|
|
1
1
|
#include "duckdb/parser/parsed_data/create_index_info.hpp"
|
2
2
|
|
3
|
-
#include "duckdb/common/field_writer.hpp"
|
4
|
-
|
5
3
|
namespace duckdb {
|
6
4
|
|
7
5
|
unique_ptr<CreateInfo> CreateIndexInfo::Copy() const {
|
@@ -26,50 +24,4 @@ unique_ptr<CreateInfo> CreateIndexInfo::Copy() const {
|
|
26
24
|
return std::move(result);
|
27
25
|
}
|
28
26
|
|
29
|
-
void CreateIndexInfo::SerializeInternal(Serializer &serializer) const {
|
30
|
-
FieldWriter writer(serializer);
|
31
|
-
writer.WriteField(index_type);
|
32
|
-
writer.WriteString(table);
|
33
|
-
writer.WriteString(index_name);
|
34
|
-
writer.WriteField(constraint_type);
|
35
|
-
|
36
|
-
writer.WriteSerializableList<ParsedExpression>(parsed_expressions);
|
37
|
-
|
38
|
-
writer.WriteRegularSerializableList(scan_types);
|
39
|
-
writer.WriteList<string>(names);
|
40
|
-
writer.WriteList<column_t>(column_ids);
|
41
|
-
writer.WriteString(index_type_name);
|
42
|
-
writer.WriteField((idx_t)options.size());
|
43
|
-
for (auto &kv : options) {
|
44
|
-
writer.WriteString(kv.first);
|
45
|
-
writer.WriteSerializable(kv.second);
|
46
|
-
}
|
47
|
-
writer.Finalize();
|
48
|
-
}
|
49
|
-
|
50
|
-
unique_ptr<CreateIndexInfo> CreateIndexInfo::Deserialize(Deserializer &deserializer) {
|
51
|
-
auto result = make_uniq<CreateIndexInfo>();
|
52
|
-
result->DeserializeBase(deserializer);
|
53
|
-
|
54
|
-
FieldReader reader(deserializer);
|
55
|
-
result->index_type = reader.ReadRequired<IndexType>();
|
56
|
-
result->table = reader.ReadRequired<string>();
|
57
|
-
result->index_name = reader.ReadRequired<string>();
|
58
|
-
result->constraint_type = reader.ReadRequired<IndexConstraintType>();
|
59
|
-
|
60
|
-
result->parsed_expressions = reader.ReadRequiredSerializableList<ParsedExpression>();
|
61
|
-
|
62
|
-
result->scan_types = reader.ReadRequiredSerializableList<LogicalType, LogicalType>();
|
63
|
-
result->names = reader.ReadRequiredList<string>();
|
64
|
-
result->column_ids = reader.ReadRequiredList<column_t>();
|
65
|
-
result->index_type_name = reader.ReadRequired<string>();
|
66
|
-
auto options_count = reader.ReadRequired<idx_t>();
|
67
|
-
for (idx_t i = 0; i < options_count; i++) {
|
68
|
-
auto key = reader.ReadRequired<string>();
|
69
|
-
auto value = reader.ReadRequiredSerializable<Value, Value>();
|
70
|
-
result->options[key] = value;
|
71
|
-
}
|
72
|
-
reader.Finalize();
|
73
|
-
return result;
|
74
|
-
}
|
75
27
|
} // namespace duckdb
|
@@ -11,53 +11,6 @@
|
|
11
11
|
|
12
12
|
namespace duckdb {
|
13
13
|
|
14
|
-
void CreateInfo::Serialize(Serializer &serializer) const {
|
15
|
-
serializer.Write(type);
|
16
|
-
serializer.WriteString(catalog);
|
17
|
-
serializer.WriteString(schema);
|
18
|
-
serializer.Write(on_conflict);
|
19
|
-
serializer.Write(temporary);
|
20
|
-
serializer.Write(internal);
|
21
|
-
serializer.WriteString(sql);
|
22
|
-
SerializeInternal(serializer);
|
23
|
-
}
|
24
|
-
|
25
|
-
void CreateInfo::DeserializeBase(Deserializer &deserializer) {
|
26
|
-
this->catalog = deserializer.Read<string>();
|
27
|
-
this->schema = deserializer.Read<string>();
|
28
|
-
this->on_conflict = deserializer.Read<OnCreateConflict>();
|
29
|
-
this->temporary = deserializer.Read<bool>();
|
30
|
-
this->internal = deserializer.Read<bool>();
|
31
|
-
this->sql = deserializer.Read<string>();
|
32
|
-
}
|
33
|
-
|
34
|
-
unique_ptr<CreateInfo> CreateInfo::Deserialize(Deserializer &deserializer) {
|
35
|
-
auto type = deserializer.Read<CatalogType>();
|
36
|
-
switch (type) {
|
37
|
-
case CatalogType::INDEX_ENTRY:
|
38
|
-
return CreateIndexInfo::Deserialize(deserializer);
|
39
|
-
case CatalogType::TABLE_ENTRY:
|
40
|
-
return CreateTableInfo::Deserialize(deserializer);
|
41
|
-
case CatalogType::SCHEMA_ENTRY:
|
42
|
-
return CreateSchemaInfo::Deserialize(deserializer);
|
43
|
-
case CatalogType::VIEW_ENTRY:
|
44
|
-
return CreateViewInfo::Deserialize(deserializer);
|
45
|
-
case CatalogType::TYPE_ENTRY:
|
46
|
-
return CreateTypeInfo::Deserialize(deserializer);
|
47
|
-
case CatalogType::MACRO_ENTRY:
|
48
|
-
case CatalogType::TABLE_MACRO_ENTRY:
|
49
|
-
return CreateMacroInfo::Deserialize(deserializer);
|
50
|
-
case CatalogType::SEQUENCE_ENTRY:
|
51
|
-
return CreateSequenceInfo::Deserialize(deserializer);
|
52
|
-
default:
|
53
|
-
throw NotImplementedException("Cannot deserialize '%s'", CatalogTypeToString(type));
|
54
|
-
}
|
55
|
-
}
|
56
|
-
|
57
|
-
unique_ptr<CreateInfo> CreateInfo::Deserialize(Deserializer &source, PlanDeserializationState &state) {
|
58
|
-
return Deserialize(source);
|
59
|
-
}
|
60
|
-
|
61
14
|
void CreateInfo::CopyProperties(CreateInfo &other) const {
|
62
15
|
other.type = type;
|
63
16
|
other.catalog = catalog;
|
@@ -5,42 +5,15 @@
|
|
5
5
|
|
6
6
|
namespace duckdb {
|
7
7
|
|
8
|
-
CreateMacroInfo::CreateMacroInfo() : CreateFunctionInfo(CatalogType::MACRO_ENTRY, INVALID_SCHEMA) {
|
9
|
-
}
|
10
|
-
|
11
8
|
CreateMacroInfo::CreateMacroInfo(CatalogType type) : CreateFunctionInfo(type, INVALID_SCHEMA) {
|
12
9
|
}
|
13
10
|
|
14
11
|
unique_ptr<CreateInfo> CreateMacroInfo::Copy() const {
|
15
|
-
auto result = make_uniq<CreateMacroInfo>();
|
12
|
+
auto result = make_uniq<CreateMacroInfo>(type);
|
16
13
|
result->function = function->Copy();
|
17
14
|
result->name = name;
|
18
15
|
CopyProperties(*result);
|
19
16
|
return std::move(result);
|
20
17
|
}
|
21
18
|
|
22
|
-
void CreateMacroInfo::SerializeInternal(Serializer &serializer) const {
|
23
|
-
FieldWriter writer(serializer);
|
24
|
-
writer.WriteString(name);
|
25
|
-
writer.WriteSerializable(*function);
|
26
|
-
writer.Finalize();
|
27
|
-
}
|
28
|
-
|
29
|
-
unique_ptr<CreateMacroInfo> CreateMacroInfo::Deserialize(Deserializer &deserializer) {
|
30
|
-
auto result = make_uniq<CreateMacroInfo>();
|
31
|
-
result->DeserializeBase(deserializer);
|
32
|
-
|
33
|
-
FieldReader reader(deserializer);
|
34
|
-
result->name = reader.ReadRequired<string>();
|
35
|
-
result->function = reader.ReadRequiredSerializable<MacroFunction>();
|
36
|
-
reader.Finalize();
|
37
|
-
|
38
|
-
if (result->function->type == MacroType::TABLE_MACRO) {
|
39
|
-
result->type = CatalogType::TABLE_MACRO_ENTRY;
|
40
|
-
} else {
|
41
|
-
result->type = CatalogType::MACRO_ENTRY;
|
42
|
-
}
|
43
|
-
return result;
|
44
|
-
}
|
45
|
-
|
46
19
|
} // namespace duckdb
|