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
@@ -277,43 +277,23 @@ bool ExportAggregateFunctionBindData::Equals(const FunctionData &other_p) const
|
|
277
277
|
return aggregate->Equals(*other.aggregate);
|
278
278
|
}
|
279
279
|
|
280
|
-
static void ExportStateAggregateSerialize(
|
280
|
+
static void ExportStateAggregateSerialize(Serializer &serializer, const optional_ptr<FunctionData> bind_data_p,
|
281
281
|
const AggregateFunction &function) {
|
282
282
|
throw NotImplementedException("FIXME: export state serialize");
|
283
283
|
}
|
284
|
-
static unique_ptr<FunctionData> ExportStateAggregateDeserialize(PlanDeserializationState &state, FieldReader &reader,
|
285
|
-
AggregateFunction &bound_function) {
|
286
|
-
throw NotImplementedException("FIXME: export state deserialize");
|
287
|
-
}
|
288
284
|
|
289
|
-
static
|
290
|
-
|
291
|
-
|
292
|
-
throw SerializationException("FIXME: export state serialize");
|
293
|
-
}
|
294
|
-
|
295
|
-
static unique_ptr<FunctionData> ExportStateAggregateFormatDeserialize(FormatDeserializer &deserializer,
|
296
|
-
AggregateFunction &function) {
|
297
|
-
throw SerializationException("FIXME: export state deserialize");
|
285
|
+
static unique_ptr<FunctionData> ExportStateAggregateDeserialize(Deserializer &deserializer,
|
286
|
+
AggregateFunction &function) {
|
287
|
+
throw NotImplementedException("FIXME: export state deserialize");
|
298
288
|
}
|
299
289
|
|
300
|
-
static void ExportStateScalarSerialize(
|
290
|
+
static void ExportStateScalarSerialize(Serializer &serializer, const optional_ptr<FunctionData> bind_data_p,
|
301
291
|
const ScalarFunction &function) {
|
302
292
|
throw NotImplementedException("FIXME: export state serialize");
|
303
293
|
}
|
304
|
-
static unique_ptr<FunctionData> ExportStateScalarDeserialize(PlanDeserializationState &state, FieldReader &reader,
|
305
|
-
ScalarFunction &bound_function) {
|
306
|
-
throw NotImplementedException("FIXME: export state deserialize");
|
307
|
-
}
|
308
294
|
|
309
|
-
static
|
310
|
-
|
311
|
-
throw SerializationException("FIXME: export state serialize");
|
312
|
-
}
|
313
|
-
|
314
|
-
static unique_ptr<FunctionData> ExportStateScalarFormatDeserialize(FormatDeserializer &deserializer,
|
315
|
-
ScalarFunction &function) {
|
316
|
-
throw SerializationException("FIXME: export state deserialize");
|
295
|
+
static unique_ptr<FunctionData> ExportStateScalarDeserialize(Deserializer &deserializer, ScalarFunction &function) {
|
296
|
+
throw NotImplementedException("FIXME: export state deserialize");
|
317
297
|
}
|
318
298
|
|
319
299
|
unique_ptr<BoundAggregateExpression>
|
@@ -352,8 +332,6 @@ ExportAggregateFunction::Bind(unique_ptr<BoundAggregateExpression> child_aggrega
|
|
352
332
|
export_function.null_handling = FunctionNullHandling::SPECIAL_HANDLING;
|
353
333
|
export_function.serialize = ExportStateAggregateSerialize;
|
354
334
|
export_function.deserialize = ExportStateAggregateDeserialize;
|
355
|
-
export_function.format_serialize = ExportStateAggregateFormatSerialize;
|
356
|
-
export_function.format_deserialize = ExportStateAggregateFormatDeserialize;
|
357
335
|
|
358
336
|
return make_uniq<BoundAggregateExpression>(export_function, std::move(child_aggregate->children),
|
359
337
|
std::move(child_aggregate->filter), std::move(export_bind_data),
|
@@ -366,8 +344,6 @@ ScalarFunction ExportAggregateFunction::GetFinalize() {
|
|
366
344
|
result.null_handling = FunctionNullHandling::SPECIAL_HANDLING;
|
367
345
|
result.serialize = ExportStateScalarSerialize;
|
368
346
|
result.deserialize = ExportStateScalarDeserialize;
|
369
|
-
result.format_serialize = ExportStateScalarFormatSerialize;
|
370
|
-
result.format_deserialize = ExportStateScalarFormatDeserialize;
|
371
347
|
return result;
|
372
348
|
}
|
373
349
|
|
@@ -378,8 +354,6 @@ ScalarFunction ExportAggregateFunction::GetCombine() {
|
|
378
354
|
result.null_handling = FunctionNullHandling::SPECIAL_HANDLING;
|
379
355
|
result.serialize = ExportStateScalarSerialize;
|
380
356
|
result.deserialize = ExportStateScalarDeserialize;
|
381
|
-
result.format_serialize = ExportStateScalarFormatSerialize;
|
382
|
-
result.format_deserialize = ExportStateScalarFormatDeserialize;
|
383
357
|
return result;
|
384
358
|
}
|
385
359
|
|
@@ -13,8 +13,7 @@ ScalarFunction::ScalarFunction(string name, vector<LogicalType> arguments, Logic
|
|
13
13
|
: BaseScalarFunction(std::move(name), std::move(arguments), std::move(return_type), side_effects,
|
14
14
|
std::move(varargs), null_handling),
|
15
15
|
function(std::move(function)), bind(bind), init_local_state(init_local_state), dependency(dependency),
|
16
|
-
statistics(statistics), serialize(nullptr), deserialize(nullptr)
|
17
|
-
format_deserialize(nullptr) {
|
16
|
+
statistics(statistics), serialize(nullptr), deserialize(nullptr) {
|
18
17
|
}
|
19
18
|
|
20
19
|
ScalarFunction::ScalarFunction(vector<LogicalType> arguments, LogicalType return_type, scalar_function_t function,
|
@@ -49,14 +49,4 @@ string ScalarMacroFunction::ToSQL(const string &schema, const string &name) cons
|
|
49
49
|
return MacroFunction::ToSQL(schema, name) + StringUtil::Format("(%s);", expression_copy->ToString());
|
50
50
|
}
|
51
51
|
|
52
|
-
void ScalarMacroFunction::SerializeInternal(FieldWriter &writer) const {
|
53
|
-
writer.WriteSerializable(*expression);
|
54
|
-
}
|
55
|
-
|
56
|
-
unique_ptr<MacroFunction> ScalarMacroFunction::Deserialize(FieldReader &reader) {
|
57
|
-
auto result = make_uniq<ScalarMacroFunction>();
|
58
|
-
result->expression = reader.ReadRequiredSerializable<ParsedExpression>();
|
59
|
-
return std::move(result);
|
60
|
-
}
|
61
|
-
|
62
52
|
} // namespace duckdb
|
@@ -1,7 +1,6 @@
|
|
1
1
|
#include "duckdb/common/bind_helpers.hpp"
|
2
2
|
#include "duckdb/common/file_system.hpp"
|
3
3
|
#include "duckdb/common/multi_file_reader.hpp"
|
4
|
-
#include "duckdb/common/serializer/buffered_serializer.hpp"
|
5
4
|
#include "duckdb/common/string_util.hpp"
|
6
5
|
#include "duckdb/common/types/column/column_data_collection.hpp"
|
7
6
|
#include "duckdb/common/types/string_type.hpp"
|
@@ -11,6 +10,8 @@
|
|
11
10
|
#include "duckdb/function/scalar/string_functions.hpp"
|
12
11
|
#include "duckdb/function/table/read_csv.hpp"
|
13
12
|
#include "duckdb/parser/parsed_data/copy_info.hpp"
|
13
|
+
#include "duckdb/common/serializer/write_stream.hpp"
|
14
|
+
#include "duckdb/common/serializer/memory_stream.hpp"
|
14
15
|
|
15
16
|
#include <limits>
|
16
17
|
|
@@ -37,10 +38,9 @@ void SubstringDetection(char &str_1, string &str_2, const string &name_str_1, co
|
|
37
38
|
//===--------------------------------------------------------------------===//
|
38
39
|
// Bind
|
39
40
|
//===--------------------------------------------------------------------===//
|
40
|
-
|
41
|
-
void WriteQuoteOrEscape(Serializer &serializer, char quote_or_escape) {
|
41
|
+
void WriteQuoteOrEscape(WriteStream &writer, char quote_or_escape) {
|
42
42
|
if (quote_or_escape != '\0') {
|
43
|
-
|
43
|
+
writer.Write(quote_or_escape);
|
44
44
|
}
|
45
45
|
}
|
46
46
|
|
@@ -214,7 +214,7 @@ static bool RequiresQuotes(WriteCSVData &csv_data, const char *str, idx_t len) {
|
|
214
214
|
return false;
|
215
215
|
}
|
216
216
|
|
217
|
-
static void WriteQuotedString(
|
217
|
+
static void WriteQuotedString(WriteStream &writer, WriteCSVData &csv_data, const char *str, idx_t len,
|
218
218
|
bool force_quote) {
|
219
219
|
auto &options = csv_data.options;
|
220
220
|
if (!force_quote) {
|
@@ -236,9 +236,9 @@ static void WriteQuotedString(Serializer &serializer, WriteCSVData &csv_data, co
|
|
236
236
|
|
237
237
|
if (!requires_escape) {
|
238
238
|
// fast path: no need to escape anything
|
239
|
-
WriteQuoteOrEscape(
|
240
|
-
|
241
|
-
WriteQuoteOrEscape(
|
239
|
+
WriteQuoteOrEscape(writer, options.dialect_options.state_machine_options.quote);
|
240
|
+
writer.WriteData(const_data_ptr_cast(str), len);
|
241
|
+
WriteQuoteOrEscape(writer, options.dialect_options.state_machine_options.quote);
|
242
242
|
return;
|
243
243
|
}
|
244
244
|
|
@@ -252,11 +252,11 @@ static void WriteQuotedString(Serializer &serializer, WriteCSVData &csv_data, co
|
|
252
252
|
new_val = AddEscapes(options.dialect_options.state_machine_options.quote,
|
253
253
|
options.dialect_options.state_machine_options.escape, new_val);
|
254
254
|
}
|
255
|
-
WriteQuoteOrEscape(
|
256
|
-
|
257
|
-
WriteQuoteOrEscape(
|
255
|
+
WriteQuoteOrEscape(writer, options.dialect_options.state_machine_options.quote);
|
256
|
+
writer.WriteData(const_data_ptr_cast(new_val.c_str()), new_val.size());
|
257
|
+
WriteQuoteOrEscape(writer, options.dialect_options.state_machine_options.quote);
|
258
258
|
} else {
|
259
|
-
|
259
|
+
writer.WriteData(const_data_ptr_cast(str), len);
|
260
260
|
}
|
261
261
|
}
|
262
262
|
|
@@ -265,7 +265,7 @@ static void WriteQuotedString(Serializer &serializer, WriteCSVData &csv_data, co
|
|
265
265
|
//===--------------------------------------------------------------------===//
|
266
266
|
struct LocalWriteCSVData : public LocalFunctionData {
|
267
267
|
//! The thread-local buffer to write data into
|
268
|
-
|
268
|
+
MemoryStream stream;
|
269
269
|
//! A chunk with VARCHAR columns to cast intermediates into
|
270
270
|
DataChunk cast_chunk;
|
271
271
|
//! If we've written any rows yet, allows us to prevent a trailing comma when writing JSON ARRAY
|
@@ -333,25 +333,25 @@ static unique_ptr<GlobalFunctionData> WriteCSVInitializeGlobal(ClientContext &co
|
|
333
333
|
}
|
334
334
|
|
335
335
|
if (options.dialect_options.header) {
|
336
|
-
|
336
|
+
MemoryStream stream;
|
337
337
|
// write the header line to the file
|
338
338
|
for (idx_t i = 0; i < csv_data.options.name_list.size(); i++) {
|
339
339
|
if (i != 0) {
|
340
|
-
WriteQuoteOrEscape(
|
340
|
+
WriteQuoteOrEscape(stream, options.dialect_options.state_machine_options.delimiter);
|
341
341
|
}
|
342
|
-
WriteQuotedString(
|
342
|
+
WriteQuotedString(stream, csv_data, csv_data.options.name_list[i].c_str(),
|
343
343
|
csv_data.options.name_list[i].size(), false);
|
344
344
|
}
|
345
|
-
|
345
|
+
stream.WriteData(const_data_ptr_cast(csv_data.newline.c_str()), csv_data.newline.size());
|
346
346
|
|
347
|
-
global_data->WriteData(
|
347
|
+
global_data->WriteData(stream.GetData(), stream.GetPosition());
|
348
348
|
}
|
349
349
|
|
350
350
|
return std::move(global_data);
|
351
351
|
}
|
352
352
|
|
353
353
|
static void WriteCSVChunkInternal(ClientContext &context, FunctionData &bind_data, DataChunk &cast_chunk,
|
354
|
-
|
354
|
+
MemoryStream &writer, DataChunk &input, bool &written_anything) {
|
355
355
|
auto &csv_data = bind_data.Cast<WriteCSVData>();
|
356
356
|
auto &options = csv_data.options;
|
357
357
|
|
@@ -385,7 +385,7 @@ static void WriteCSVChunkInternal(ClientContext &context, FunctionData &bind_dat
|
|
385
385
|
if (row_idx == 0 && !written_anything) {
|
386
386
|
written_anything = true;
|
387
387
|
} else {
|
388
|
-
writer.
|
388
|
+
writer.WriteData(const_data_ptr_cast(csv_data.newline.c_str()), csv_data.newline.size());
|
389
389
|
}
|
390
390
|
// write values
|
391
391
|
for (idx_t col_idx = 0; col_idx < cast_chunk.ColumnCount(); col_idx++) {
|
@@ -394,7 +394,7 @@ static void WriteCSVChunkInternal(ClientContext &context, FunctionData &bind_dat
|
|
394
394
|
}
|
395
395
|
if (FlatVector::IsNull(cast_chunk.data[col_idx], row_idx)) {
|
396
396
|
// write null value
|
397
|
-
writer.
|
397
|
+
writer.WriteData(const_data_ptr_cast(options.null_str.c_str()), options.null_str.size());
|
398
398
|
continue;
|
399
399
|
}
|
400
400
|
|
@@ -416,14 +416,14 @@ static void WriteCSVSink(ExecutionContext &context, FunctionData &bind_data, Glo
|
|
416
416
|
auto &global_state = gstate.Cast<GlobalWriteCSVData>();
|
417
417
|
|
418
418
|
// write data into the local buffer
|
419
|
-
WriteCSVChunkInternal(context.client, bind_data, local_data.cast_chunk, local_data.
|
419
|
+
WriteCSVChunkInternal(context.client, bind_data, local_data.cast_chunk, local_data.stream, input,
|
420
420
|
local_data.written_anything);
|
421
421
|
|
422
422
|
// check if we should flush what we have currently written
|
423
|
-
auto &writer = local_data.
|
424
|
-
if (writer.
|
425
|
-
global_state.WriteRows(writer.
|
426
|
-
writer.
|
423
|
+
auto &writer = local_data.stream;
|
424
|
+
if (writer.GetPosition() >= csv_data.flush_size) {
|
425
|
+
global_state.WriteRows(writer.GetData(), writer.GetPosition(), csv_data.newline);
|
426
|
+
writer.Rewind();
|
427
427
|
local_data.written_anything = false;
|
428
428
|
}
|
429
429
|
}
|
@@ -436,11 +436,11 @@ static void WriteCSVCombine(ExecutionContext &context, FunctionData &bind_data,
|
|
436
436
|
auto &local_data = lstate.Cast<LocalWriteCSVData>();
|
437
437
|
auto &global_state = gstate.Cast<GlobalWriteCSVData>();
|
438
438
|
auto &csv_data = bind_data.Cast<WriteCSVData>();
|
439
|
-
auto &writer = local_data.
|
439
|
+
auto &writer = local_data.stream;
|
440
440
|
// flush the local writer
|
441
441
|
if (local_data.written_anything) {
|
442
|
-
global_state.WriteRows(writer.
|
443
|
-
writer.
|
442
|
+
global_state.WriteRows(writer.GetData(), writer.GetPosition(), csv_data.newline);
|
443
|
+
writer.Rewind();
|
444
444
|
}
|
445
445
|
}
|
446
446
|
|
@@ -452,13 +452,13 @@ void WriteCSVFinalize(ClientContext &context, FunctionData &bind_data, GlobalFun
|
|
452
452
|
auto &csv_data = bind_data.Cast<WriteCSVData>();
|
453
453
|
auto &options = csv_data.options;
|
454
454
|
|
455
|
-
|
455
|
+
MemoryStream stream;
|
456
456
|
if (!options.suffix.empty()) {
|
457
|
-
|
457
|
+
stream.WriteData(const_data_ptr_cast(options.suffix.c_str()), options.suffix.size());
|
458
458
|
} else if (global_state.written_anything) {
|
459
|
-
|
459
|
+
stream.WriteData(const_data_ptr_cast(csv_data.newline.c_str()), csv_data.newline.size());
|
460
460
|
}
|
461
|
-
global_state.WriteData(
|
461
|
+
global_state.WriteData(stream.GetData(), stream.GetPosition());
|
462
462
|
|
463
463
|
global_state.handle->Close();
|
464
464
|
global_state.handle.reset();
|
@@ -481,7 +481,7 @@ CopyFunctionExecutionMode WriteCSVExecutionMode(bool preserve_insertion_order, b
|
|
481
481
|
//===--------------------------------------------------------------------===//
|
482
482
|
struct WriteCSVBatchData : public PreparedBatchData {
|
483
483
|
//! The thread-local buffer to write data into
|
484
|
-
|
484
|
+
MemoryStream stream;
|
485
485
|
};
|
486
486
|
|
487
487
|
unique_ptr<PreparedBatchData> WriteCSVPrepareBatch(ClientContext &context, FunctionData &bind_data,
|
@@ -499,7 +499,7 @@ unique_ptr<PreparedBatchData> WriteCSVPrepareBatch(ClientContext &context, Funct
|
|
499
499
|
bool written_anything = false;
|
500
500
|
auto batch = make_uniq<WriteCSVBatchData>();
|
501
501
|
for (auto &chunk : collection->Chunks()) {
|
502
|
-
WriteCSVChunkInternal(context, bind_data, cast_chunk, batch->
|
502
|
+
WriteCSVChunkInternal(context, bind_data, cast_chunk, batch->stream, chunk, written_anything);
|
503
503
|
}
|
504
504
|
return std::move(batch);
|
505
505
|
}
|
@@ -512,9 +512,9 @@ void WriteCSVFlushBatch(ClientContext &context, FunctionData &bind_data, GlobalF
|
|
512
512
|
auto &csv_batch = batch.Cast<WriteCSVBatchData>();
|
513
513
|
auto &global_state = gstate.Cast<GlobalWriteCSVData>();
|
514
514
|
auto &csv_data = bind_data.Cast<WriteCSVData>();
|
515
|
-
auto &writer = csv_batch.
|
516
|
-
global_state.WriteRows(writer.
|
517
|
-
writer.
|
515
|
+
auto &writer = csv_batch.stream;
|
516
|
+
global_state.WriteRows(writer.GetData(), writer.GetPosition(), csv_data.newline);
|
517
|
+
writer.Rewind();
|
518
518
|
}
|
519
519
|
|
520
520
|
void CSVCopyFunction::RegisterFunction(BuiltinFunctions &set) {
|
@@ -16,8 +16,8 @@
|
|
16
16
|
#include "duckdb/parser/tableref/table_function_ref.hpp"
|
17
17
|
#include "duckdb/planner/operator/logical_get.hpp"
|
18
18
|
#include "duckdb/main/extension_helper.hpp"
|
19
|
-
#include "duckdb/common/serializer/
|
20
|
-
#include "duckdb/common/serializer/
|
19
|
+
#include "duckdb/common/serializer/serializer.hpp"
|
20
|
+
#include "duckdb/common/serializer/deserializer.hpp"
|
21
21
|
|
22
22
|
#include <limits>
|
23
23
|
|
@@ -1088,182 +1088,15 @@ unique_ptr<NodeStatistics> CSVReaderCardinality(ClientContext &context, const Fu
|
|
1088
1088
|
}
|
1089
1089
|
return make_uniq<NodeStatistics>(bind_data.files.size() * per_file_cardinality);
|
1090
1090
|
}
|
1091
|
-
void CSVStateMachineOptions::Serialize(FieldWriter &writer) const {
|
1092
|
-
writer.WriteField<char>(delimiter);
|
1093
|
-
writer.WriteField<char>(quote);
|
1094
|
-
writer.WriteField<char>(escape);
|
1095
|
-
}
|
1096
|
-
|
1097
|
-
void DialectOptions::Serialize(FieldWriter &writer) const {
|
1098
|
-
state_machine_options.Serialize(writer);
|
1099
|
-
writer.WriteField<bool>(header);
|
1100
|
-
writer.WriteField<idx_t>(num_cols);
|
1101
|
-
writer.WriteField<NewLineIdentifier>(new_line);
|
1102
|
-
writer.WriteField<idx_t>(skip_rows);
|
1103
|
-
vector<string> csv_formats;
|
1104
|
-
for (auto &format : date_format) {
|
1105
|
-
writer.WriteField(has_format.find(format.first)->second);
|
1106
|
-
csv_formats.push_back(format.second.format_specifier);
|
1107
|
-
}
|
1108
|
-
writer.WriteList<string>(csv_formats);
|
1109
|
-
}
|
1110
|
-
void CSVStateMachineOptions::Deserialize(FieldReader &reader) {
|
1111
|
-
delimiter = reader.ReadRequired<char>();
|
1112
|
-
quote = reader.ReadRequired<char>();
|
1113
|
-
escape = reader.ReadRequired<char>();
|
1114
|
-
}
|
1115
|
-
void DialectOptions::Deserialize(FieldReader &reader) {
|
1116
|
-
state_machine_options.Deserialize(reader);
|
1117
|
-
header = reader.ReadRequired<bool>();
|
1118
|
-
num_cols = reader.ReadRequired<idx_t>();
|
1119
|
-
new_line = reader.ReadRequired<NewLineIdentifier>();
|
1120
|
-
skip_rows = reader.ReadRequired<idx_t>();
|
1121
|
-
|
1122
|
-
bool has_date = reader.ReadRequired<bool>();
|
1123
|
-
bool has_timestamp = reader.ReadRequired<bool>();
|
1124
|
-
auto formats = reader.ReadRequiredList<string>();
|
1125
|
-
|
1126
|
-
vector<LogicalTypeId> format_types {LogicalTypeId::DATE, LogicalTypeId::TIMESTAMP};
|
1127
|
-
if (has_date) {
|
1128
|
-
has_format[LogicalTypeId::DATE] = true;
|
1129
|
-
}
|
1130
|
-
if (has_timestamp) {
|
1131
|
-
has_format[LogicalTypeId::TIMESTAMP] = true;
|
1132
|
-
}
|
1133
|
-
for (idx_t f_idx = 0; f_idx < formats.size(); f_idx++) {
|
1134
|
-
auto &format = formats[f_idx];
|
1135
|
-
auto &type = format_types[f_idx];
|
1136
|
-
if (format.empty()) {
|
1137
|
-
continue;
|
1138
|
-
}
|
1139
|
-
StrTimeFormat::ParseFormatSpecifier(format, date_format[type]);
|
1140
|
-
}
|
1141
|
-
}
|
1142
|
-
|
1143
|
-
void CSVReaderOptions::Serialize(FieldWriter &writer) const {
|
1144
|
-
// common options
|
1145
|
-
writer.WriteField<bool>(has_delimiter);
|
1146
|
-
writer.WriteField<bool>(has_quote);
|
1147
|
-
writer.WriteField<bool>(has_escape);
|
1148
|
-
writer.WriteField<bool>(has_header);
|
1149
|
-
writer.WriteField<bool>(ignore_errors);
|
1150
|
-
writer.WriteField<idx_t>(buffer_sample_size);
|
1151
|
-
writer.WriteString(null_str);
|
1152
|
-
writer.WriteField<FileCompressionType>(compression);
|
1153
|
-
writer.WriteField<bool>(allow_quoted_nulls);
|
1154
|
-
// read options
|
1155
|
-
writer.WriteField<bool>(skip_rows_set);
|
1156
|
-
writer.WriteField<idx_t>(maximum_line_size);
|
1157
|
-
writer.WriteField<bool>(normalize_names);
|
1158
|
-
writer.WriteListNoReference<bool>(force_not_null);
|
1159
|
-
writer.WriteField<bool>(all_varchar);
|
1160
|
-
writer.WriteField<idx_t>(sample_chunk_size);
|
1161
|
-
writer.WriteField<idx_t>(sample_chunks);
|
1162
|
-
writer.WriteField<bool>(auto_detect);
|
1163
|
-
writer.WriteString(file_path);
|
1164
|
-
writer.WriteString(decimal_separator);
|
1165
|
-
writer.WriteField<bool>(null_padding);
|
1166
|
-
writer.WriteField<idx_t>(buffer_size);
|
1167
|
-
writer.WriteSerializable(file_options);
|
1168
|
-
// write options
|
1169
|
-
writer.WriteListNoReference<bool>(force_quote);
|
1170
|
-
|
1171
|
-
// reject options
|
1172
|
-
writer.WriteString(rejects_table_name);
|
1173
|
-
writer.WriteField<idx_t>(rejects_limit);
|
1174
|
-
writer.WriteList<string>(rejects_recovery_columns);
|
1175
|
-
writer.WriteList<idx_t>(rejects_recovery_column_ids);
|
1176
|
-
|
1177
|
-
// Serialize Dialect Options
|
1178
|
-
dialect_options.Serialize(writer);
|
1179
|
-
}
|
1180
|
-
|
1181
|
-
void CSVReaderOptions::Deserialize(FieldReader &reader) {
|
1182
|
-
// common options
|
1183
|
-
has_delimiter = reader.ReadRequired<bool>();
|
1184
|
-
has_quote = reader.ReadRequired<bool>();
|
1185
|
-
has_escape = reader.ReadRequired<bool>();
|
1186
|
-
has_header = reader.ReadRequired<bool>();
|
1187
|
-
ignore_errors = reader.ReadRequired<bool>();
|
1188
|
-
buffer_sample_size = reader.ReadRequired<idx_t>();
|
1189
|
-
null_str = reader.ReadRequired<string>();
|
1190
|
-
compression = reader.ReadRequired<FileCompressionType>();
|
1191
|
-
allow_quoted_nulls = reader.ReadRequired<bool>();
|
1192
|
-
// read options
|
1193
|
-
skip_rows_set = reader.ReadRequired<bool>();
|
1194
|
-
maximum_line_size = reader.ReadRequired<idx_t>();
|
1195
|
-
normalize_names = reader.ReadRequired<bool>();
|
1196
|
-
force_not_null = reader.ReadRequiredList<bool>();
|
1197
|
-
all_varchar = reader.ReadRequired<bool>();
|
1198
|
-
sample_chunk_size = reader.ReadRequired<idx_t>();
|
1199
|
-
sample_chunks = reader.ReadRequired<idx_t>();
|
1200
|
-
auto_detect = reader.ReadRequired<bool>();
|
1201
|
-
file_path = reader.ReadRequired<string>();
|
1202
|
-
decimal_separator = reader.ReadRequired<string>();
|
1203
|
-
null_padding = reader.ReadRequired<bool>();
|
1204
|
-
buffer_size = reader.ReadRequired<idx_t>();
|
1205
|
-
file_options = reader.ReadRequiredSerializable<MultiFileReaderOptions, MultiFileReaderOptions>();
|
1206
|
-
// write options
|
1207
|
-
force_quote = reader.ReadRequiredList<bool>();
|
1208
|
-
|
1209
|
-
// rejects options
|
1210
|
-
rejects_table_name = reader.ReadRequired<string>();
|
1211
|
-
rejects_limit = reader.ReadRequired<idx_t>();
|
1212
|
-
rejects_recovery_columns = reader.ReadRequiredList<string>();
|
1213
|
-
rejects_recovery_column_ids = reader.ReadRequiredList<idx_t>();
|
1214
|
-
|
1215
|
-
// dialect options
|
1216
|
-
dialect_options.Deserialize(reader);
|
1217
|
-
}
|
1218
|
-
|
1219
|
-
static void CSVReaderSerialize(FieldWriter &writer, const FunctionData *bind_data_p, const TableFunction &function) {
|
1220
|
-
auto &bind_data = bind_data_p->Cast<ReadCSVData>();
|
1221
|
-
writer.WriteString(function.extra_info);
|
1222
|
-
writer.WriteList<string>(bind_data.files);
|
1223
|
-
writer.WriteRegularSerializableList<LogicalType>(bind_data.csv_types);
|
1224
|
-
writer.WriteList<string>(bind_data.csv_names);
|
1225
|
-
writer.WriteRegularSerializableList<LogicalType>(bind_data.return_types);
|
1226
|
-
writer.WriteList<string>(bind_data.return_names);
|
1227
|
-
writer.WriteField<idx_t>(bind_data.filename_col_idx);
|
1228
|
-
writer.WriteField<idx_t>(bind_data.hive_partition_col_idx);
|
1229
|
-
bind_data.options.Serialize(writer);
|
1230
|
-
writer.WriteField<bool>(bind_data.single_threaded);
|
1231
|
-
writer.WriteSerializable(bind_data.reader_bind);
|
1232
|
-
writer.WriteField<uint32_t>(bind_data.column_info.size());
|
1233
|
-
for (auto &col : bind_data.column_info) {
|
1234
|
-
col.Serialize(writer);
|
1235
|
-
}
|
1236
|
-
}
|
1237
|
-
|
1238
|
-
static unique_ptr<FunctionData> CSVReaderDeserialize(PlanDeserializationState &state, FieldReader &reader,
|
1239
|
-
TableFunction &function) {
|
1240
|
-
function.extra_info = reader.ReadRequired<string>();
|
1241
|
-
auto result_data = make_uniq<ReadCSVData>();
|
1242
|
-
result_data->files = reader.ReadRequiredList<string>();
|
1243
|
-
result_data->csv_types = reader.ReadRequiredSerializableList<LogicalType, LogicalType>();
|
1244
|
-
result_data->csv_names = reader.ReadRequiredList<string>();
|
1245
|
-
result_data->return_types = reader.ReadRequiredSerializableList<LogicalType, LogicalType>();
|
1246
|
-
result_data->return_names = reader.ReadRequiredList<string>();
|
1247
|
-
result_data->filename_col_idx = reader.ReadRequired<idx_t>();
|
1248
|
-
result_data->hive_partition_col_idx = reader.ReadRequired<idx_t>();
|
1249
|
-
result_data->options.Deserialize(reader);
|
1250
|
-
result_data->single_threaded = reader.ReadField<bool>(true);
|
1251
|
-
result_data->reader_bind = reader.ReadRequiredSerializable<MultiFileReaderBindData, MultiFileReaderBindData>();
|
1252
|
-
uint32_t file_number = reader.ReadRequired<uint32_t>();
|
1253
|
-
for (idx_t i = 0; i < file_number; i++) {
|
1254
|
-
result_data->column_info.emplace_back(ColumnInfo::Deserialize(reader));
|
1255
|
-
}
|
1256
|
-
return std::move(result_data);
|
1257
|
-
}
|
1258
1091
|
|
1259
|
-
static void
|
1260
|
-
|
1092
|
+
static void CSVReaderSerialize(Serializer &serializer, const optional_ptr<FunctionData> bind_data_p,
|
1093
|
+
const TableFunction &function) {
|
1261
1094
|
auto &bind_data = bind_data_p->Cast<ReadCSVData>();
|
1262
1095
|
serializer.WriteProperty(100, "extra_info", function.extra_info);
|
1263
1096
|
serializer.WriteProperty(101, "csv_data", &bind_data);
|
1264
1097
|
}
|
1265
1098
|
|
1266
|
-
static unique_ptr<FunctionData>
|
1099
|
+
static unique_ptr<FunctionData> CSVReaderDeserialize(Deserializer &deserializer, TableFunction &function) {
|
1267
1100
|
unique_ptr<ReadCSVData> result;
|
1268
1101
|
deserializer.ReadProperty(100, "extra_info", function.extra_info);
|
1269
1102
|
deserializer.ReadProperty(101, "csv_data", result);
|
@@ -1277,8 +1110,6 @@ TableFunction ReadCSVTableFunction::GetFunction() {
|
|
1277
1110
|
read_csv.pushdown_complex_filter = CSVComplexFilterPushdown;
|
1278
1111
|
read_csv.serialize = CSVReaderSerialize;
|
1279
1112
|
read_csv.deserialize = CSVReaderDeserialize;
|
1280
|
-
read_csv.format_serialize = CSVReaderFormatSerialize;
|
1281
|
-
read_csv.format_deserialize = CSVReaderFormatDeserialize;
|
1282
1113
|
read_csv.get_batch_index = CSVReaderGetBatchIndex;
|
1283
1114
|
read_csv.cardinality = CSVReaderCardinality;
|
1284
1115
|
read_csv.projection_pushdown = true;
|
@@ -1,7 +1,6 @@
|
|
1
1
|
#include "duckdb/function/table/table_scan.hpp"
|
2
2
|
|
3
3
|
#include "duckdb/catalog/catalog_entry/duck_table_entry.hpp"
|
4
|
-
#include "duckdb/common/field_writer.hpp"
|
5
4
|
#include "duckdb/common/mutex.hpp"
|
6
5
|
#include "duckdb/main/client_config.hpp"
|
7
6
|
#include "duckdb/optimizer/matcher/expression_matcher.hpp"
|
@@ -15,8 +14,8 @@
|
|
15
14
|
#include "duckdb/catalog/dependency_list.hpp"
|
16
15
|
#include "duckdb/function/function_set.hpp"
|
17
16
|
#include "duckdb/storage/table/scan_state.hpp"
|
18
|
-
#include "duckdb/common/serializer/
|
19
|
-
#include "duckdb/common/serializer/
|
17
|
+
#include "duckdb/common/serializer/serializer.hpp"
|
18
|
+
#include "duckdb/common/serializer/deserializer.hpp"
|
20
19
|
|
21
20
|
namespace duckdb {
|
22
21
|
|
@@ -417,40 +416,8 @@ string TableScanToString(const FunctionData *bind_data_p) {
|
|
417
416
|
return result;
|
418
417
|
}
|
419
418
|
|
420
|
-
static void TableScanSerialize(
|
421
|
-
|
422
|
-
|
423
|
-
writer.WriteString(bind_data.table.schema.name);
|
424
|
-
writer.WriteString(bind_data.table.name);
|
425
|
-
writer.WriteField<bool>(bind_data.is_index_scan);
|
426
|
-
writer.WriteField<bool>(bind_data.is_create_index);
|
427
|
-
writer.WriteList<row_t>(bind_data.result_ids);
|
428
|
-
writer.WriteString(bind_data.table.schema.catalog.GetName());
|
429
|
-
}
|
430
|
-
|
431
|
-
static unique_ptr<FunctionData> TableScanDeserialize(PlanDeserializationState &state, FieldReader &reader,
|
432
|
-
TableFunction &function) {
|
433
|
-
auto schema_name = reader.ReadRequired<string>();
|
434
|
-
auto table_name = reader.ReadRequired<string>();
|
435
|
-
auto is_index_scan = reader.ReadRequired<bool>();
|
436
|
-
auto is_create_index = reader.ReadRequired<bool>();
|
437
|
-
auto result_ids = reader.ReadRequiredList<row_t>();
|
438
|
-
auto catalog_name = reader.ReadField<string>(INVALID_CATALOG);
|
439
|
-
|
440
|
-
auto &catalog_entry = Catalog::GetEntry<TableCatalogEntry>(state.context, catalog_name, schema_name, table_name);
|
441
|
-
if (catalog_entry.type != CatalogType::TABLE_ENTRY) {
|
442
|
-
throw SerializationException("Cant find table for %s.%s", schema_name, table_name);
|
443
|
-
}
|
444
|
-
|
445
|
-
auto result = make_uniq<TableScanBindData>(catalog_entry.Cast<DuckTableEntry>());
|
446
|
-
result->is_index_scan = is_index_scan;
|
447
|
-
result->is_create_index = is_create_index;
|
448
|
-
result->result_ids = std::move(result_ids);
|
449
|
-
return std::move(result);
|
450
|
-
}
|
451
|
-
|
452
|
-
static void TableScanFormatSerialize(FormatSerializer &serializer, const optional_ptr<FunctionData> bind_data_p,
|
453
|
-
const TableFunction &function) {
|
419
|
+
static void TableScanSerialize(Serializer &serializer, const optional_ptr<FunctionData> bind_data_p,
|
420
|
+
const TableFunction &function) {
|
454
421
|
auto &bind_data = bind_data_p->Cast<TableScanBindData>();
|
455
422
|
serializer.WriteProperty(100, "catalog", bind_data.table.schema.catalog.GetName());
|
456
423
|
serializer.WriteProperty(101, "schema", bind_data.table.schema.name);
|
@@ -460,7 +427,7 @@ static void TableScanFormatSerialize(FormatSerializer &serializer, const optiona
|
|
460
427
|
serializer.WriteProperty(105, "result_ids", bind_data.result_ids);
|
461
428
|
}
|
462
429
|
|
463
|
-
static unique_ptr<FunctionData>
|
430
|
+
static unique_ptr<FunctionData> TableScanDeserialize(Deserializer &deserializer, TableFunction &function) {
|
464
431
|
auto catalog = deserializer.ReadProperty<string>(100, "catalog");
|
465
432
|
auto schema = deserializer.ReadProperty<string>(101, "schema");
|
466
433
|
auto table = deserializer.ReadProperty<string>(102, "table");
|
@@ -491,8 +458,6 @@ TableFunction TableScanFunction::GetIndexScanFunction() {
|
|
491
458
|
scan_function.filter_pushdown = false;
|
492
459
|
scan_function.serialize = TableScanSerialize;
|
493
460
|
scan_function.deserialize = TableScanDeserialize;
|
494
|
-
scan_function.format_serialize = TableScanFormatSerialize;
|
495
|
-
scan_function.format_deserialize = TableScanFormatDeserialize;
|
496
461
|
return scan_function;
|
497
462
|
}
|
498
463
|
|
@@ -513,8 +478,6 @@ TableFunction TableScanFunction::GetFunction() {
|
|
513
478
|
scan_function.filter_prune = true;
|
514
479
|
scan_function.serialize = TableScanSerialize;
|
515
480
|
scan_function.deserialize = TableScanDeserialize;
|
516
|
-
scan_function.format_serialize = TableScanFormatSerialize;
|
517
|
-
scan_function.format_deserialize = TableScanFormatDeserialize;
|
518
481
|
return scan_function;
|
519
482
|
}
|
520
483
|
|
@@ -1,8 +1,8 @@
|
|
1
1
|
#ifndef DUCKDB_VERSION
|
2
|
-
#define DUCKDB_VERSION "0.8.2-
|
2
|
+
#define DUCKDB_VERSION "0.8.2-dev4314"
|
3
3
|
#endif
|
4
4
|
#ifndef DUCKDB_SOURCE_ID
|
5
|
-
#define DUCKDB_SOURCE_ID "
|
5
|
+
#define DUCKDB_SOURCE_ID "84a109bbee"
|
6
6
|
#endif
|
7
7
|
#include "duckdb/function/table/system_functions.hpp"
|
8
8
|
#include "duckdb/main/database.hpp"
|
@@ -18,8 +18,8 @@ TableFunction::TableFunction(string name, vector<LogicalType> arguments, table_f
|
|
18
18
|
init_global(init_global), init_local(init_local), function(function), in_out_function(nullptr),
|
19
19
|
in_out_function_final(nullptr), statistics(nullptr), dependency(nullptr), cardinality(nullptr),
|
20
20
|
pushdown_complex_filter(nullptr), to_string(nullptr), table_scan_progress(nullptr), get_batch_index(nullptr),
|
21
|
-
get_batch_info(nullptr), serialize(nullptr), deserialize(nullptr),
|
22
|
-
|
21
|
+
get_batch_info(nullptr), serialize(nullptr), deserialize(nullptr), projection_pushdown(false),
|
22
|
+
filter_pushdown(false), filter_prune(false) {
|
23
23
|
}
|
24
24
|
|
25
25
|
TableFunction::TableFunction(const vector<LogicalType> &arguments, table_function_t function,
|
@@ -32,8 +32,7 @@ TableFunction::TableFunction()
|
|
32
32
|
init_local(nullptr), function(nullptr), in_out_function(nullptr), statistics(nullptr), dependency(nullptr),
|
33
33
|
cardinality(nullptr), pushdown_complex_filter(nullptr), to_string(nullptr), table_scan_progress(nullptr),
|
34
34
|
get_batch_index(nullptr), get_batch_info(nullptr), serialize(nullptr), deserialize(nullptr),
|
35
|
-
|
36
|
-
filter_prune(false) {
|
35
|
+
projection_pushdown(false), filter_pushdown(false), filter_prune(false) {
|
37
36
|
}
|
38
37
|
|
39
38
|
bool TableFunction::Equal(const TableFunction &rhs) const {
|
@@ -31,14 +31,4 @@ string TableMacroFunction::ToSQL(const string &schema, const string &name) const
|
|
31
31
|
return MacroFunction::ToSQL(schema, name) + StringUtil::Format("TABLE (%s);", query_node->ToString());
|
32
32
|
}
|
33
33
|
|
34
|
-
void TableMacroFunction::SerializeInternal(FieldWriter &writer) const {
|
35
|
-
writer.WriteSerializable(*query_node);
|
36
|
-
}
|
37
|
-
|
38
|
-
unique_ptr<MacroFunction> TableMacroFunction::Deserialize(FieldReader &reader) {
|
39
|
-
auto result = make_uniq<TableMacroFunction>();
|
40
|
-
result->query_node = reader.ReadRequiredSerializable<QueryNode>();
|
41
|
-
return std::move(result);
|
42
|
-
}
|
43
|
-
|
44
34
|
} // namespace duckdb
|