duckdb 0.8.2-dev4126.0 → 0.8.2-dev4203.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.
Files changed (497) hide show
  1. package/binding.gyp +0 -2
  2. package/lib/duckdb.js +3 -3
  3. package/package.json +1 -1
  4. package/src/connection.cpp +9 -8
  5. package/src/database.cpp +5 -8
  6. package/src/duckdb/extension/icu/icu-datepart.cpp +2 -2
  7. package/src/duckdb/extension/icu/icu-strptime.cpp +0 -9
  8. package/src/duckdb/extension/icu/icu_extension.cpp +3 -3
  9. package/src/duckdb/extension/icu/third_party/icu/i18n/unicode/gregocal.h +1 -1
  10. package/src/duckdb/extension/json/buffered_json_reader.cpp +3 -17
  11. package/src/duckdb/extension/json/include/buffered_json_reader.hpp +2 -5
  12. package/src/duckdb/extension/json/include/json_deserializer.hpp +2 -2
  13. package/src/duckdb/extension/json/include/json_scan.hpp +5 -12
  14. package/src/duckdb/extension/json/include/json_serializer.hpp +3 -3
  15. package/src/duckdb/extension/json/include/json_transform.hpp +2 -5
  16. package/src/duckdb/extension/json/json_functions/json_serialize_sql.cpp +1 -1
  17. package/src/duckdb/extension/json/json_functions/json_transform.cpp +2 -18
  18. package/src/duckdb/extension/json/json_scan.cpp +7 -76
  19. package/src/duckdb/extension/json/serialize_json.cpp +8 -8
  20. package/src/duckdb/extension/parquet/column_writer.cpp +46 -45
  21. package/src/duckdb/extension/parquet/include/column_writer.hpp +2 -2
  22. package/src/duckdb/extension/parquet/include/parquet_reader.hpp +2 -5
  23. package/src/duckdb/extension/parquet/include/parquet_rle_bp_encoder.hpp +4 -4
  24. package/src/duckdb/extension/parquet/parquet_extension.cpp +74 -55
  25. package/src/duckdb/extension/parquet/parquet_writer.cpp +3 -2
  26. package/src/duckdb/extension/parquet/serialize_parquet.cpp +4 -4
  27. package/src/duckdb/src/catalog/catalog.cpp +20 -0
  28. package/src/duckdb/src/catalog/catalog_entry/index_catalog_entry.cpp +0 -1
  29. package/src/duckdb/src/catalog/catalog_entry/macro_catalog_entry.cpp +0 -1
  30. package/src/duckdb/src/catalog/catalog_entry/schema_catalog_entry.cpp +0 -1
  31. package/src/duckdb/src/catalog/catalog_entry/sequence_catalog_entry.cpp +0 -1
  32. package/src/duckdb/src/catalog/catalog_entry/table_catalog_entry.cpp +0 -2
  33. package/src/duckdb/src/catalog/catalog_entry/type_catalog_entry.cpp +1 -3
  34. package/src/duckdb/src/catalog/catalog_entry/view_catalog_entry.cpp +0 -1
  35. package/src/duckdb/src/catalog/catalog_entry.cpp +2 -11
  36. package/src/duckdb/src/catalog/catalog_set.cpp +16 -14
  37. package/src/duckdb/src/catalog/default/default_functions.cpp +2 -2
  38. package/src/duckdb/src/common/arrow/arrow_converter.cpp +3 -1
  39. package/src/duckdb/src/common/constants.cpp +0 -1
  40. package/src/duckdb/src/common/enum_util.cpp +0 -10
  41. package/src/duckdb/src/common/exception.cpp +1 -1
  42. package/src/duckdb/src/common/extra_type_info.cpp +20 -192
  43. package/src/duckdb/src/common/multi_file_reader.cpp +0 -68
  44. package/src/duckdb/src/common/serializer/binary_serializer.cpp +9 -4
  45. package/src/duckdb/src/common/serializer/buffered_file_reader.cpp +3 -11
  46. package/src/duckdb/src/common/serializer/buffered_file_writer.cpp +1 -1
  47. package/src/duckdb/src/common/serializer/memory_stream.cpp +61 -0
  48. package/src/duckdb/src/common/serializer/{format_serializer.cpp → serializer.cpp} +2 -2
  49. package/src/duckdb/src/common/types/column/column_data_collection.cpp +4 -4
  50. package/src/duckdb/src/common/types/data_chunk.cpp +11 -43
  51. package/src/duckdb/src/common/types/hyperloglog.cpp +4 -23
  52. package/src/duckdb/src/common/types/interval.cpp +2 -2
  53. package/src/duckdb/src/common/types/value.cpp +10 -135
  54. package/src/duckdb/src/common/types/vector.cpp +17 -149
  55. package/src/duckdb/src/common/types.cpp +2 -20
  56. package/src/duckdb/src/core_functions/aggregate/algebraic/avg.cpp +0 -1
  57. package/src/duckdb/src/core_functions/aggregate/distributive/string_agg.cpp +6 -7
  58. package/src/duckdb/src/core_functions/aggregate/holistic/approximate_quantile.cpp +5 -28
  59. package/src/duckdb/src/core_functions/aggregate/holistic/quantile.cpp +30 -78
  60. package/src/duckdb/src/core_functions/aggregate/holistic/reservoir_quantile.cpp +5 -30
  61. package/src/duckdb/src/core_functions/scalar/date/date_part.cpp +6 -9
  62. package/src/duckdb/src/core_functions/scalar/list/list_aggregates.cpp +21 -16
  63. package/src/duckdb/src/core_functions/scalar/list/list_lambdas.cpp +15 -23
  64. package/src/duckdb/src/function/macro_function.cpp +0 -42
  65. package/src/duckdb/src/function/scalar/compressed_materialization/compress_integral.cpp +10 -8
  66. package/src/duckdb/src/function/scalar/compressed_materialization/compress_string.cpp +13 -12
  67. package/src/duckdb/src/function/scalar/operators/arithmetic.cpp +9 -11
  68. package/src/duckdb/src/function/scalar/system/aggregate_export.cpp +7 -33
  69. package/src/duckdb/src/function/scalar_function.cpp +1 -2
  70. package/src/duckdb/src/function/scalar_macro_function.cpp +0 -10
  71. package/src/duckdb/src/function/table/copy_csv.cpp +38 -38
  72. package/src/duckdb/src/function/table/read_csv.cpp +5 -174
  73. package/src/duckdb/src/function/table/table_scan.cpp +5 -42
  74. package/src/duckdb/src/function/table/version/pragma_version.cpp +2 -2
  75. package/src/duckdb/src/function/table_function.cpp +3 -4
  76. package/src/duckdb/src/function/table_macro_function.cpp +0 -10
  77. package/src/duckdb/src/include/duckdb/catalog/catalog.hpp +1 -0
  78. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/schema_catalog_entry.hpp +0 -2
  79. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/sequence_catalog_entry.hpp +0 -2
  80. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/type_catalog_entry.hpp +0 -2
  81. package/src/duckdb/src/include/duckdb/catalog/catalog_entry.hpp +3 -8
  82. package/src/duckdb/src/include/duckdb/common/constants.hpp +4 -2
  83. package/src/duckdb/src/include/duckdb/common/extra_type_info.hpp +16 -46
  84. package/src/duckdb/src/include/duckdb/common/index_vector.hpp +4 -4
  85. package/src/duckdb/src/include/duckdb/common/multi_file_reader.hpp +2 -6
  86. package/src/duckdb/src/include/duckdb/common/multi_file_reader_options.hpp +0 -4
  87. package/src/duckdb/src/include/duckdb/common/serializer/binary_deserializer.hpp +44 -23
  88. package/src/duckdb/src/include/duckdb/common/serializer/binary_serializer.hpp +31 -23
  89. package/src/duckdb/src/include/duckdb/common/serializer/buffered_file_reader.hpp +4 -6
  90. package/src/duckdb/src/include/duckdb/common/serializer/buffered_file_writer.hpp +3 -3
  91. package/src/duckdb/src/include/duckdb/common/serializer/deserialization_data.hpp +17 -0
  92. package/src/duckdb/src/include/duckdb/common/serializer/{format_deserializer.hpp → deserializer.hpp} +13 -13
  93. package/src/duckdb/src/include/duckdb/common/serializer/memory_stream.hpp +62 -0
  94. package/src/duckdb/src/include/duckdb/common/serializer/read_stream.hpp +38 -0
  95. package/src/duckdb/src/include/duckdb/common/serializer/serialization_traits.hpp +15 -13
  96. package/src/duckdb/src/include/duckdb/common/serializer/{format_serializer.hpp → serializer.hpp} +13 -12
  97. package/src/duckdb/src/include/duckdb/common/serializer/write_stream.hpp +36 -0
  98. package/src/duckdb/src/include/duckdb/common/types/column/column_data_collection.hpp +2 -2
  99. package/src/duckdb/src/include/duckdb/common/types/data_chunk.hpp +3 -8
  100. package/src/duckdb/src/include/duckdb/common/types/hyperloglog.hpp +4 -10
  101. package/src/duckdb/src/include/duckdb/common/types/interval.hpp +4 -4
  102. package/src/duckdb/src/include/duckdb/common/types/value.hpp +1 -5
  103. package/src/duckdb/src/include/duckdb/common/types/vector.hpp +2 -7
  104. package/src/duckdb/src/include/duckdb/common/types.hpp +1 -10
  105. package/src/duckdb/src/include/duckdb/execution/operator/scan/csv/csv_reader_options.hpp +2 -11
  106. package/src/duckdb/src/include/duckdb/function/aggregate_function.hpp +4 -14
  107. package/src/duckdb/src/include/duckdb/function/copy_function.hpp +3 -3
  108. package/src/duckdb/src/include/duckdb/function/function_serialization.hpp +15 -98
  109. package/src/duckdb/src/include/duckdb/function/macro_function.hpp +1 -7
  110. package/src/duckdb/src/include/duckdb/function/scalar/nested_functions.hpp +9 -10
  111. package/src/duckdb/src/include/duckdb/function/scalar/strftime_format.hpp +2 -2
  112. package/src/duckdb/src/include/duckdb/function/scalar_function.hpp +2 -12
  113. package/src/duckdb/src/include/duckdb/function/scalar_macro_function.hpp +2 -7
  114. package/src/duckdb/src/include/duckdb/function/table/read_csv.hpp +4 -16
  115. package/src/duckdb/src/include/duckdb/function/table_function.hpp +2 -11
  116. package/src/duckdb/src/include/duckdb/function/table_macro_function.hpp +2 -7
  117. package/src/duckdb/src/include/duckdb/main/extension_entries.hpp +1 -0
  118. package/src/duckdb/src/include/duckdb/main/extension_helper.hpp +1 -0
  119. package/src/duckdb/src/include/duckdb/parser/column_definition.hpp +1 -4
  120. package/src/duckdb/src/include/duckdb/parser/column_list.hpp +2 -6
  121. package/src/duckdb/src/include/duckdb/parser/common_table_expression_info.hpp +2 -2
  122. package/src/duckdb/src/include/duckdb/parser/constraint.hpp +2 -12
  123. package/src/duckdb/src/include/duckdb/parser/constraints/check_constraint.hpp +2 -5
  124. package/src/duckdb/src/include/duckdb/parser/constraints/foreign_key_constraint.hpp +2 -7
  125. package/src/duckdb/src/include/duckdb/parser/constraints/not_null_constraint.hpp +2 -7
  126. package/src/duckdb/src/include/duckdb/parser/constraints/unique_constraint.hpp +2 -7
  127. package/src/duckdb/src/include/duckdb/parser/expression/between_expression.hpp +2 -5
  128. package/src/duckdb/src/include/duckdb/parser/expression/bound_expression.hpp +1 -4
  129. package/src/duckdb/src/include/duckdb/parser/expression/case_expression.hpp +4 -6
  130. package/src/duckdb/src/include/duckdb/parser/expression/cast_expression.hpp +2 -4
  131. package/src/duckdb/src/include/duckdb/parser/expression/collate_expression.hpp +2 -4
  132. package/src/duckdb/src/include/duckdb/parser/expression/columnref_expression.hpp +2 -4
  133. package/src/duckdb/src/include/duckdb/parser/expression/comparison_expression.hpp +2 -4
  134. package/src/duckdb/src/include/duckdb/parser/expression/conjunction_expression.hpp +2 -4
  135. package/src/duckdb/src/include/duckdb/parser/expression/constant_expression.hpp +2 -5
  136. package/src/duckdb/src/include/duckdb/parser/expression/default_expression.hpp +2 -4
  137. package/src/duckdb/src/include/duckdb/parser/expression/function_expression.hpp +2 -4
  138. package/src/duckdb/src/include/duckdb/parser/expression/lambda_expression.hpp +2 -4
  139. package/src/duckdb/src/include/duckdb/parser/expression/operator_expression.hpp +2 -4
  140. package/src/duckdb/src/include/duckdb/parser/expression/parameter_expression.hpp +2 -4
  141. package/src/duckdb/src/include/duckdb/parser/expression/positional_reference_expression.hpp +2 -4
  142. package/src/duckdb/src/include/duckdb/parser/expression/star_expression.hpp +2 -4
  143. package/src/duckdb/src/include/duckdb/parser/expression/subquery_expression.hpp +2 -4
  144. package/src/duckdb/src/include/duckdb/parser/expression/window_expression.hpp +2 -4
  145. package/src/duckdb/src/include/duckdb/parser/parsed_data/alter_info.hpp +2 -5
  146. package/src/duckdb/src/include/duckdb/parser/parsed_data/alter_scalar_function_info.hpp +0 -2
  147. package/src/duckdb/src/include/duckdb/parser/parsed_data/alter_table_function_info.hpp +0 -2
  148. package/src/duckdb/src/include/duckdb/parser/parsed_data/alter_table_info.hpp +24 -51
  149. package/src/duckdb/src/include/duckdb/parser/parsed_data/attach_info.hpp +1 -4
  150. package/src/duckdb/src/include/duckdb/parser/parsed_data/copy_info.hpp +2 -2
  151. package/src/duckdb/src/include/duckdb/parser/parsed_data/create_collation_info.hpp +0 -3
  152. package/src/duckdb/src/include/duckdb/parser/parsed_data/create_copy_function_info.hpp +0 -3
  153. package/src/duckdb/src/include/duckdb/parser/parsed_data/create_function_info.hpp +0 -5
  154. package/src/duckdb/src/include/duckdb/parser/parsed_data/create_index_info.hpp +2 -7
  155. package/src/duckdb/src/include/duckdb/parser/parsed_data/create_info.hpp +1 -13
  156. package/src/duckdb/src/include/duckdb/parser/parsed_data/create_macro_info.hpp +2 -8
  157. package/src/duckdb/src/include/duckdb/parser/parsed_data/create_schema_info.hpp +2 -12
  158. package/src/duckdb/src/include/duckdb/parser/parsed_data/create_sequence_info.hpp +2 -7
  159. package/src/duckdb/src/include/duckdb/parser/parsed_data/create_table_info.hpp +2 -7
  160. package/src/duckdb/src/include/duckdb/parser/parsed_data/create_type_info.hpp +2 -7
  161. package/src/duckdb/src/include/duckdb/parser/parsed_data/create_view_info.hpp +2 -7
  162. package/src/duckdb/src/include/duckdb/parser/parsed_data/detach_info.hpp +2 -4
  163. package/src/duckdb/src/include/duckdb/parser/parsed_data/drop_info.hpp +2 -5
  164. package/src/duckdb/src/include/duckdb/parser/parsed_data/load_info.hpp +2 -21
  165. package/src/duckdb/src/include/duckdb/parser/parsed_data/parse_info.hpp +2 -2
  166. package/src/duckdb/src/include/duckdb/parser/parsed_data/pragma_info.hpp +2 -2
  167. package/src/duckdb/src/include/duckdb/parser/parsed_data/sample_options.hpp +2 -4
  168. package/src/duckdb/src/include/duckdb/parser/parsed_data/transaction_info.hpp +1 -4
  169. package/src/duckdb/src/include/duckdb/parser/parsed_data/vacuum_info.hpp +5 -7
  170. package/src/duckdb/src/include/duckdb/parser/parsed_expression.hpp +3 -16
  171. package/src/duckdb/src/include/duckdb/parser/query_node/cte_node.hpp +2 -4
  172. package/src/duckdb/src/include/duckdb/parser/query_node/recursive_cte_node.hpp +2 -4
  173. package/src/duckdb/src/include/duckdb/parser/query_node/select_node.hpp +2 -4
  174. package/src/duckdb/src/include/duckdb/parser/query_node/set_operation_node.hpp +2 -4
  175. package/src/duckdb/src/include/duckdb/parser/query_node.hpp +7 -14
  176. package/src/duckdb/src/include/duckdb/parser/result_modifier.hpp +14 -32
  177. package/src/duckdb/src/include/duckdb/parser/statement/select_statement.hpp +4 -9
  178. package/src/duckdb/src/include/duckdb/parser/tableref/basetableref.hpp +2 -6
  179. package/src/duckdb/src/include/duckdb/parser/tableref/emptytableref.hpp +2 -6
  180. package/src/duckdb/src/include/duckdb/parser/tableref/expressionlistref.hpp +2 -6
  181. package/src/duckdb/src/include/duckdb/parser/tableref/joinref.hpp +2 -6
  182. package/src/duckdb/src/include/duckdb/parser/tableref/pivotref.hpp +6 -14
  183. package/src/duckdb/src/include/duckdb/parser/tableref/subqueryref.hpp +2 -6
  184. package/src/duckdb/src/include/duckdb/parser/tableref/table_function_ref.hpp +2 -6
  185. package/src/duckdb/src/include/duckdb/parser/tableref.hpp +2 -10
  186. package/src/duckdb/src/include/duckdb/parser/transformer.hpp +1 -0
  187. package/src/duckdb/src/include/duckdb/planner/bound_constraint.hpp +0 -1
  188. package/src/duckdb/src/include/duckdb/planner/bound_result_modifier.hpp +2 -8
  189. package/src/duckdb/src/include/duckdb/planner/column_binding.hpp +4 -4
  190. package/src/duckdb/src/include/duckdb/planner/expression/bound_aggregate_expression.hpp +2 -4
  191. package/src/duckdb/src/include/duckdb/planner/expression/bound_between_expression.hpp +2 -4
  192. package/src/duckdb/src/include/duckdb/planner/expression/bound_case_expression.hpp +3 -9
  193. package/src/duckdb/src/include/duckdb/planner/expression/bound_cast_expression.hpp +2 -5
  194. package/src/duckdb/src/include/duckdb/planner/expression/bound_columnref_expression.hpp +2 -8
  195. package/src/duckdb/src/include/duckdb/planner/expression/bound_comparison_expression.hpp +2 -4
  196. package/src/duckdb/src/include/duckdb/planner/expression/bound_conjunction_expression.hpp +2 -5
  197. package/src/duckdb/src/include/duckdb/planner/expression/bound_constant_expression.hpp +2 -5
  198. package/src/duckdb/src/include/duckdb/planner/expression/bound_default_expression.hpp +2 -5
  199. package/src/duckdb/src/include/duckdb/planner/expression/bound_function_expression.hpp +2 -5
  200. package/src/duckdb/src/include/duckdb/planner/expression/bound_lambda_expression.hpp +2 -4
  201. package/src/duckdb/src/include/duckdb/planner/expression/bound_lambdaref_expression.hpp +2 -8
  202. package/src/duckdb/src/include/duckdb/planner/expression/bound_operator_expression.hpp +2 -5
  203. package/src/duckdb/src/include/duckdb/planner/expression/bound_parameter_data.hpp +2 -19
  204. package/src/duckdb/src/include/duckdb/planner/expression/bound_parameter_expression.hpp +2 -5
  205. package/src/duckdb/src/include/duckdb/planner/expression/bound_reference_expression.hpp +2 -5
  206. package/src/duckdb/src/include/duckdb/planner/expression/bound_subquery_expression.hpp +0 -3
  207. package/src/duckdb/src/include/duckdb/planner/expression/bound_unnest_expression.hpp +2 -5
  208. package/src/duckdb/src/include/duckdb/planner/expression/bound_window_expression.hpp +2 -5
  209. package/src/duckdb/src/include/duckdb/planner/expression.hpp +2 -14
  210. package/src/duckdb/src/include/duckdb/planner/filter/conjunction_filter.hpp +4 -8
  211. package/src/duckdb/src/include/duckdb/planner/filter/constant_filter.hpp +2 -4
  212. package/src/duckdb/src/include/duckdb/planner/filter/null_filter.hpp +4 -8
  213. package/src/duckdb/src/include/duckdb/planner/joinside.hpp +1 -6
  214. package/src/duckdb/src/include/duckdb/planner/logical_operator.hpp +2 -17
  215. package/src/duckdb/src/include/duckdb/planner/operator/logical_aggregate.hpp +2 -4
  216. package/src/duckdb/src/include/duckdb/planner/operator/logical_any_join.hpp +2 -4
  217. package/src/duckdb/src/include/duckdb/planner/operator/logical_column_data_get.hpp +2 -5
  218. package/src/duckdb/src/include/duckdb/planner/operator/logical_comparison_join.hpp +2 -6
  219. package/src/duckdb/src/include/duckdb/planner/operator/logical_copy_to_file.hpp +2 -4
  220. package/src/duckdb/src/include/duckdb/planner/operator/logical_create.hpp +2 -5
  221. package/src/duckdb/src/include/duckdb/planner/operator/logical_create_index.hpp +2 -5
  222. package/src/duckdb/src/include/duckdb/planner/operator/logical_create_table.hpp +2 -5
  223. package/src/duckdb/src/include/duckdb/planner/operator/logical_cross_product.hpp +2 -5
  224. package/src/duckdb/src/include/duckdb/planner/operator/logical_cteref.hpp +2 -4
  225. package/src/duckdb/src/include/duckdb/planner/operator/logical_delete.hpp +2 -5
  226. package/src/duckdb/src/include/duckdb/planner/operator/logical_delim_get.hpp +2 -4
  227. package/src/duckdb/src/include/duckdb/planner/operator/logical_dependent_join.hpp +0 -1
  228. package/src/duckdb/src/include/duckdb/planner/operator/logical_distinct.hpp +2 -4
  229. package/src/duckdb/src/include/duckdb/planner/operator/logical_dummy_scan.hpp +2 -4
  230. package/src/duckdb/src/include/duckdb/planner/operator/logical_empty_result.hpp +2 -4
  231. package/src/duckdb/src/include/duckdb/planner/operator/logical_execute.hpp +0 -2
  232. package/src/duckdb/src/include/duckdb/planner/operator/logical_explain.hpp +2 -5
  233. package/src/duckdb/src/include/duckdb/planner/operator/logical_export.hpp +0 -3
  234. package/src/duckdb/src/include/duckdb/planner/operator/logical_expression_get.hpp +2 -4
  235. package/src/duckdb/src/include/duckdb/planner/operator/logical_extension_operator.hpp +2 -4
  236. package/src/duckdb/src/include/duckdb/planner/operator/logical_filter.hpp +2 -4
  237. package/src/duckdb/src/include/duckdb/planner/operator/logical_get.hpp +2 -4
  238. package/src/duckdb/src/include/duckdb/planner/operator/logical_insert.hpp +2 -5
  239. package/src/duckdb/src/include/duckdb/planner/operator/logical_join.hpp +0 -2
  240. package/src/duckdb/src/include/duckdb/planner/operator/logical_limit.hpp +2 -5
  241. package/src/duckdb/src/include/duckdb/planner/operator/logical_limit_percent.hpp +2 -5
  242. package/src/duckdb/src/include/duckdb/planner/operator/logical_materialized_cte.hpp +2 -4
  243. package/src/duckdb/src/include/duckdb/planner/operator/logical_order.hpp +2 -5
  244. package/src/duckdb/src/include/duckdb/planner/operator/logical_pivot.hpp +2 -4
  245. package/src/duckdb/src/include/duckdb/planner/operator/logical_positional_join.hpp +2 -5
  246. package/src/duckdb/src/include/duckdb/planner/operator/logical_pragma.hpp +0 -2
  247. package/src/duckdb/src/include/duckdb/planner/operator/logical_prepare.hpp +0 -2
  248. package/src/duckdb/src/include/duckdb/planner/operator/logical_projection.hpp +2 -4
  249. package/src/duckdb/src/include/duckdb/planner/operator/logical_recursive_cte.hpp +2 -4
  250. package/src/duckdb/src/include/duckdb/planner/operator/logical_reset.hpp +2 -5
  251. package/src/duckdb/src/include/duckdb/planner/operator/logical_sample.hpp +2 -5
  252. package/src/duckdb/src/include/duckdb/planner/operator/logical_set.hpp +2 -5
  253. package/src/duckdb/src/include/duckdb/planner/operator/logical_set_operation.hpp +2 -5
  254. package/src/duckdb/src/include/duckdb/planner/operator/logical_show.hpp +2 -5
  255. package/src/duckdb/src/include/duckdb/planner/operator/logical_simple.hpp +2 -5
  256. package/src/duckdb/src/include/duckdb/planner/operator/logical_top_n.hpp +2 -4
  257. package/src/duckdb/src/include/duckdb/planner/operator/logical_unnest.hpp +2 -4
  258. package/src/duckdb/src/include/duckdb/planner/operator/logical_update.hpp +2 -4
  259. package/src/duckdb/src/include/duckdb/planner/operator/logical_window.hpp +2 -4
  260. package/src/duckdb/src/include/duckdb/planner/operator_extension.hpp +1 -3
  261. package/src/duckdb/src/include/duckdb/planner/parsed_data/bound_create_table_info.hpp +0 -5
  262. package/src/duckdb/src/include/duckdb/planner/table_filter.hpp +3 -12
  263. package/src/duckdb/src/include/duckdb/planner/tableref/bound_pivotref.hpp +2 -2
  264. package/src/duckdb/src/include/duckdb/storage/block.hpp +7 -4
  265. package/src/duckdb/src/include/duckdb/storage/checkpoint/row_group_writer.hpp +3 -2
  266. package/src/duckdb/src/include/duckdb/storage/checkpoint/table_data_writer.hpp +6 -6
  267. package/src/duckdb/src/include/duckdb/storage/checkpoint_manager.hpp +18 -18
  268. package/src/duckdb/src/include/duckdb/storage/data_pointer.hpp +6 -0
  269. package/src/duckdb/src/include/duckdb/storage/data_table.hpp +1 -1
  270. package/src/duckdb/src/include/duckdb/storage/metadata/metadata_manager.hpp +4 -5
  271. package/src/duckdb/src/include/duckdb/storage/metadata/metadata_reader.hpp +2 -1
  272. package/src/duckdb/src/include/duckdb/storage/metadata/metadata_writer.hpp +2 -2
  273. package/src/duckdb/src/include/duckdb/storage/statistics/base_statistics.hpp +2 -11
  274. package/src/duckdb/src/include/duckdb/storage/statistics/column_statistics.hpp +3 -5
  275. package/src/duckdb/src/include/duckdb/storage/statistics/distinct_statistics.hpp +3 -11
  276. package/src/duckdb/src/include/duckdb/storage/statistics/list_stats.hpp +2 -7
  277. package/src/duckdb/src/include/duckdb/storage/statistics/node_statistics.hpp +0 -26
  278. package/src/duckdb/src/include/duckdb/storage/statistics/numeric_stats.hpp +2 -7
  279. package/src/duckdb/src/include/duckdb/storage/statistics/string_stats.hpp +2 -7
  280. package/src/duckdb/src/include/duckdb/storage/statistics/struct_stats.hpp +2 -7
  281. package/src/duckdb/src/include/duckdb/storage/storage_info.hpp +4 -6
  282. package/src/duckdb/src/include/duckdb/storage/table/chunk_info.hpp +8 -17
  283. package/src/duckdb/src/include/duckdb/storage/table/column_checkpoint_state.hpp +1 -1
  284. package/src/duckdb/src/include/duckdb/storage/table/column_data.hpp +2 -2
  285. package/src/duckdb/src/include/duckdb/storage/table/list_column_data.hpp +1 -1
  286. package/src/duckdb/src/include/duckdb/storage/table/row_group.hpp +2 -7
  287. package/src/duckdb/src/include/duckdb/storage/table/standard_column_data.hpp +2 -2
  288. package/src/duckdb/src/include/duckdb/storage/table/table_statistics.hpp +4 -7
  289. package/src/duckdb/src/include/duckdb/storage/write_ahead_log.hpp +27 -29
  290. package/src/duckdb/src/include/duckdb/verification/statement_verifier.hpp +0 -2
  291. package/src/duckdb/src/main/client_context.cpp +0 -6
  292. package/src/duckdb/src/main/client_verify.cpp +0 -2
  293. package/src/duckdb/src/main/extension/extension_helper.cpp +18 -0
  294. package/src/duckdb/src/main/extension/extension_install.cpp +5 -3
  295. package/src/duckdb/src/main/extension/extension_load.cpp +3 -3
  296. package/src/duckdb/src/parser/column_definition.cpp +0 -25
  297. package/src/duckdb/src/parser/column_list.cpp +0 -13
  298. package/src/duckdb/src/parser/constraint.cpp +0 -33
  299. package/src/duckdb/src/parser/constraints/check_constraint.cpp +0 -11
  300. package/src/duckdb/src/parser/constraints/foreign_key_constraint.cpp +0 -27
  301. package/src/duckdb/src/parser/constraints/not_null_constraint.cpp +0 -11
  302. package/src/duckdb/src/parser/constraints/unique_constraint.cpp +0 -24
  303. package/src/duckdb/src/parser/expression/between_expression.cpp +2 -16
  304. package/src/duckdb/src/parser/expression/case_expression.cpp +2 -29
  305. package/src/duckdb/src/parser/expression/cast_expression.cpp +2 -16
  306. package/src/duckdb/src/parser/expression/collate_expression.cpp +2 -14
  307. package/src/duckdb/src/parser/expression/columnref_expression.cpp +2 -13
  308. package/src/duckdb/src/parser/expression/comparison_expression.cpp +2 -14
  309. package/src/duckdb/src/parser/expression/conjunction_expression.cpp +2 -13
  310. package/src/duckdb/src/parser/expression/constant_expression.cpp +2 -12
  311. package/src/duckdb/src/parser/expression/default_expression.cpp +2 -9
  312. package/src/duckdb/src/parser/expression/function_expression.cpp +2 -32
  313. package/src/duckdb/src/parser/expression/lambda_expression.cpp +2 -14
  314. package/src/duckdb/src/parser/expression/operator_expression.cpp +2 -13
  315. package/src/duckdb/src/parser/expression/parameter_expression.cpp +2 -13
  316. package/src/duckdb/src/parser/expression/positional_reference_expression.cpp +2 -12
  317. package/src/duckdb/src/parser/expression/star_expression.cpp +2 -43
  318. package/src/duckdb/src/parser/expression/subquery_expression.cpp +2 -28
  319. package/src/duckdb/src/parser/expression/window_expression.cpp +2 -53
  320. package/src/duckdb/src/parser/parsed_data/alter_info.cpp +0 -35
  321. package/src/duckdb/src/parser/parsed_data/alter_scalar_function_info.cpp +0 -18
  322. package/src/duckdb/src/parser/parsed_data/alter_table_function_info.cpp +0 -13
  323. package/src/duckdb/src/parser/parsed_data/alter_table_info.cpp +1 -189
  324. package/src/duckdb/src/parser/parsed_data/attach_info.cpp +0 -29
  325. package/src/duckdb/src/parser/parsed_data/create_collation_info.cpp +0 -4
  326. package/src/duckdb/src/parser/parsed_data/create_copy_function_info.cpp +0 -4
  327. package/src/duckdb/src/parser/parsed_data/create_index_info.cpp +0 -48
  328. package/src/duckdb/src/parser/parsed_data/create_info.cpp +0 -47
  329. package/src/duckdb/src/parser/parsed_data/create_macro_info.cpp +1 -28
  330. package/src/duckdb/src/parser/parsed_data/create_sequence_info.cpp +0 -31
  331. package/src/duckdb/src/parser/parsed_data/create_table_info.cpp +0 -23
  332. package/src/duckdb/src/parser/parsed_data/create_type_info.cpp +0 -22
  333. package/src/duckdb/src/parser/parsed_data/create_view_info.cpp +0 -23
  334. package/src/duckdb/src/parser/parsed_data/detach_info.cpp +0 -19
  335. package/src/duckdb/src/parser/parsed_data/drop_info.cpp +0 -26
  336. package/src/duckdb/src/parser/parsed_data/sample_options.cpp +2 -25
  337. package/src/duckdb/src/parser/parsed_data/transaction_info.cpp +0 -16
  338. package/src/duckdb/src/parser/parsed_data/vacuum_info.cpp +0 -20
  339. package/src/duckdb/src/parser/parsed_expression.cpp +2 -79
  340. package/src/duckdb/src/parser/query_node/cte_node.cpp +2 -19
  341. package/src/duckdb/src/parser/query_node/recursive_cte_node.cpp +2 -21
  342. package/src/duckdb/src/parser/query_node/select_node.cpp +2 -47
  343. package/src/duckdb/src/parser/query_node/set_operation_node.cpp +2 -17
  344. package/src/duckdb/src/parser/query_node.cpp +2 -62
  345. package/src/duckdb/src/parser/result_modifier.cpp +2 -96
  346. package/src/duckdb/src/parser/statement/select_statement.cpp +2 -13
  347. package/src/duckdb/src/parser/tableref/basetableref.cpp +2 -21
  348. package/src/duckdb/src/parser/tableref/emptytableref.cpp +0 -9
  349. package/src/duckdb/src/parser/tableref/expressionlistref.cpp +2 -28
  350. package/src/duckdb/src/parser/tableref/joinref.cpp +2 -23
  351. package/src/duckdb/src/parser/tableref/pivotref.cpp +0 -61
  352. package/src/duckdb/src/parser/tableref/subqueryref.cpp +2 -15
  353. package/src/duckdb/src/parser/tableref/table_function.cpp +2 -17
  354. package/src/duckdb/src/parser/tableref.cpp +2 -52
  355. package/src/duckdb/src/planner/binder/expression/bind_subquery_expression.cpp +1 -4
  356. package/src/duckdb/src/planner/bound_result_modifier.cpp +0 -33
  357. package/src/duckdb/src/planner/expression/bound_aggregate_expression.cpp +6 -30
  358. package/src/duckdb/src/planner/expression/bound_between_expression.cpp +0 -19
  359. package/src/duckdb/src/planner/expression/bound_case_expression.cpp +0 -36
  360. package/src/duckdb/src/planner/expression/bound_cast_expression.cpp +0 -15
  361. package/src/duckdb/src/planner/expression/bound_columnref_expression.cpp +0 -20
  362. package/src/duckdb/src/planner/expression/bound_comparison_expression.cpp +0 -13
  363. package/src/duckdb/src/planner/expression/bound_conjunction_expression.cpp +0 -13
  364. package/src/duckdb/src/planner/expression/bound_constant_expression.cpp +0 -11
  365. package/src/duckdb/src/planner/expression/bound_expression.cpp +1 -5
  366. package/src/duckdb/src/planner/expression/bound_function_expression.cpp +8 -28
  367. package/src/duckdb/src/planner/expression/bound_lambda_expression.cpp +0 -4
  368. package/src/duckdb/src/planner/expression/bound_lambdaref_expression.cpp +0 -23
  369. package/src/duckdb/src/planner/expression/bound_operator_expression.cpp +0 -16
  370. package/src/duckdb/src/planner/expression/bound_parameter_expression.cpp +0 -18
  371. package/src/duckdb/src/planner/expression/bound_reference_expression.cpp +0 -16
  372. package/src/duckdb/src/planner/expression/bound_subquery_expression.cpp +0 -4
  373. package/src/duckdb/src/planner/expression/bound_unnest_expression.cpp +0 -15
  374. package/src/duckdb/src/planner/expression/bound_window_expression.cpp +7 -60
  375. package/src/duckdb/src/planner/expression.cpp +0 -74
  376. package/src/duckdb/src/planner/filter/conjunction_filter.cpp +0 -21
  377. package/src/duckdb/src/planner/filter/constant_filter.cpp +0 -12
  378. package/src/duckdb/src/planner/filter/null_filter.cpp +0 -14
  379. package/src/duckdb/src/planner/joinside.cpp +0 -24
  380. package/src/duckdb/src/planner/logical_operator.cpp +15 -215
  381. package/src/duckdb/src/planner/operator/logical_aggregate.cpp +0 -46
  382. package/src/duckdb/src/planner/operator/logical_any_join.cpp +0 -14
  383. package/src/duckdb/src/planner/operator/logical_column_data_get.cpp +0 -23
  384. package/src/duckdb/src/planner/operator/logical_comparison_join.cpp +0 -23
  385. package/src/duckdb/src/planner/operator/logical_copy_to_file.cpp +2 -56
  386. package/src/duckdb/src/planner/operator/logical_create.cpp +0 -12
  387. package/src/duckdb/src/planner/operator/logical_create_index.cpp +0 -25
  388. package/src/duckdb/src/planner/operator/logical_create_table.cpp +0 -10
  389. package/src/duckdb/src/planner/operator/logical_cross_product.cpp +0 -9
  390. package/src/duckdb/src/planner/operator/logical_cteref.cpp +0 -18
  391. package/src/duckdb/src/planner/operator/logical_delete.cpp +0 -22
  392. package/src/duckdb/src/planner/operator/logical_delim_get.cpp +0 -12
  393. package/src/duckdb/src/planner/operator/logical_dependent_join.cpp +0 -4
  394. package/src/duckdb/src/planner/operator/logical_distinct.cpp +0 -16
  395. package/src/duckdb/src/planner/operator/logical_dummy_scan.cpp +0 -10
  396. package/src/duckdb/src/planner/operator/logical_empty_result.cpp +0 -15
  397. package/src/duckdb/src/planner/operator/logical_expression_get.cpp +0 -24
  398. package/src/duckdb/src/planner/operator/logical_extension_operator.cpp +6 -19
  399. package/src/duckdb/src/planner/operator/logical_filter.cpp +0 -15
  400. package/src/duckdb/src/planner/operator/logical_get.cpp +12 -97
  401. package/src/duckdb/src/planner/operator/logical_insert.cpp +0 -77
  402. package/src/duckdb/src/planner/operator/logical_join.cpp +0 -17
  403. package/src/duckdb/src/planner/operator/logical_limit.cpp +0 -16
  404. package/src/duckdb/src/planner/operator/logical_limit_percent.cpp +0 -16
  405. package/src/duckdb/src/planner/operator/logical_materialized_cte.cpp +0 -13
  406. package/src/duckdb/src/planner/operator/logical_order.cpp +0 -15
  407. package/src/duckdb/src/planner/operator/logical_pivot.cpp +0 -20
  408. package/src/duckdb/src/planner/operator/logical_positional_join.cpp +0 -10
  409. package/src/duckdb/src/planner/operator/logical_pragma.cpp +0 -8
  410. package/src/duckdb/src/planner/operator/logical_prepare.cpp +0 -8
  411. package/src/duckdb/src/planner/operator/logical_projection.cpp +0 -12
  412. package/src/duckdb/src/planner/operator/logical_recursive_cte.cpp +0 -15
  413. package/src/duckdb/src/planner/operator/logical_reset.cpp +0 -12
  414. package/src/duckdb/src/planner/operator/logical_sample.cpp +0 -11
  415. package/src/duckdb/src/planner/operator/logical_set.cpp +0 -14
  416. package/src/duckdb/src/planner/operator/logical_set_operation.cpp +0 -13
  417. package/src/duckdb/src/planner/operator/logical_simple.cpp +0 -60
  418. package/src/duckdb/src/planner/operator/logical_top_n.cpp +0 -14
  419. package/src/duckdb/src/planner/operator/logical_unnest.cpp +0 -14
  420. package/src/duckdb/src/planner/operator/logical_update.cpp +0 -28
  421. package/src/duckdb/src/planner/operator/logical_window.cpp +0 -13
  422. package/src/duckdb/src/planner/planner.cpp +13 -22
  423. package/src/duckdb/src/planner/table_filter.cpp +0 -59
  424. package/src/duckdb/src/storage/checkpoint/row_group_writer.cpp +7 -17
  425. package/src/duckdb/src/storage/checkpoint/table_data_reader.cpp +7 -4
  426. package/src/duckdb/src/storage/checkpoint/table_data_writer.cpp +24 -22
  427. package/src/duckdb/src/storage/checkpoint_manager.cpp +203 -180
  428. package/src/duckdb/src/storage/data_table.cpp +2 -2
  429. package/src/duckdb/src/storage/metadata/metadata_manager.cpp +11 -9
  430. package/src/duckdb/src/storage/serialization/serialize_constraint.cpp +20 -20
  431. package/src/duckdb/src/storage/serialization/serialize_create_info.cpp +46 -42
  432. package/src/duckdb/src/storage/serialization/serialize_expression.cpp +63 -63
  433. package/src/duckdb/src/storage/serialization/serialize_logical_operator.cpp +167 -165
  434. package/src/duckdb/src/storage/serialization/serialize_macro_function.cpp +12 -12
  435. package/src/duckdb/src/storage/serialization/serialize_nodes.cpp +54 -54
  436. package/src/duckdb/src/storage/serialization/serialize_parse_info.cpp +88 -88
  437. package/src/duckdb/src/storage/serialization/serialize_parsed_expression.cpp +72 -72
  438. package/src/duckdb/src/storage/serialization/serialize_query_node.cpp +20 -20
  439. package/src/duckdb/src/storage/serialization/serialize_result_modifier.cpp +22 -22
  440. package/src/duckdb/src/storage/serialization/serialize_statement.cpp +4 -4
  441. package/src/duckdb/src/storage/serialization/serialize_storage.cpp +41 -6
  442. package/src/duckdb/src/storage/serialization/serialize_table_filter.cpp +24 -24
  443. package/src/duckdb/src/storage/serialization/serialize_tableref.cpp +32 -32
  444. package/src/duckdb/src/storage/serialization/serialize_types.cpp +29 -29
  445. package/src/duckdb/src/storage/single_file_block_manager.cpp +17 -22
  446. package/src/duckdb/src/storage/statistics/base_statistics.cpp +31 -85
  447. package/src/duckdb/src/storage/statistics/column_statistics.cpp +6 -19
  448. package/src/duckdb/src/storage/statistics/distinct_statistics.cpp +0 -26
  449. package/src/duckdb/src/storage/statistics/list_stats.cpp +6 -22
  450. package/src/duckdb/src/storage/statistics/numeric_stats.cpp +20 -135
  451. package/src/duckdb/src/storage/statistics/string_stats.cpp +5 -28
  452. package/src/duckdb/src/storage/statistics/struct_stats.cpp +8 -30
  453. package/src/duckdb/src/storage/storage_info.cpp +1 -1
  454. package/src/duckdb/src/storage/table/chunk_info.cpp +9 -88
  455. package/src/duckdb/src/storage/table/column_checkpoint_state.cpp +2 -2
  456. package/src/duckdb/src/storage/table/column_data.cpp +20 -25
  457. package/src/duckdb/src/storage/table/list_column_data.cpp +16 -9
  458. package/src/duckdb/src/storage/table/row_group.cpp +16 -92
  459. package/src/duckdb/src/storage/table/row_group_collection.cpp +5 -1
  460. package/src/duckdb/src/storage/table/standard_column_data.cpp +10 -7
  461. package/src/duckdb/src/storage/table/struct_column_data.cpp +17 -11
  462. package/src/duckdb/src/storage/table/table_statistics.cpp +13 -22
  463. package/src/duckdb/src/storage/wal_replay.cpp +108 -106
  464. package/src/duckdb/src/storage/write_ahead_log.cpp +135 -64
  465. package/src/duckdb/src/transaction/commit_state.cpp +22 -8
  466. package/src/duckdb/src/verification/deserialized_statement_verifier.cpp +11 -6
  467. package/src/duckdb/src/verification/statement_verifier.cpp +0 -5
  468. package/src/duckdb/third_party/parquet/parquet_types.h +1 -1
  469. package/src/duckdb/ub_src_common.cpp +0 -4
  470. package/src/duckdb/ub_src_common_serializer.cpp +2 -4
  471. package/src/duckdb/ub_src_planner.cpp +0 -2
  472. package/src/duckdb/ub_src_planner_expression.cpp +0 -2
  473. package/src/duckdb/ub_src_planner_operator.cpp +0 -8
  474. package/src/duckdb_node.cpp +6 -12
  475. package/src/duckdb_node.hpp +23 -13
  476. package/src/statement.cpp +15 -16
  477. package/test/database_fail.test.ts +20 -0
  478. package/test/worker.js +7 -0
  479. package/src/duckdb/src/common/field_writer.cpp +0 -97
  480. package/src/duckdb/src/common/serializer/buffered_deserializer.cpp +0 -27
  481. package/src/duckdb/src/common/serializer/buffered_serializer.cpp +0 -36
  482. package/src/duckdb/src/common/serializer.cpp +0 -24
  483. package/src/duckdb/src/include/duckdb/common/field_writer.hpp +0 -379
  484. package/src/duckdb/src/include/duckdb/common/serializer/buffered_deserializer.hpp +0 -41
  485. package/src/duckdb/src/include/duckdb/common/serializer/buffered_serializer.hpp +0 -50
  486. package/src/duckdb/src/include/duckdb/common/serializer.hpp +0 -151
  487. package/src/duckdb/src/include/duckdb/planner/plan_serialization.hpp +0 -44
  488. package/src/duckdb/src/include/duckdb/verification/deserialized_statement_verifier_v2.hpp +0 -32
  489. package/src/duckdb/src/planner/expression/bound_default_expression.cpp +0 -16
  490. package/src/duckdb/src/planner/operator/logical_execute.cpp +0 -12
  491. package/src/duckdb/src/planner/operator/logical_explain.cpp +0 -22
  492. package/src/duckdb/src/planner/operator/logical_export.cpp +0 -13
  493. package/src/duckdb/src/planner/operator/logical_show.cpp +0 -21
  494. package/src/duckdb/src/planner/parsed_data/bound_create_table_info.cpp +0 -22
  495. package/src/duckdb/src/planner/plan_serialization.cpp +0 -20
  496. package/src/duckdb/src/verification/deserialized_statement_verifier_v2.cpp +0 -34
  497. package/src/duckdb/ub_src_planner_parsed_data.cpp +0 -2
@@ -0,0 +1,38 @@
1
+ //===----------------------------------------------------------------------===//
2
+ // DuckDB
3
+ //
4
+ // duckdb/common/serializer/read_stream.hpp
5
+ //
6
+ //
7
+ //===----------------------------------------------------------------------===//
8
+
9
+ #pragma once
10
+
11
+ #include "duckdb/catalog/catalog.hpp"
12
+ #include "duckdb/common/common.hpp"
13
+ #include "duckdb/common/exception.hpp"
14
+ #include "duckdb/common/vector.hpp"
15
+ #include <type_traits>
16
+
17
+ namespace duckdb {
18
+
19
+ class ReadStream {
20
+ public:
21
+ // Reads a set amount of data from the stream into the specified buffer and moves the stream forward accordingly
22
+ virtual void ReadData(data_ptr_t buffer, idx_t read_size) = 0;
23
+
24
+ // Reads a type from the stream and moves the stream forward sizeof(T) bytes
25
+ // The type must be a standard layout type
26
+ template <class T>
27
+ T Read() {
28
+ static_assert(std::is_standard_layout<T>(), "Read element must be a standard layout data type");
29
+ T value;
30
+ ReadData(data_ptr_cast(&value), sizeof(T));
31
+ return value;
32
+ }
33
+
34
+ virtual ~ReadStream() {
35
+ }
36
+ };
37
+
38
+ } // namespace duckdb
@@ -7,10 +7,12 @@
7
7
  #include "duckdb/common/unordered_set.hpp"
8
8
  #include "duckdb/common/set.hpp"
9
9
  #include "duckdb/common/shared_ptr.hpp"
10
+ #include "duckdb/common/unique_ptr.hpp"
11
+
10
12
  namespace duckdb {
11
13
 
12
- class FormatSerializer; // Forward declare
13
- class FormatDeserializer; // Forward declare
14
+ class Serializer; // Forward declare
15
+ class Deserializer; // Forward declare
14
16
 
15
17
  typedef uint16_t field_id_t;
16
18
  const field_id_t MESSAGE_TERMINATOR_FIELD_ID = 0xFFFF;
@@ -19,34 +21,34 @@ const field_id_t MESSAGE_TERMINATOR_FIELD_ID = 0xFFFF;
19
21
  template <class...>
20
22
  using void_t = void;
21
23
 
22
- // Check for anything implementing a `void FormatSerialize(FormatSerializer &FormatSerializer)` method
24
+ // Check for anything implementing a `void Serialize(Serializer &Serializer)` method
23
25
  template <typename T, typename = T>
24
26
  struct has_serialize : std::false_type {};
25
27
  template <typename T>
26
28
  struct has_serialize<
27
29
  T, typename std::enable_if<
28
- std::is_same<decltype(std::declval<T>().FormatSerialize(std::declval<FormatSerializer &>())), void>::value,
29
- T>::type> : std::true_type {};
30
+ std::is_same<decltype(std::declval<T>().Serialize(std::declval<Serializer &>())), void>::value, T>::type>
31
+ : std::true_type {};
30
32
 
31
33
  template <typename T, typename = T>
32
34
  struct has_deserialize : std::false_type {};
33
35
 
34
- // Accept `static unique_ptr<T> FormatDeserialize(FormatDeserializer& deserializer)`
36
+ // Accept `static unique_ptr<T> Deserialize(Deserializer& deserializer)`
35
37
  template <typename T>
36
38
  struct has_deserialize<
37
- T, typename std::enable_if<std::is_same<decltype(T::FormatDeserialize), unique_ptr<T>(FormatDeserializer &)>::value,
38
- T>::type> : std::true_type {};
39
+ T, typename std::enable_if<std::is_same<decltype(T::Deserialize), unique_ptr<T>(Deserializer &)>::value, T>::type>
40
+ : std::true_type {};
39
41
 
40
- // Accept `static shared_ptr<T> FormatDeserialize(FormatDeserializer& deserializer)`
42
+ // Accept `static shared_ptr<T> Deserialize(Deserializer& deserializer)`
41
43
  template <typename T>
42
44
  struct has_deserialize<
43
- T, typename std::enable_if<std::is_same<decltype(T::FormatDeserialize), shared_ptr<T>(FormatDeserializer &)>::value,
44
- T>::type> : std::true_type {};
45
+ T, typename std::enable_if<std::is_same<decltype(T::Deserialize), shared_ptr<T>(Deserializer &)>::value, T>::type>
46
+ : std::true_type {};
45
47
 
46
- // Accept `static T FormatDeserialize(FormatDeserializer& deserializer)`
48
+ // Accept `static T Deserialize(Deserializer& deserializer)`
47
49
  template <typename T>
48
50
  struct has_deserialize<
49
- T, typename std::enable_if<std::is_same<decltype(T::FormatDeserialize), T(FormatDeserializer &)>::value, T>::type>
51
+ T, typename std::enable_if<std::is_same<decltype(T::Deserialize), T(Deserializer &)>::value, T>::type>
50
52
  : std::true_type {};
51
53
 
52
54
  // Check if T is a vector, and provide access to the inner type
@@ -1,7 +1,7 @@
1
1
  //===----------------------------------------------------------------------===//
2
2
  // DuckDB
3
3
  //
4
- // duckdb/common/serializer/format_serializer.hpp
4
+ // duckdb/common/serializer/serializer.hpp
5
5
  //
6
6
  //
7
7
  //===----------------------------------------------------------------------===//
@@ -9,8 +9,6 @@
9
9
  #pragma once
10
10
 
11
11
  #include "duckdb/common/enum_util.hpp"
12
- #include "duckdb/common/field_writer.hpp"
13
- #include "duckdb/common/serializer.hpp"
14
12
  #include "duckdb/common/serializer/serialization_traits.hpp"
15
13
  #include "duckdb/common/types/interval.hpp"
16
14
  #include "duckdb/common/types/string_type.hpp"
@@ -19,18 +17,21 @@
19
17
 
20
18
  namespace duckdb {
21
19
 
22
- class FormatSerializer {
20
+ class Serializer {
23
21
  protected:
24
22
  bool serialize_enum_as_string = false;
25
23
  bool serialize_default_values = false;
26
24
 
27
25
  public:
26
+ virtual ~Serializer() {
27
+ }
28
+
28
29
  class List {
29
- friend FormatSerializer;
30
+ friend Serializer;
30
31
 
31
32
  private:
32
- FormatSerializer &serializer;
33
- explicit List(FormatSerializer &serializer) : serializer(serializer) {
33
+ Serializer &serializer;
34
+ explicit List(Serializer &serializer) : serializer(serializer) {
34
35
  }
35
36
 
36
37
  public:
@@ -223,11 +224,11 @@ protected:
223
224
  OnListEnd();
224
225
  }
225
226
 
226
- // class or struct implementing `FormatSerialize(FormatSerializer& FormatSerializer)`;
227
+ // class or struct implementing `Serialize(Serializer& Serializer)`;
227
228
  template <typename T>
228
229
  typename std::enable_if<has_serialize<T>::value>::type WriteValue(const T &value) {
229
230
  OnObjectBegin();
230
- value.FormatSerialize(*this);
231
+ value.Serialize(*this);
231
232
  OnObjectEnd();
232
233
  }
233
234
 
@@ -275,18 +276,18 @@ protected:
275
276
 
276
277
  // We need to special case vector<bool> because elements of vector<bool> cannot be referenced
277
278
  template <>
278
- void FormatSerializer::WriteValue(const vector<bool> &vec);
279
+ void Serializer::WriteValue(const vector<bool> &vec);
279
280
 
280
281
  // List Impl
281
282
  template <class FUNC>
282
- void FormatSerializer::List::WriteObject(FUNC f) {
283
+ void Serializer::List::WriteObject(FUNC f) {
283
284
  serializer.OnObjectBegin();
284
285
  f(serializer);
285
286
  serializer.OnObjectEnd();
286
287
  }
287
288
 
288
289
  template <class T>
289
- void FormatSerializer::List::WriteElement(const T &value) {
290
+ void Serializer::List::WriteElement(const T &value) {
290
291
  serializer.WriteValue(value);
291
292
  }
292
293
 
@@ -0,0 +1,36 @@
1
+ //===----------------------------------------------------------------------===//
2
+ // DuckDB
3
+ //
4
+ // duckdb/common/serializer/write_stream.hpp
5
+ //
6
+ //
7
+ //===----------------------------------------------------------------------===//
8
+
9
+ #pragma once
10
+
11
+ #include "duckdb/catalog/catalog.hpp"
12
+ #include "duckdb/common/common.hpp"
13
+ #include "duckdb/common/exception.hpp"
14
+ #include "duckdb/common/vector.hpp"
15
+ #include <type_traits>
16
+
17
+ namespace duckdb {
18
+
19
+ class WriteStream {
20
+ public:
21
+ // Writes a set amount of data from the specified buffer into the stream and moves the stream forward accordingly
22
+ virtual void WriteData(const_data_ptr_t buffer, idx_t write_size) = 0;
23
+
24
+ // Writes a type into the stream and moves the stream forward sizeof(T) bytes
25
+ // The type must be a standard layout type
26
+ template <class T>
27
+ void Write(T element) {
28
+ static_assert(std::is_standard_layout<T>(), "Write element must be a standard layout data type");
29
+ WriteData(const_data_ptr_cast(&element), sizeof(T));
30
+ }
31
+
32
+ virtual ~WriteStream() {
33
+ }
34
+ };
35
+
36
+ } // namespace duckdb
@@ -154,8 +154,8 @@ public:
154
154
  //! Get a vector of the segments in this ColumnDataCollection
155
155
  const vector<unique_ptr<ColumnDataCollectionSegment>> &GetSegments() const;
156
156
 
157
- void FormatSerialize(FormatSerializer &serializer) const;
158
- static unique_ptr<ColumnDataCollection> FormatDeserialize(FormatDeserializer &deserializer);
157
+ void Serialize(Serializer &serializer) const;
158
+ static unique_ptr<ColumnDataCollection> Deserialize(Deserializer &deserializer);
159
159
 
160
160
  private:
161
161
  //! Creates a new segment within the ColumnDataCollection
@@ -19,8 +19,8 @@ class Allocator;
19
19
  class ClientContext;
20
20
  class ExecutionContext;
21
21
  class VectorCache;
22
- class FormatSerializer;
23
- class FormatDeserializer;
22
+ class Serializer;
23
+ class Deserializer;
24
24
 
25
25
  //! A Data Chunk represents a set of vectors.
26
26
  /*!
@@ -138,14 +138,9 @@ public:
138
138
  //! Vector to point back to the data owned by this DataChunk.
139
139
  DUCKDB_API void Reset();
140
140
 
141
- //! Serializes a DataChunk to a stand-alone binary blob
142
- DUCKDB_API void Serialize(Serializer &serializer);
143
- //! Deserializes a blob back into a DataChunk
141
+ DUCKDB_API void Serialize(Serializer &serializer) const;
144
142
  DUCKDB_API void Deserialize(Deserializer &source);
145
143
 
146
- DUCKDB_API void FormatSerialize(FormatSerializer &serializer) const;
147
- DUCKDB_API void FormatDeserialize(FormatDeserializer &source);
148
-
149
144
  //! Hashes the DataChunk to the target vector
150
145
  DUCKDB_API void Hash(Vector &result);
151
146
  //! Hashes specific vectors of the DataChunk to the target vector
@@ -20,11 +20,8 @@ namespace duckdb {
20
20
 
21
21
  enum class HLLStorageType : uint8_t { UNCOMPRESSED = 1 };
22
22
 
23
- class FieldWriter;
24
- class FieldReader;
25
-
26
- class FormatSerializer;
27
- class FormatDeserializer;
23
+ class Serializer;
24
+ class Deserializer;
28
25
 
29
26
  //! The HyperLogLog class holds a HyperLogLog counter for approximate cardinality counting
30
27
  class HyperLogLog {
@@ -49,12 +46,9 @@ public:
49
46
  data_ptr_t GetPtr() const;
50
47
  //! Get copy of the HLL
51
48
  unique_ptr<HyperLogLog> Copy();
52
- //! (De)Serialize the HLL
53
- void Serialize(FieldWriter &writer) const;
54
- static unique_ptr<HyperLogLog> Deserialize(FieldReader &reader);
55
49
 
56
- void FormatSerialize(FormatSerializer &serializer) const;
57
- static unique_ptr<HyperLogLog> FormatDeserialize(FormatDeserializer &deserializer);
50
+ void Serialize(Serializer &serializer) const;
51
+ static unique_ptr<HyperLogLog> Deserialize(Deserializer &deserializer);
58
52
 
59
53
  public:
60
54
  //! Compute HLL hashes over vdata, and store them in 'hashes'
@@ -16,8 +16,8 @@ struct dtime_t;
16
16
  struct date_t;
17
17
  struct timestamp_t;
18
18
 
19
- class FormatSerializer;
20
- class FormatDeserializer;
19
+ class Serializer;
20
+ class Deserializer;
21
21
 
22
22
  struct interval_t {
23
23
  int32_t months;
@@ -29,8 +29,8 @@ struct interval_t {
29
29
  }
30
30
 
31
31
  // Serialization
32
- void FormatSerialize(FormatSerializer &serializer) const;
33
- static interval_t FormatDeserialize(FormatDeserializer &source);
32
+ void Serialize(Serializer &serializer) const;
33
+ static interval_t Deserialize(Deserializer &source);
34
34
  };
35
35
 
36
36
  //! The Interval class is a static class that holds helper functions for the Interval
@@ -20,8 +20,6 @@
20
20
  namespace duckdb {
21
21
 
22
22
  class CastFunctionSet;
23
- class Deserializer;
24
- class Serializer;
25
23
  struct GetCastFunctionInput;
26
24
  struct ExtraValueInfo;
27
25
 
@@ -225,10 +223,8 @@ public:
225
223
 
226
224
  //! Serializes a Value to a stand-alone binary blob
227
225
  DUCKDB_API void Serialize(Serializer &serializer) const;
228
- DUCKDB_API void FormatSerialize(FormatSerializer &serializer) const;
229
- DUCKDB_API static Value FormatDeserialize(FormatDeserializer &deserializer);
230
226
  //! Deserializes a Value from a blob
231
- DUCKDB_API static Value Deserialize(Deserializer &source);
227
+ DUCKDB_API static Value Deserialize(Deserializer &deserializer);
232
228
 
233
229
  //===--------------------------------------------------------------------===//
234
230
  // Comparison Operators
@@ -173,13 +173,8 @@ public:
173
173
  //! This functions resizes the vector
174
174
  DUCKDB_API void Resize(idx_t cur_size, idx_t new_size);
175
175
 
176
- //! Serializes a Vector to a stand-alone binary blob
177
- DUCKDB_API void Serialize(idx_t count, Serializer &serializer);
178
- //! Deserializes a blob back into a Vector
179
- DUCKDB_API void Deserialize(idx_t count, Deserializer &source);
180
-
181
- DUCKDB_API void FormatSerialize(FormatSerializer &serializer, idx_t count);
182
- DUCKDB_API void FormatDeserialize(FormatDeserializer &deserializer, idx_t count);
176
+ DUCKDB_API void Serialize(Serializer &serializer, idx_t count);
177
+ DUCKDB_API void Deserialize(Deserializer &deserializer, idx_t count);
183
178
 
184
179
  // Getters
185
180
  inline VectorType GetVectorType() const {
@@ -17,15 +17,12 @@
17
17
 
18
18
  namespace duckdb {
19
19
 
20
- class FormatSerializer;
21
- class FormatDeserializer;
22
20
  class Serializer;
23
21
  class Deserializer;
24
22
  class Value;
25
23
  class TypeCatalogEntry;
26
24
  class Vector;
27
25
  class ClientContext;
28
- class FieldWriter;
29
26
 
30
27
  struct string_t;
31
28
 
@@ -283,14 +280,8 @@ struct LogicalType {
283
280
  return !(*this == rhs);
284
281
  }
285
282
 
286
- //! Serializes a LogicalType to a stand-alone binary blob
287
283
  DUCKDB_API void Serialize(Serializer &serializer) const;
288
-
289
- //! Deserializes a blob back into an LogicalType
290
- DUCKDB_API static LogicalType Deserialize(Deserializer &source);
291
-
292
- DUCKDB_API void FormatSerialize(FormatSerializer &serializer) const;
293
- DUCKDB_API static LogicalType FormatDeserialize(FormatDeserializer &deserializer);
284
+ DUCKDB_API static LogicalType Deserialize(Deserializer &deserializer);
294
285
 
295
286
 
296
287
  static bool TypeIsTimestamp(LogicalTypeId id) {
@@ -12,7 +12,6 @@
12
12
  #include "duckdb/common/map.hpp"
13
13
  #include "duckdb/function/scalar/strftime_format.hpp"
14
14
  #include "duckdb/common/types/value.hpp"
15
- #include "duckdb/common/field_writer.hpp"
16
15
  #include "duckdb/common/case_insensitive_map.hpp"
17
16
  #include "duckdb/common/types.hpp"
18
17
  #include "duckdb/common/multi_file_reader_options.hpp"
@@ -45,9 +44,6 @@ struct CSVStateMachineOptions {
45
44
  bool operator==(const CSVStateMachineOptions &other) const {
46
45
  return delimiter == other.delimiter && quote == other.quote && escape == other.escape;
47
46
  }
48
-
49
- void Serialize(FieldWriter &writer) const;
50
- void Deserialize(FieldReader &reader);
51
47
  };
52
48
 
53
49
  struct DialectOptions {
@@ -66,9 +62,6 @@ struct DialectOptions {
66
62
  idx_t skip_rows = 0;
67
63
  //! True start of the first CSV Buffer (After skipping empty lines, headers, notes and so on)
68
64
  idx_t true_start = 0;
69
-
70
- void Serialize(FieldWriter &writer) const;
71
- void Deserialize(FieldReader &reader);
72
65
  };
73
66
 
74
67
  struct CSVReaderOptions {
@@ -169,10 +162,8 @@ struct CSVReaderOptions {
169
162
  //! The date format to use for writing (if any is specified)
170
163
  map<LogicalTypeId, StrfTimeFormat> write_date_format = {{LogicalTypeId::DATE, {}}, {LogicalTypeId::TIMESTAMP, {}}};
171
164
 
172
- void Serialize(FieldWriter &writer) const;
173
- void Deserialize(FieldReader &reader);
174
- void FormatSerialize(FormatSerializer &serializer) const;
175
- static CSVReaderOptions FormatDeserialize(FormatDeserializer &deserializer);
165
+ void Serialize(Serializer &serializer) const;
166
+ static CSVReaderOptions Deserialize(Deserializer &deserializer);
176
167
 
177
168
  void SetCompression(const string &compression);
178
169
  void SetHeader(bool has_header);
@@ -46,15 +46,9 @@ typedef void (*aggregate_window_t)(Vector inputs[], const ValidityMask &filter_m
46
46
  const FrameBounds &frame, const FrameBounds &prev, Vector &result, idx_t rid,
47
47
  idx_t bias);
48
48
 
49
- typedef void (*aggregate_serialize_t)(FieldWriter &writer, const FunctionData *bind_data,
49
+ typedef void (*aggregate_serialize_t)(Serializer &serializer, const optional_ptr<FunctionData> bind_data,
50
50
  const AggregateFunction &function);
51
- typedef unique_ptr<FunctionData> (*aggregate_deserialize_t)(PlanDeserializationState &context, FieldReader &reader,
52
- AggregateFunction &function);
53
-
54
- typedef void (*aggregate_format_serialize_t)(FormatSerializer &serializer, const optional_ptr<FunctionData> bind_data,
55
- const AggregateFunction &function);
56
- typedef unique_ptr<FunctionData> (*aggregate_format_deserialize_t)(FormatDeserializer &deserializer,
57
- AggregateFunction &function);
51
+ typedef unique_ptr<FunctionData> (*aggregate_deserialize_t)(Deserializer &deserializer, AggregateFunction &function);
58
52
 
59
53
  class AggregateFunction : public BaseScalarFunction {
60
54
  public:
@@ -70,8 +64,7 @@ public:
70
64
  LogicalType(LogicalTypeId::INVALID), null_handling),
71
65
  state_size(state_size), initialize(initialize), update(update), combine(combine), finalize(finalize),
72
66
  simple_update(simple_update), window(window), bind(bind), destructor(destructor), statistics(statistics),
73
- serialize(serialize), deserialize(deserialize), format_serialize(nullptr), format_deserialize(nullptr),
74
- order_dependent(AggregateOrderDependent::ORDER_DEPENDENT) {
67
+ serialize(serialize), deserialize(deserialize), order_dependent(AggregateOrderDependent::ORDER_DEPENDENT) {
75
68
  }
76
69
 
77
70
  AggregateFunction(const string &name, const vector<LogicalType> &arguments, const LogicalType &return_type,
@@ -85,8 +78,7 @@ public:
85
78
  LogicalType(LogicalTypeId::INVALID)),
86
79
  state_size(state_size), initialize(initialize), update(update), combine(combine), finalize(finalize),
87
80
  simple_update(simple_update), window(window), bind(bind), destructor(destructor), statistics(statistics),
88
- serialize(serialize), deserialize(deserialize), format_serialize(nullptr), format_deserialize(nullptr),
89
- order_dependent(AggregateOrderDependent::ORDER_DEPENDENT) {
81
+ serialize(serialize), deserialize(deserialize), order_dependent(AggregateOrderDependent::ORDER_DEPENDENT) {
90
82
  }
91
83
 
92
84
  AggregateFunction(const vector<LogicalType> &arguments, const LogicalType &return_type, aggregate_size_t state_size,
@@ -137,8 +129,6 @@ public:
137
129
 
138
130
  aggregate_serialize_t serialize;
139
131
  aggregate_deserialize_t deserialize;
140
- aggregate_format_serialize_t format_serialize;
141
- aggregate_format_deserialize_t format_deserialize;
142
132
  //! Whether or not the aggregate is order dependent
143
133
  AggregateOrderDependent order_dependent;
144
134
 
@@ -82,10 +82,10 @@ typedef void (*copy_to_combine_t)(ExecutionContext &context, FunctionData &bind_
82
82
  LocalFunctionData &lstate);
83
83
  typedef void (*copy_to_finalize_t)(ClientContext &context, FunctionData &bind_data, GlobalFunctionData &gstate);
84
84
 
85
- typedef void (*copy_to_serialize_t)(FieldWriter &writer, const FunctionData &bind_data, const CopyFunction &function);
85
+ typedef void (*copy_to_serialize_t)(Serializer &serializer, const FunctionData &bind_data,
86
+ const CopyFunction &function);
86
87
 
87
- typedef unique_ptr<FunctionData> (*copy_to_deserialize_t)(ClientContext &context, FieldReader &reader,
88
- CopyFunction &function);
88
+ typedef unique_ptr<FunctionData> (*copy_to_deserialize_t)(Deserializer &deserializer, CopyFunction &function);
89
89
 
90
90
  typedef unique_ptr<FunctionData> (*copy_from_bind_t)(ClientContext &context, CopyInfo &info,
91
91
  vector<string> &expected_names,
@@ -8,111 +8,27 @@
8
8
 
9
9
  #pragma once
10
10
 
11
- #include "duckdb/common/field_writer.hpp"
12
11
  #include "duckdb/main/client_context.hpp"
13
12
  #include "duckdb/catalog/catalog_entry/table_function_catalog_entry.hpp"
14
- #include "duckdb/common/serializer/format_serializer.hpp"
15
- #include "duckdb/common/serializer/format_deserializer.hpp"
13
+ #include "duckdb/common/serializer/serializer.hpp"
14
+ #include "duckdb/common/serializer/deserializer.hpp"
16
15
 
17
16
  namespace duckdb {
18
17
 
19
18
  class FunctionSerializer {
20
19
  public:
21
20
  template <class FUNC>
22
- static void SerializeBase(FieldWriter &writer, const FUNC &function, FunctionData *bind_info) {
23
- D_ASSERT(!function.name.empty());
24
- writer.WriteString(function.name);
25
- writer.WriteRegularSerializableList(function.arguments);
26
- writer.WriteRegularSerializableList(function.original_arguments);
27
- bool serialize = function.serialize;
28
- writer.WriteField(serialize);
29
- if (serialize) {
30
- function.serialize(writer, bind_info, function);
31
- // First check if serialize throws a NotImplementedException, in which case it doesn't require a deserialize
32
- // function
33
- D_ASSERT(function.deserialize);
34
- }
35
- }
36
-
37
- template <class FUNC>
38
- static void Serialize(FieldWriter &writer, const FUNC &function, const LogicalType &return_type,
39
- const vector<unique_ptr<Expression>> &children, FunctionData *bind_info) {
40
- SerializeBase(writer, function, bind_info);
41
- writer.WriteSerializable(return_type);
42
- writer.WriteSerializableList(children);
43
- }
44
-
45
- template <class FUNC, class CATALOG_ENTRY>
46
- static FUNC DeserializeBaseInternal(FieldReader &reader, PlanDeserializationState &state, CatalogType type,
47
- unique_ptr<FunctionData> &bind_info, bool &has_deserialize) {
48
- auto &context = state.context;
49
- auto name = reader.ReadRequired<string>();
50
- auto arguments = reader.ReadRequiredSerializableList<LogicalType, LogicalType>();
51
- // note: original_arguments are optional (can be list of size 0)
52
- auto original_arguments = reader.ReadRequiredSerializableList<LogicalType, LogicalType>();
53
-
54
- auto &func_catalog = Catalog::GetEntry(context, type, SYSTEM_CATALOG, DEFAULT_SCHEMA, name);
55
- if (func_catalog.type != type) {
56
- throw InternalException("Cant find catalog entry for function %s", name);
57
- }
58
-
59
- auto &functions = func_catalog.Cast<CATALOG_ENTRY>();
60
- auto function = functions.functions.GetFunctionByArguments(
61
- state.context, original_arguments.empty() ? arguments : original_arguments);
62
- function.arguments = std::move(arguments);
63
- function.original_arguments = std::move(original_arguments);
64
-
65
- has_deserialize = reader.ReadRequired<bool>();
66
- if (has_deserialize) {
67
- if (!function.deserialize) {
68
- throw SerializationException("Function requires deserialization but no deserialization function for %s",
69
- function.name);
70
- }
71
- bind_info = function.deserialize(state, reader, function);
72
- } else {
73
- D_ASSERT(!function.serialize);
74
- D_ASSERT(!function.deserialize);
75
- }
76
- return function;
77
- }
78
- template <class FUNC, class CATALOG_ENTRY>
79
- static FUNC DeserializeBase(FieldReader &reader, PlanDeserializationState &state, CatalogType type,
80
- unique_ptr<FunctionData> &bind_info) {
81
- bool has_deserialize;
82
- return DeserializeBaseInternal<FUNC, CATALOG_ENTRY>(reader, state, type, bind_info, has_deserialize);
83
- }
84
-
85
- template <class FUNC, class CATALOG_ENTRY>
86
- static FUNC Deserialize(FieldReader &reader, ExpressionDeserializationState &state, CatalogType type,
87
- vector<unique_ptr<Expression>> &children, unique_ptr<FunctionData> &bind_info) {
88
- bool has_deserialize;
89
- auto function =
90
- DeserializeBaseInternal<FUNC, CATALOG_ENTRY>(reader, state.gstate, type, bind_info, has_deserialize);
91
- auto return_type = reader.ReadRequiredSerializable<LogicalType, LogicalType>();
92
- children = reader.ReadRequiredSerializableList<Expression>(state.gstate);
93
-
94
- // we re-bind the function only if the function did not have an explicit deserialize method
95
- auto &context = state.gstate.context;
96
- if (!has_deserialize && function.bind) {
97
- bind_info = function.bind(context, function, children);
98
- }
99
- function.return_type = return_type;
100
- return function;
101
- }
102
-
103
- template <class FUNC>
104
- static void FormatSerialize(FormatSerializer &serializer, const FUNC &function,
105
- optional_ptr<FunctionData> bind_info) {
21
+ static void Serialize(Serializer &serializer, const FUNC &function, optional_ptr<FunctionData> bind_info) {
106
22
  D_ASSERT(!function.name.empty());
107
23
  serializer.WriteProperty(500, "name", function.name);
108
24
  serializer.WriteProperty(501, "arguments", function.arguments);
109
25
  serializer.WriteProperty(502, "original_arguments", function.original_arguments);
110
- bool has_serialize = function.format_serialize;
26
+ bool has_serialize = function.serialize;
111
27
  serializer.WriteProperty(503, "has_serialize", has_serialize);
112
28
  if (has_serialize) {
113
29
  serializer.WriteObject(504, "function_data",
114
- [&](FormatSerializer &obj) { function.format_serialize(obj, bind_info, function); });
115
- D_ASSERT(function.format_deserialize);
30
+ [&](Serializer &obj) { function.serialize(obj, bind_info, function); });
31
+ D_ASSERT(function.deserialize);
116
32
  }
117
33
  }
118
34
 
@@ -132,7 +48,7 @@ public:
132
48
  }
133
49
 
134
50
  template <class FUNC, class CATALOG_ENTRY>
135
- static pair<FUNC, bool> FormatDeserializeBase(FormatDeserializer &deserializer, CatalogType catalog_type) {
51
+ static pair<FUNC, bool> DeserializeBase(Deserializer &deserializer, CatalogType catalog_type) {
136
52
  auto &context = deserializer.Get<ClientContext &>();
137
53
  auto name = deserializer.ReadProperty<string>(500, "name");
138
54
  auto arguments = deserializer.ReadProperty<vector<LogicalType>>(501, "arguments");
@@ -144,23 +60,23 @@ public:
144
60
  }
145
61
 
146
62
  template <class FUNC>
147
- static unique_ptr<FunctionData> FunctionDeserialize(FormatDeserializer &deserializer, FUNC &function) {
148
- if (!function.format_deserialize) {
63
+ static unique_ptr<FunctionData> FunctionDeserialize(Deserializer &deserializer, FUNC &function) {
64
+ if (!function.deserialize) {
149
65
  throw SerializationException("Function requires deserialization but no deserialization function for %s",
150
66
  function.name);
151
67
  }
152
68
  unique_ptr<FunctionData> result;
153
69
  deserializer.ReadObject(504, "function_data",
154
- [&](FormatDeserializer &obj) { result = function.format_deserialize(obj, function); });
70
+ [&](Deserializer &obj) { result = function.deserialize(obj, function); });
155
71
  return result;
156
72
  }
157
73
 
158
74
  template <class FUNC, class CATALOG_ENTRY>
159
- static pair<FUNC, unique_ptr<FunctionData>> FormatDeserialize(FormatDeserializer &deserializer,
160
- CatalogType catalog_type,
161
- vector<unique_ptr<Expression>> &children) {
75
+ static pair<FUNC, unique_ptr<FunctionData>> Deserialize(Deserializer &deserializer, CatalogType catalog_type,
76
+ vector<unique_ptr<Expression>> &children,
77
+ LogicalType return_type) {
162
78
  auto &context = deserializer.Get<ClientContext &>();
163
- auto entry = FormatDeserializeBase<FUNC, CATALOG_ENTRY>(deserializer, catalog_type);
79
+ auto entry = DeserializeBase<FUNC, CATALOG_ENTRY>(deserializer, catalog_type);
164
80
  auto &function = entry.first;
165
81
  auto has_serialize = entry.second;
166
82
 
@@ -175,6 +91,7 @@ public:
175
91
  throw SerializationException("Error during bind of function in deserialization: %s", ex.what());
176
92
  }
177
93
  }
94
+ function.return_type = std::move(return_type);
178
95
  return make_pair(std::move(function), std::move(bind_data));
179
96
  }
180
97
  };