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
@@ -1,13 +1,12 @@
1
1
  #include "duckdb/common/exception.hpp"
2
- #include "duckdb/common/field_writer.hpp"
3
2
  #include "duckdb/common/string_util.hpp"
4
3
  #include "duckdb/common/types/vector.hpp"
5
4
  #include "duckdb/storage/statistics/base_statistics.hpp"
6
5
  #include "duckdb/storage/statistics/list_stats.hpp"
7
6
  #include "duckdb/storage/statistics/struct_stats.hpp"
8
7
 
9
- #include "duckdb/common/serializer/format_serializer.hpp"
10
- #include "duckdb/common/serializer/format_deserializer.hpp"
8
+ #include "duckdb/common/serializer/serializer.hpp"
9
+ #include "duckdb/common/serializer/deserializer.hpp"
11
10
 
12
11
  namespace duckdb {
13
12
 
@@ -275,59 +274,30 @@ void BaseStatistics::SetDistinctCount(idx_t count) {
275
274
  }
276
275
 
277
276
  void BaseStatistics::Serialize(Serializer &serializer) const {
278
- FieldWriter writer(serializer);
279
- writer.WriteField<bool>(has_null);
280
- writer.WriteField<bool>(has_no_null);
281
- writer.WriteField<idx_t>(distinct_count);
282
- Serialize(writer);
283
- writer.Finalize();
284
- }
285
-
286
- void BaseStatistics::Serialize(FieldWriter &writer) const {
287
- switch (GetStatsType()) {
288
- case StatisticsType::NUMERIC_STATS:
289
- NumericStats::Serialize(*this, writer);
290
- break;
291
- case StatisticsType::STRING_STATS:
292
- StringStats::Serialize(*this, writer);
293
- break;
294
- case StatisticsType::LIST_STATS:
295
- ListStats::Serialize(*this, writer);
296
- break;
297
- case StatisticsType::STRUCT_STATS:
298
- StructStats::Serialize(*this, writer);
299
- break;
300
- default:
301
- break;
302
- }
303
- }
304
-
305
- void BaseStatistics::FormatSerialize(FormatSerializer &serializer) const {
306
277
  serializer.WriteProperty(100, "has_null", has_null);
307
278
  serializer.WriteProperty(101, "has_no_null", has_no_null);
308
279
  serializer.WriteProperty(102, "distinct_count", distinct_count);
309
- serializer.WriteProperty(103, "stats_type", GetStatsType());
310
- serializer.WriteObject(104, "stats", [this](FormatSerializer &serializer) {
280
+ serializer.WriteObject(103, "type_stats", [&](Serializer &serializer) {
311
281
  switch (GetStatsType()) {
312
282
  case StatisticsType::NUMERIC_STATS:
313
- NumericStats::FormatSerialize(*this, serializer);
283
+ NumericStats::Serialize(*this, serializer);
314
284
  break;
315
285
  case StatisticsType::STRING_STATS:
316
- StringStats::FormatSerialize(*this, serializer);
286
+ StringStats::Serialize(*this, serializer);
317
287
  break;
318
288
  case StatisticsType::LIST_STATS:
319
- ListStats::FormatSerialize(*this, serializer);
289
+ ListStats::Serialize(*this, serializer);
320
290
  break;
321
291
  case StatisticsType::STRUCT_STATS:
322
- StructStats::FormatSerialize(*this, serializer);
292
+ StructStats::Serialize(*this, serializer);
323
293
  break;
324
294
  default:
325
- throw NotImplementedException("Unrecognized StatisticsType for BaseStatistics::FormatSerialize");
295
+ break;
326
296
  }
327
297
  });
328
298
  }
329
299
 
330
- BaseStatistics BaseStatistics::FormatDeserialize(FormatDeserializer &deserializer) {
300
+ BaseStatistics BaseStatistics::Deserialize(Deserializer &deserializer) {
331
301
  auto has_null = deserializer.ReadProperty<bool>(100, "has_null");
332
302
  auto has_no_null = deserializer.ReadProperty<bool>(101, "has_no_null");
333
303
  auto distinct_count = deserializer.ReadProperty<idx_t>(102, "distinct_count");
@@ -335,58 +305,34 @@ BaseStatistics BaseStatistics::FormatDeserialize(FormatDeserializer &deserialize
335
305
  // Get the logical type from the deserializer context.
336
306
  auto type = deserializer.Get<LogicalType &>();
337
307
 
338
- BaseStatistics stats;
339
- switch (GetStatsType(type)) {
340
- case StatisticsType::NUMERIC_STATS:
341
- stats = NumericStats::FormatDeserialize(deserializer, type);
342
- break;
343
- case StatisticsType::STRING_STATS:
344
- stats = StringStats::FormatDeserialize(deserializer, type);
345
- break;
346
- case StatisticsType::LIST_STATS:
347
- stats = ListStats::FormatDeserialize(deserializer, type);
348
- break;
349
- case StatisticsType::STRUCT_STATS:
350
- stats = StructStats::FormatDeserialize(deserializer, type);
351
- break;
352
- default:
353
- stats = BaseStatistics(std::move(type));
354
- break;
355
- }
308
+ auto stats_type = GetStatsType(type);
309
+
310
+ BaseStatistics stats(std::move(type));
356
311
 
357
312
  stats.has_null = has_null;
358
313
  stats.has_no_null = has_no_null;
359
314
  stats.distinct_count = distinct_count;
360
315
 
361
- return stats;
362
- }
363
-
364
- BaseStatistics BaseStatistics::DeserializeType(FieldReader &reader, LogicalType type) {
365
- switch (GetStatsType(type)) {
366
- case StatisticsType::NUMERIC_STATS:
367
- return NumericStats::Deserialize(reader, std::move(type));
368
- case StatisticsType::STRING_STATS:
369
- return StringStats::Deserialize(reader, std::move(type));
370
- case StatisticsType::LIST_STATS:
371
- return ListStats::Deserialize(reader, std::move(type));
372
- case StatisticsType::STRUCT_STATS:
373
- return StructStats::Deserialize(reader, std::move(type));
374
- default:
375
- return BaseStatistics(std::move(type));
376
- }
377
- }
316
+ deserializer.ReadObject(103, "type_stats", [&](Deserializer &obj) {
317
+ switch (stats_type) {
318
+ case StatisticsType::NUMERIC_STATS:
319
+ NumericStats::Deserialize(obj, stats);
320
+ break;
321
+ case StatisticsType::STRING_STATS:
322
+ StringStats::Deserialize(obj, stats);
323
+ break;
324
+ case StatisticsType::LIST_STATS:
325
+ ListStats::Deserialize(obj, stats);
326
+ break;
327
+ case StatisticsType::STRUCT_STATS:
328
+ StructStats::Deserialize(obj, stats);
329
+ break;
330
+ default:
331
+ break;
332
+ }
333
+ });
378
334
 
379
- BaseStatistics BaseStatistics::Deserialize(Deserializer &source, LogicalType type) {
380
- FieldReader reader(source);
381
- bool has_null = reader.ReadRequired<bool>();
382
- bool has_no_null = reader.ReadRequired<bool>();
383
- idx_t distinct_count = reader.ReadRequired<idx_t>();
384
- auto result = DeserializeType(reader, std::move(type));
385
- result.has_null = has_null;
386
- result.has_no_null = has_no_null;
387
- result.distinct_count = distinct_count;
388
- reader.Finalize();
389
- return result;
335
+ return stats;
390
336
  }
391
337
 
392
338
  string BaseStatistics::ToString() const {
@@ -1,7 +1,6 @@
1
1
  #include "duckdb/storage/statistics/column_statistics.hpp"
2
- #include "duckdb/common/serializer.hpp"
3
- #include "duckdb/common/serializer/format_deserializer.hpp"
4
- #include "duckdb/common/serializer/format_serializer.hpp"
2
+ #include "duckdb/common/serializer/deserializer.hpp"
3
+ #include "duckdb/common/serializer/serializer.hpp"
5
4
 
6
5
  namespace duckdb {
7
6
 
@@ -55,29 +54,17 @@ void ColumnStatistics::UpdateDistinctStatistics(Vector &v, idx_t count) {
55
54
  shared_ptr<ColumnStatistics> ColumnStatistics::Copy() const {
56
55
  return make_shared<ColumnStatistics>(stats.Copy(), distinct_stats ? distinct_stats->Copy() : nullptr);
57
56
  }
58
- void ColumnStatistics::Serialize(Serializer &serializer) const {
59
- stats.Serialize(serializer);
60
- serializer.WriteOptional(distinct_stats);
61
- }
62
57
 
63
- shared_ptr<ColumnStatistics> ColumnStatistics::Deserialize(Deserializer &source, const LogicalType &type) {
64
- auto stats = BaseStatistics::Deserialize(source, type);
65
- auto distinct_stats = source.ReadOptional<DistinctStatistics>();
66
- return make_shared<ColumnStatistics>(stats.Copy(), std::move(distinct_stats));
67
- }
68
-
69
- void ColumnStatistics::FormatSerialize(FormatSerializer &serializer) const {
58
+ void ColumnStatistics::Serialize(Serializer &serializer) const {
70
59
  serializer.WriteProperty(100, "statistics", stats);
71
60
  serializer.WritePropertyWithDefault(101, "distinct", distinct_stats, unique_ptr<DistinctStatistics>());
72
61
  }
73
62
 
74
- shared_ptr<ColumnStatistics> ColumnStatistics::FormatDeserialize(FormatDeserializer &deserializer) {
75
- // TODO: do we read this as an property or into the object itself?
76
- // we have this sort of pseudo inheritance going on here which is annoying
77
- auto stats = BaseStatistics::FormatDeserialize(deserializer);
63
+ shared_ptr<ColumnStatistics> ColumnStatistics::Deserialize(Deserializer &deserializer) {
64
+ auto stats = deserializer.ReadProperty<BaseStatistics>(100, "statistics");
78
65
  auto distinct_stats = deserializer.ReadPropertyWithDefault<unique_ptr<DistinctStatistics>>(
79
66
  101, "distinct", unique_ptr<DistinctStatistics>());
80
- return make_shared<ColumnStatistics>(stats.Copy(), std::move(distinct_stats));
67
+ return make_shared<ColumnStatistics>(std::move(stats), std::move(distinct_stats));
81
68
  }
82
69
 
83
70
  } // namespace duckdb
@@ -1,6 +1,5 @@
1
1
  #include "duckdb/storage/statistics/distinct_statistics.hpp"
2
2
 
3
- #include "duckdb/common/field_writer.hpp"
4
3
  #include "duckdb/common/string_util.hpp"
5
4
 
6
5
  #include <math.h>
@@ -24,31 +23,6 @@ void DistinctStatistics::Merge(const DistinctStatistics &other) {
24
23
  total_count += other.total_count;
25
24
  }
26
25
 
27
- void DistinctStatistics::Serialize(Serializer &serializer) const {
28
- FieldWriter writer(serializer);
29
- Serialize(writer);
30
- writer.Finalize();
31
- }
32
-
33
- void DistinctStatistics::Serialize(FieldWriter &writer) const {
34
- writer.WriteField<idx_t>(sample_count);
35
- writer.WriteField<idx_t>(total_count);
36
- log->Serialize(writer);
37
- }
38
-
39
- unique_ptr<DistinctStatistics> DistinctStatistics::Deserialize(Deserializer &source) {
40
- FieldReader reader(source);
41
- auto result = Deserialize(reader);
42
- reader.Finalize();
43
- return result;
44
- }
45
-
46
- unique_ptr<DistinctStatistics> DistinctStatistics::Deserialize(FieldReader &reader) {
47
- auto sample_count = reader.ReadRequired<idx_t>();
48
- auto total_count = reader.ReadRequired<idx_t>();
49
- return make_uniq<DistinctStatistics>(HyperLogLog::Deserialize(reader), sample_count, total_count);
50
- }
51
-
52
26
  void DistinctStatistics::Update(Vector &v, idx_t count, bool sample) {
53
27
  UnifiedVectorFormat vdata;
54
28
  v.ToUnifiedFormat(count, vdata);
@@ -1,11 +1,10 @@
1
1
  #include "duckdb/storage/statistics/list_stats.hpp"
2
2
  #include "duckdb/storage/statistics/base_statistics.hpp"
3
- #include "duckdb/common/field_writer.hpp"
4
3
  #include "duckdb/common/string_util.hpp"
5
4
  #include "duckdb/common/types/vector.hpp"
6
5
 
7
- #include "duckdb/common/serializer/format_serializer.hpp"
8
- #include "duckdb/common/serializer/format_deserializer.hpp"
6
+ #include "duckdb/common/serializer/serializer.hpp"
7
+ #include "duckdb/common/serializer/deserializer.hpp"
9
8
 
10
9
  namespace duckdb {
11
10
 
@@ -69,35 +68,20 @@ void ListStats::Merge(BaseStatistics &stats, const BaseStatistics &other) {
69
68
  child_stats.Merge(other_child_stats);
70
69
  }
71
70
 
72
- void ListStats::Serialize(const BaseStatistics &stats, FieldWriter &writer) {
73
- auto &child_stats = ListStats::GetChildStats(stats);
74
- writer.WriteSerializable(child_stats);
75
- }
76
-
77
- BaseStatistics ListStats::Deserialize(FieldReader &reader, LogicalType type) {
78
- D_ASSERT(type.InternalType() == PhysicalType::LIST);
79
- auto &child_type = ListType::GetChildType(type);
80
- BaseStatistics result(std::move(type));
81
- result.child_stats[0].Copy(reader.ReadRequiredSerializable<BaseStatistics, BaseStatistics>(child_type));
82
- return result;
83
- }
84
-
85
- void ListStats::FormatSerialize(const BaseStatistics &stats, FormatSerializer &serializer) {
71
+ void ListStats::Serialize(const BaseStatistics &stats, Serializer &serializer) {
86
72
  auto &child_stats = ListStats::GetChildStats(stats);
87
73
  serializer.WriteProperty(200, "child_stats", child_stats);
88
74
  }
89
75
 
90
- BaseStatistics ListStats::FormatDeserialize(FormatDeserializer &deserializer, LogicalType type) {
76
+ void ListStats::Deserialize(Deserializer &deserializer, BaseStatistics &base) {
77
+ auto &type = base.GetType();
91
78
  D_ASSERT(type.InternalType() == PhysicalType::LIST);
92
79
  auto &child_type = ListType::GetChildType(type);
93
- BaseStatistics result(std::move(type));
94
80
 
95
81
  // Push the logical type of the child type to the deserialization context
96
82
  deserializer.Set<LogicalType &>(const_cast<LogicalType &>(child_type));
97
- result.child_stats[0].Copy(deserializer.ReadProperty<BaseStatistics>(200, "child_stats"));
83
+ base.child_stats[0].Copy(deserializer.ReadProperty<BaseStatistics>(200, "child_stats"));
98
84
  deserializer.Unset<LogicalType>();
99
-
100
- return result;
101
85
  }
102
86
 
103
87
  string ListStats::ToString(const BaseStatistics &stats) {
@@ -1,11 +1,10 @@
1
1
  #include "duckdb/storage/statistics/numeric_stats.hpp"
2
2
  #include "duckdb/storage/statistics/base_statistics.hpp"
3
- #include "duckdb/common/field_writer.hpp"
4
3
  #include "duckdb/common/types/vector.hpp"
5
4
  #include "duckdb/common/operator/comparison_operators.hpp"
6
5
 
7
- #include "duckdb/common/serializer/format_serializer.hpp"
8
- #include "duckdb/common/serializer/format_deserializer.hpp"
6
+ #include "duckdb/common/serializer/serializer.hpp"
7
+ #include "duckdb/common/serializer/deserializer.hpp"
9
8
 
10
9
  namespace duckdb {
11
10
 
@@ -407,119 +406,7 @@ Value NumericStats::MaxOrNull(const BaseStatistics &stats) {
407
406
  }
408
407
 
409
408
  static void SerializeNumericStatsValue(const LogicalType &type, NumericValueUnion val, bool has_value,
410
- FieldWriter &writer) {
411
- writer.WriteField<bool>(!has_value);
412
- if (!has_value) {
413
- return;
414
- }
415
- switch (type.InternalType()) {
416
- case PhysicalType::BOOL:
417
- writer.WriteField<bool>(val.value_.boolean);
418
- break;
419
- case PhysicalType::INT8:
420
- writer.WriteField<int8_t>(val.value_.tinyint);
421
- break;
422
- case PhysicalType::INT16:
423
- writer.WriteField<int16_t>(val.value_.smallint);
424
- break;
425
- case PhysicalType::INT32:
426
- writer.WriteField<int32_t>(val.value_.integer);
427
- break;
428
- case PhysicalType::INT64:
429
- writer.WriteField<int64_t>(val.value_.bigint);
430
- break;
431
- case PhysicalType::UINT8:
432
- writer.WriteField<int8_t>(val.value_.utinyint);
433
- break;
434
- case PhysicalType::UINT16:
435
- writer.WriteField<int16_t>(val.value_.usmallint);
436
- break;
437
- case PhysicalType::UINT32:
438
- writer.WriteField<int32_t>(val.value_.uinteger);
439
- break;
440
- case PhysicalType::UINT64:
441
- writer.WriteField<int64_t>(val.value_.ubigint);
442
- break;
443
- case PhysicalType::INT128:
444
- writer.WriteField<hugeint_t>(val.value_.hugeint);
445
- break;
446
- case PhysicalType::FLOAT:
447
- writer.WriteField<float>(val.value_.float_);
448
- break;
449
- case PhysicalType::DOUBLE:
450
- writer.WriteField<double>(val.value_.double_);
451
- break;
452
- default:
453
- throw InternalException("Unsupported type for serializing numeric statistics");
454
- }
455
- }
456
-
457
- void NumericStats::Serialize(const BaseStatistics &stats, FieldWriter &writer) {
458
- auto &numeric_stats = NumericStats::GetDataUnsafe(stats);
459
- SerializeNumericStatsValue(stats.GetType(), numeric_stats.min, numeric_stats.has_min, writer);
460
- SerializeNumericStatsValue(stats.GetType(), numeric_stats.max, numeric_stats.has_max, writer);
461
- }
462
-
463
- void DeserializeNumericStatsValue(const LogicalType &type, FieldReader &reader, NumericValueUnion &result,
464
- bool &has_stats) {
465
- auto is_null = reader.ReadRequired<bool>();
466
- if (is_null) {
467
- has_stats = false;
468
- return;
469
- }
470
- has_stats = true;
471
- switch (type.InternalType()) {
472
- case PhysicalType::BOOL:
473
- result.value_.boolean = reader.ReadRequired<bool>();
474
- break;
475
- case PhysicalType::INT8:
476
- result.value_.tinyint = reader.ReadRequired<int8_t>();
477
- break;
478
- case PhysicalType::INT16:
479
- result.value_.smallint = reader.ReadRequired<int16_t>();
480
- break;
481
- case PhysicalType::INT32:
482
- result.value_.integer = reader.ReadRequired<int32_t>();
483
- break;
484
- case PhysicalType::INT64:
485
- result.value_.bigint = reader.ReadRequired<int64_t>();
486
- break;
487
- case PhysicalType::UINT8:
488
- result.value_.utinyint = reader.ReadRequired<uint8_t>();
489
- break;
490
- case PhysicalType::UINT16:
491
- result.value_.usmallint = reader.ReadRequired<uint16_t>();
492
- break;
493
- case PhysicalType::UINT32:
494
- result.value_.uinteger = reader.ReadRequired<uint32_t>();
495
- break;
496
- case PhysicalType::UINT64:
497
- result.value_.ubigint = reader.ReadRequired<uint64_t>();
498
- break;
499
- case PhysicalType::INT128:
500
- result.value_.hugeint = reader.ReadRequired<hugeint_t>();
501
- break;
502
- case PhysicalType::FLOAT:
503
- result.value_.float_ = reader.ReadRequired<float>();
504
- break;
505
- case PhysicalType::DOUBLE:
506
- result.value_.double_ = reader.ReadRequired<double>();
507
- break;
508
- default:
509
- throw InternalException("Unsupported type for deserializing numeric statistics");
510
- }
511
- }
512
-
513
- BaseStatistics NumericStats::Deserialize(FieldReader &reader, LogicalType type) {
514
- BaseStatistics result(std::move(type));
515
- auto &numeric_stats = NumericStats::GetDataUnsafe(result);
516
- DeserializeNumericStatsValue(result.GetType(), reader, numeric_stats.min, numeric_stats.has_min);
517
- DeserializeNumericStatsValue(result.GetType(), reader, numeric_stats.max, numeric_stats.has_max);
518
- return result;
519
- }
520
-
521
- static void FormatSerializeNumericStatsValue(const LogicalType &type, NumericValueUnion val, bool has_value,
522
- FormatSerializer &serializer) {
409
+ Serializer &serializer) {
523
410
  serializer.WriteProperty(100, "has_value", has_value);
524
411
  if (!has_value) {
525
412
  return;
@@ -566,18 +453,8 @@ static void FormatSerializeNumericStatsValue(const LogicalType &type, NumericVal
566
453
  }
567
454
  }
568
455
 
569
- void NumericStats::FormatSerialize(const BaseStatistics &stats, FormatSerializer &serializer) {
570
- auto &numeric_stats = NumericStats::GetDataUnsafe(stats);
571
- serializer.WriteObject(200, "max", [&](FormatSerializer &object) {
572
- FormatSerializeNumericStatsValue(stats.GetType(), numeric_stats.min, numeric_stats.has_min, object);
573
- });
574
- serializer.WriteObject(201, "min", [&](FormatSerializer &object) {
575
- FormatSerializeNumericStatsValue(stats.GetType(), numeric_stats.max, numeric_stats.has_max, object);
576
- });
577
- }
578
-
579
- static void FormatDeserializeNumericStatsValue(const LogicalType &type, NumericValueUnion &result, bool &has_stats,
580
- FormatDeserializer &deserializer) {
456
+ static void DeserializeNumericStatsValue(const LogicalType &type, NumericValueUnion &result, bool &has_stats,
457
+ Deserializer &deserializer) {
581
458
  auto has_value = deserializer.ReadProperty<bool>(100, "has_value");
582
459
  if (!has_value) {
583
460
  has_stats = false;
@@ -626,17 +503,25 @@ static void FormatDeserializeNumericStatsValue(const LogicalType &type, NumericV
626
503
  }
627
504
  }
628
505
 
629
- BaseStatistics NumericStats::FormatDeserialize(FormatDeserializer &deserializer, LogicalType type) {
630
- BaseStatistics result(std::move(type));
506
+ void NumericStats::Serialize(const BaseStatistics &stats, Serializer &serializer) {
507
+ auto &numeric_stats = NumericStats::GetDataUnsafe(stats);
508
+ serializer.WriteObject(200, "max", [&](Serializer &object) {
509
+ SerializeNumericStatsValue(stats.GetType(), numeric_stats.min, numeric_stats.has_min, object);
510
+ });
511
+ serializer.WriteObject(201, "min", [&](Serializer &object) {
512
+ SerializeNumericStatsValue(stats.GetType(), numeric_stats.max, numeric_stats.has_max, object);
513
+ });
514
+ }
515
+
516
+ void NumericStats::Deserialize(Deserializer &deserializer, BaseStatistics &result) {
631
517
  auto &numeric_stats = NumericStats::GetDataUnsafe(result);
632
518
 
633
- deserializer.ReadObject(200, "max", [&](FormatDeserializer &object) {
634
- FormatDeserializeNumericStatsValue(result.GetType(), numeric_stats.min, numeric_stats.has_min, object);
519
+ deserializer.ReadObject(200, "max", [&](Deserializer &object) {
520
+ DeserializeNumericStatsValue(result.GetType(), numeric_stats.min, numeric_stats.has_min, object);
635
521
  });
636
- deserializer.ReadObject(201, "min", [&](FormatDeserializer &object) {
637
- FormatDeserializeNumericStatsValue(result.GetType(), numeric_stats.max, numeric_stats.has_max, object);
522
+ deserializer.ReadObject(201, "min", [&](Deserializer &object) {
523
+ DeserializeNumericStatsValue(result.GetType(), numeric_stats.max, numeric_stats.has_max, object);
638
524
  });
639
- return result;
640
525
  }
641
526
 
642
527
  string NumericStats::ToString(const BaseStatistics &stats) {
@@ -1,14 +1,13 @@
1
1
  #include "duckdb/storage/statistics/string_stats.hpp"
2
2
 
3
- #include "duckdb/common/field_writer.hpp"
4
3
  #include "duckdb/common/string_util.hpp"
5
4
  #include "duckdb/common/types/vector.hpp"
6
5
  #include "duckdb/main/error_manager.hpp"
7
6
  #include "duckdb/storage/statistics/base_statistics.hpp"
8
7
  #include "utf8proc_wrapper.hpp"
9
8
 
10
- #include "duckdb/common/serializer/format_serializer.hpp"
11
- #include "duckdb/common/serializer/format_deserializer.hpp"
9
+ #include "duckdb/common/serializer/serializer.hpp"
10
+ #include "duckdb/common/serializer/deserializer.hpp"
12
11
 
13
12
  namespace duckdb {
14
13
 
@@ -97,16 +96,7 @@ void StringStats::SetContainsUnicode(BaseStatistics &stats) {
97
96
  StringStats::GetDataUnsafe(stats).has_unicode = true;
98
97
  }
99
98
 
100
- void StringStats::Serialize(const BaseStatistics &stats, FieldWriter &writer) {
101
- auto &string_data = StringStats::GetDataUnsafe(stats);
102
- writer.WriteBlob(string_data.min, StringStatsData::MAX_STRING_MINMAX_SIZE);
103
- writer.WriteBlob(string_data.max, StringStatsData::MAX_STRING_MINMAX_SIZE);
104
- writer.WriteField<bool>(string_data.has_unicode);
105
- writer.WriteField<bool>(string_data.has_max_string_length);
106
- writer.WriteField<uint32_t>(string_data.max_string_length);
107
- }
108
-
109
- void StringStats::FormatSerialize(const BaseStatistics &stats, FormatSerializer &serializer) {
99
+ void StringStats::Serialize(const BaseStatistics &stats, Serializer &serializer) {
110
100
  auto &string_data = StringStats::GetDataUnsafe(stats);
111
101
  serializer.WriteProperty(200, "min", string_data.min, StringStatsData::MAX_STRING_MINMAX_SIZE);
112
102
  serializer.WriteProperty(201, "max", string_data.max, StringStatsData::MAX_STRING_MINMAX_SIZE);
@@ -115,26 +105,13 @@ void StringStats::FormatSerialize(const BaseStatistics &stats, FormatSerializer
115
105
  serializer.WriteProperty(204, "max_string_length", string_data.max_string_length);
116
106
  }
117
107
 
118
- BaseStatistics StringStats::Deserialize(FieldReader &reader, LogicalType type) {
119
- BaseStatistics result(std::move(type));
120
- auto &string_data = StringStats::GetDataUnsafe(result);
121
- reader.ReadBlob(string_data.min, StringStatsData::MAX_STRING_MINMAX_SIZE);
122
- reader.ReadBlob(string_data.max, StringStatsData::MAX_STRING_MINMAX_SIZE);
123
- string_data.has_unicode = reader.ReadRequired<bool>();
124
- string_data.has_max_string_length = reader.ReadRequired<bool>();
125
- string_data.max_string_length = reader.ReadRequired<uint32_t>();
126
- return result;
127
- }
128
-
129
- BaseStatistics StringStats::FormatDeserialize(FormatDeserializer &deserializer, LogicalType type) {
130
- BaseStatistics result(std::move(type));
131
- auto &string_data = StringStats::GetDataUnsafe(result);
108
+ void StringStats::Deserialize(Deserializer &deserializer, BaseStatistics &base) {
109
+ auto &string_data = StringStats::GetDataUnsafe(base);
132
110
  deserializer.ReadProperty(200, "min", string_data.min, StringStatsData::MAX_STRING_MINMAX_SIZE);
133
111
  deserializer.ReadProperty(201, "max", string_data.max, StringStatsData::MAX_STRING_MINMAX_SIZE);
134
112
  deserializer.ReadProperty(202, "has_unicode", string_data.has_unicode);
135
113
  deserializer.ReadProperty(203, "has_max_string_length", string_data.has_max_string_length);
136
114
  deserializer.ReadProperty(204, "max_string_length", string_data.max_string_length);
137
- return result;
138
115
  }
139
116
 
140
117
  static int StringValueComparison(const_data_ptr_t data, idx_t len, const_data_ptr_t comparison) {
@@ -1,10 +1,9 @@
1
1
  #include "duckdb/storage/statistics/struct_stats.hpp"
2
2
  #include "duckdb/storage/statistics/base_statistics.hpp"
3
- #include "duckdb/common/field_writer.hpp"
4
3
  #include "duckdb/common/types/vector.hpp"
5
4
 
6
- #include "duckdb/common/serializer/format_serializer.hpp"
7
- #include "duckdb/common/serializer/format_deserializer.hpp"
5
+ #include "duckdb/common/serializer/serializer.hpp"
6
+ #include "duckdb/common/serializer/deserializer.hpp"
8
7
 
9
8
  namespace duckdb {
10
9
 
@@ -93,47 +92,26 @@ void StructStats::Merge(BaseStatistics &stats, const BaseStatistics &other) {
93
92
  }
94
93
  }
95
94
 
96
- void StructStats::Serialize(const BaseStatistics &stats, FieldWriter &writer) {
97
- auto child_stats = StructStats::GetChildStats(stats);
98
- auto child_count = StructType::GetChildCount(stats.GetType());
99
- for (idx_t i = 0; i < child_count; i++) {
100
- writer.WriteSerializable(child_stats[i]);
101
- }
102
- }
103
-
104
- BaseStatistics StructStats::Deserialize(FieldReader &reader, LogicalType type) {
105
- D_ASSERT(type.InternalType() == PhysicalType::STRUCT);
106
- auto &child_types = StructType::GetChildTypes(type);
107
- BaseStatistics result(std::move(type));
108
- for (idx_t i = 0; i < child_types.size(); i++) {
109
- result.child_stats[i].Copy(
110
- reader.ReadRequiredSerializable<BaseStatistics, BaseStatistics>(child_types[i].second));
111
- }
112
- return result;
113
- }
114
-
115
- void StructStats::FormatSerialize(const BaseStatistics &stats, FormatSerializer &serializer) {
95
+ void StructStats::Serialize(const BaseStatistics &stats, Serializer &serializer) {
116
96
  auto child_stats = StructStats::GetChildStats(stats);
117
97
  auto child_count = StructType::GetChildCount(stats.GetType());
118
98
 
119
99
  serializer.WriteList(200, "child_stats", child_count,
120
- [&](FormatSerializer::List &list, idx_t i) { list.WriteElement(child_stats[i]); });
100
+ [&](Serializer::List &list, idx_t i) { list.WriteElement(child_stats[i]); });
121
101
  }
122
102
 
123
- BaseStatistics StructStats::FormatDeserialize(FormatDeserializer &deserializer, LogicalType type) {
103
+ void StructStats::Deserialize(Deserializer &deserializer, BaseStatistics &base) {
104
+ auto &type = base.GetType();
124
105
  D_ASSERT(type.InternalType() == PhysicalType::STRUCT);
125
106
 
126
107
  auto &child_types = StructType::GetChildTypes(type);
127
- BaseStatistics result(std::move(type));
128
108
 
129
- deserializer.ReadList(200, "child_stats", [&](FormatDeserializer::List &list, idx_t i) {
109
+ deserializer.ReadList(200, "child_stats", [&](Deserializer::List &list, idx_t i) {
130
110
  deserializer.Set<LogicalType &>(const_cast<LogicalType &>(child_types[i].second));
131
111
  auto stat = list.ReadElement<BaseStatistics>();
132
- result.child_stats[i].Copy(stat);
112
+ base.child_stats[i].Copy(stat);
133
113
  deserializer.Unset<LogicalType>();
134
114
  });
135
-
136
- return result;
137
115
  }
138
116
 
139
117
  string StructStats::ToString(const BaseStatistics &stats) {
@@ -2,7 +2,7 @@
2
2
 
3
3
  namespace duckdb {
4
4
 
5
- const uint64_t VERSION_NUMBER = 58;
5
+ const uint64_t VERSION_NUMBER = 59;
6
6
 
7
7
  struct StorageVersionInfo {
8
8
  const char *version_name;