duckdb 0.8.2-dev4142.0 → 0.8.2-dev4314.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (507) 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_entry/index_catalog_entry.cpp +0 -1
  28. package/src/duckdb/src/catalog/catalog_entry/macro_catalog_entry.cpp +0 -1
  29. package/src/duckdb/src/catalog/catalog_entry/schema_catalog_entry.cpp +0 -1
  30. package/src/duckdb/src/catalog/catalog_entry/sequence_catalog_entry.cpp +0 -1
  31. package/src/duckdb/src/catalog/catalog_entry/table_catalog_entry.cpp +0 -2
  32. package/src/duckdb/src/catalog/catalog_entry/type_catalog_entry.cpp +1 -3
  33. package/src/duckdb/src/catalog/catalog_entry/view_catalog_entry.cpp +0 -1
  34. package/src/duckdb/src/catalog/catalog_entry.cpp +2 -11
  35. package/src/duckdb/src/catalog/catalog_set.cpp +16 -14
  36. package/src/duckdb/src/catalog/default/default_functions.cpp +2 -2
  37. package/src/duckdb/src/common/arrow/arrow_converter.cpp +0 -1
  38. package/src/duckdb/src/common/constants.cpp +0 -1
  39. package/src/duckdb/src/common/enum_util.cpp +0 -10
  40. package/src/duckdb/src/common/exception.cpp +1 -1
  41. package/src/duckdb/src/common/extra_type_info.cpp +20 -192
  42. package/src/duckdb/src/common/multi_file_reader.cpp +0 -68
  43. package/src/duckdb/src/common/serializer/binary_serializer.cpp +9 -4
  44. package/src/duckdb/src/common/serializer/buffered_file_reader.cpp +3 -11
  45. package/src/duckdb/src/common/serializer/buffered_file_writer.cpp +1 -1
  46. package/src/duckdb/src/common/serializer/memory_stream.cpp +61 -0
  47. package/src/duckdb/src/common/serializer/{format_serializer.cpp → serializer.cpp} +2 -2
  48. package/src/duckdb/src/common/sort/partition_state.cpp +107 -29
  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/execution/index/art/art.cpp +5 -1
  65. package/src/duckdb/src/execution/index/art/leaf.cpp +13 -10
  66. package/src/duckdb/src/execution/index/art/node48.cpp +0 -2
  67. package/src/duckdb/src/execution/index/fixed_size_allocator.cpp +38 -73
  68. package/src/duckdb/src/execution/index/fixed_size_buffer.cpp +245 -27
  69. package/src/duckdb/src/execution/operator/aggregate/physical_window.cpp +2 -3
  70. package/src/duckdb/src/execution/operator/join/physical_asof_join.cpp +35 -20
  71. package/src/duckdb/src/function/macro_function.cpp +0 -42
  72. package/src/duckdb/src/function/scalar/compressed_materialization/compress_integral.cpp +10 -8
  73. package/src/duckdb/src/function/scalar/compressed_materialization/compress_string.cpp +13 -12
  74. package/src/duckdb/src/function/scalar/operators/arithmetic.cpp +9 -11
  75. package/src/duckdb/src/function/scalar/system/aggregate_export.cpp +7 -33
  76. package/src/duckdb/src/function/scalar_function.cpp +1 -2
  77. package/src/duckdb/src/function/scalar_macro_function.cpp +0 -10
  78. package/src/duckdb/src/function/table/copy_csv.cpp +38 -38
  79. package/src/duckdb/src/function/table/read_csv.cpp +5 -174
  80. package/src/duckdb/src/function/table/table_scan.cpp +5 -42
  81. package/src/duckdb/src/function/table/version/pragma_version.cpp +2 -2
  82. package/src/duckdb/src/function/table_function.cpp +3 -4
  83. package/src/duckdb/src/function/table_macro_function.cpp +0 -10
  84. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/schema_catalog_entry.hpp +0 -2
  85. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/sequence_catalog_entry.hpp +0 -2
  86. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/type_catalog_entry.hpp +0 -2
  87. package/src/duckdb/src/include/duckdb/catalog/catalog_entry.hpp +3 -8
  88. package/src/duckdb/src/include/duckdb/common/constants.hpp +4 -2
  89. package/src/duckdb/src/include/duckdb/common/extra_type_info.hpp +16 -46
  90. package/src/duckdb/src/include/duckdb/common/index_vector.hpp +4 -4
  91. package/src/duckdb/src/include/duckdb/common/multi_file_reader.hpp +2 -6
  92. package/src/duckdb/src/include/duckdb/common/multi_file_reader_options.hpp +0 -4
  93. package/src/duckdb/src/include/duckdb/common/serializer/binary_deserializer.hpp +44 -23
  94. package/src/duckdb/src/include/duckdb/common/serializer/binary_serializer.hpp +31 -23
  95. package/src/duckdb/src/include/duckdb/common/serializer/buffered_file_reader.hpp +4 -6
  96. package/src/duckdb/src/include/duckdb/common/serializer/buffered_file_writer.hpp +3 -3
  97. package/src/duckdb/src/include/duckdb/common/serializer/deserialization_data.hpp +17 -0
  98. package/src/duckdb/src/include/duckdb/common/serializer/{format_deserializer.hpp → deserializer.hpp} +13 -13
  99. package/src/duckdb/src/include/duckdb/common/serializer/memory_stream.hpp +62 -0
  100. package/src/duckdb/src/include/duckdb/common/serializer/read_stream.hpp +38 -0
  101. package/src/duckdb/src/include/duckdb/common/serializer/serialization_traits.hpp +15 -13
  102. package/src/duckdb/src/include/duckdb/common/serializer/{format_serializer.hpp → serializer.hpp} +13 -12
  103. package/src/duckdb/src/include/duckdb/common/serializer/write_stream.hpp +36 -0
  104. package/src/duckdb/src/include/duckdb/common/sort/partition_state.hpp +14 -4
  105. package/src/duckdb/src/include/duckdb/common/types/column/column_data_collection.hpp +2 -2
  106. package/src/duckdb/src/include/duckdb/common/types/data_chunk.hpp +3 -8
  107. package/src/duckdb/src/include/duckdb/common/types/hyperloglog.hpp +4 -10
  108. package/src/duckdb/src/include/duckdb/common/types/interval.hpp +4 -4
  109. package/src/duckdb/src/include/duckdb/common/types/value.hpp +1 -5
  110. package/src/duckdb/src/include/duckdb/common/types/vector.hpp +2 -7
  111. package/src/duckdb/src/include/duckdb/common/types.hpp +1 -10
  112. package/src/duckdb/src/include/duckdb/execution/index/art/leaf.hpp +2 -0
  113. package/src/duckdb/src/include/duckdb/execution/index/fixed_size_allocator.hpp +1 -7
  114. package/src/duckdb/src/include/duckdb/execution/index/fixed_size_buffer.hpp +38 -8
  115. package/src/duckdb/src/include/duckdb/execution/operator/scan/csv/csv_reader_options.hpp +2 -11
  116. package/src/duckdb/src/include/duckdb/function/aggregate_function.hpp +4 -14
  117. package/src/duckdb/src/include/duckdb/function/copy_function.hpp +3 -3
  118. package/src/duckdb/src/include/duckdb/function/function_serialization.hpp +15 -98
  119. package/src/duckdb/src/include/duckdb/function/macro_function.hpp +1 -7
  120. package/src/duckdb/src/include/duckdb/function/scalar/nested_functions.hpp +9 -10
  121. package/src/duckdb/src/include/duckdb/function/scalar/strftime_format.hpp +2 -2
  122. package/src/duckdb/src/include/duckdb/function/scalar_function.hpp +2 -12
  123. package/src/duckdb/src/include/duckdb/function/scalar_macro_function.hpp +2 -7
  124. package/src/duckdb/src/include/duckdb/function/table/read_csv.hpp +4 -16
  125. package/src/duckdb/src/include/duckdb/function/table_function.hpp +2 -11
  126. package/src/duckdb/src/include/duckdb/function/table_macro_function.hpp +2 -7
  127. package/src/duckdb/src/include/duckdb/main/relation.hpp +9 -2
  128. package/src/duckdb/src/include/duckdb/parser/column_definition.hpp +1 -4
  129. package/src/duckdb/src/include/duckdb/parser/column_list.hpp +2 -6
  130. package/src/duckdb/src/include/duckdb/parser/common_table_expression_info.hpp +2 -2
  131. package/src/duckdb/src/include/duckdb/parser/constraint.hpp +2 -12
  132. package/src/duckdb/src/include/duckdb/parser/constraints/check_constraint.hpp +2 -5
  133. package/src/duckdb/src/include/duckdb/parser/constraints/foreign_key_constraint.hpp +2 -7
  134. package/src/duckdb/src/include/duckdb/parser/constraints/not_null_constraint.hpp +2 -7
  135. package/src/duckdb/src/include/duckdb/parser/constraints/unique_constraint.hpp +2 -7
  136. package/src/duckdb/src/include/duckdb/parser/expression/between_expression.hpp +2 -5
  137. package/src/duckdb/src/include/duckdb/parser/expression/bound_expression.hpp +1 -4
  138. package/src/duckdb/src/include/duckdb/parser/expression/case_expression.hpp +4 -6
  139. package/src/duckdb/src/include/duckdb/parser/expression/cast_expression.hpp +2 -4
  140. package/src/duckdb/src/include/duckdb/parser/expression/collate_expression.hpp +2 -4
  141. package/src/duckdb/src/include/duckdb/parser/expression/columnref_expression.hpp +2 -4
  142. package/src/duckdb/src/include/duckdb/parser/expression/comparison_expression.hpp +2 -4
  143. package/src/duckdb/src/include/duckdb/parser/expression/conjunction_expression.hpp +2 -4
  144. package/src/duckdb/src/include/duckdb/parser/expression/constant_expression.hpp +2 -5
  145. package/src/duckdb/src/include/duckdb/parser/expression/default_expression.hpp +2 -4
  146. package/src/duckdb/src/include/duckdb/parser/expression/function_expression.hpp +2 -4
  147. package/src/duckdb/src/include/duckdb/parser/expression/lambda_expression.hpp +2 -4
  148. package/src/duckdb/src/include/duckdb/parser/expression/operator_expression.hpp +2 -4
  149. package/src/duckdb/src/include/duckdb/parser/expression/parameter_expression.hpp +2 -4
  150. package/src/duckdb/src/include/duckdb/parser/expression/positional_reference_expression.hpp +2 -4
  151. package/src/duckdb/src/include/duckdb/parser/expression/star_expression.hpp +2 -4
  152. package/src/duckdb/src/include/duckdb/parser/expression/subquery_expression.hpp +2 -4
  153. package/src/duckdb/src/include/duckdb/parser/expression/window_expression.hpp +2 -4
  154. package/src/duckdb/src/include/duckdb/parser/parsed_data/alter_info.hpp +2 -5
  155. package/src/duckdb/src/include/duckdb/parser/parsed_data/alter_scalar_function_info.hpp +0 -2
  156. package/src/duckdb/src/include/duckdb/parser/parsed_data/alter_table_function_info.hpp +0 -2
  157. package/src/duckdb/src/include/duckdb/parser/parsed_data/alter_table_info.hpp +24 -51
  158. package/src/duckdb/src/include/duckdb/parser/parsed_data/attach_info.hpp +1 -4
  159. package/src/duckdb/src/include/duckdb/parser/parsed_data/copy_info.hpp +2 -2
  160. package/src/duckdb/src/include/duckdb/parser/parsed_data/create_collation_info.hpp +0 -3
  161. package/src/duckdb/src/include/duckdb/parser/parsed_data/create_copy_function_info.hpp +0 -3
  162. package/src/duckdb/src/include/duckdb/parser/parsed_data/create_function_info.hpp +0 -5
  163. package/src/duckdb/src/include/duckdb/parser/parsed_data/create_index_info.hpp +2 -7
  164. package/src/duckdb/src/include/duckdb/parser/parsed_data/create_info.hpp +1 -13
  165. package/src/duckdb/src/include/duckdb/parser/parsed_data/create_macro_info.hpp +2 -8
  166. package/src/duckdb/src/include/duckdb/parser/parsed_data/create_schema_info.hpp +2 -12
  167. package/src/duckdb/src/include/duckdb/parser/parsed_data/create_sequence_info.hpp +2 -7
  168. package/src/duckdb/src/include/duckdb/parser/parsed_data/create_table_info.hpp +2 -7
  169. package/src/duckdb/src/include/duckdb/parser/parsed_data/create_type_info.hpp +2 -7
  170. package/src/duckdb/src/include/duckdb/parser/parsed_data/create_view_info.hpp +2 -7
  171. package/src/duckdb/src/include/duckdb/parser/parsed_data/detach_info.hpp +2 -4
  172. package/src/duckdb/src/include/duckdb/parser/parsed_data/drop_info.hpp +2 -5
  173. package/src/duckdb/src/include/duckdb/parser/parsed_data/load_info.hpp +2 -21
  174. package/src/duckdb/src/include/duckdb/parser/parsed_data/parse_info.hpp +2 -2
  175. package/src/duckdb/src/include/duckdb/parser/parsed_data/pragma_info.hpp +2 -2
  176. package/src/duckdb/src/include/duckdb/parser/parsed_data/sample_options.hpp +2 -4
  177. package/src/duckdb/src/include/duckdb/parser/parsed_data/transaction_info.hpp +1 -4
  178. package/src/duckdb/src/include/duckdb/parser/parsed_data/vacuum_info.hpp +5 -7
  179. package/src/duckdb/src/include/duckdb/parser/parsed_expression.hpp +3 -16
  180. package/src/duckdb/src/include/duckdb/parser/query_node/cte_node.hpp +2 -4
  181. package/src/duckdb/src/include/duckdb/parser/query_node/recursive_cte_node.hpp +2 -4
  182. package/src/duckdb/src/include/duckdb/parser/query_node/select_node.hpp +2 -4
  183. package/src/duckdb/src/include/duckdb/parser/query_node/set_operation_node.hpp +2 -4
  184. package/src/duckdb/src/include/duckdb/parser/query_node.hpp +7 -14
  185. package/src/duckdb/src/include/duckdb/parser/result_modifier.hpp +14 -32
  186. package/src/duckdb/src/include/duckdb/parser/statement/select_statement.hpp +4 -9
  187. package/src/duckdb/src/include/duckdb/parser/tableref/basetableref.hpp +2 -6
  188. package/src/duckdb/src/include/duckdb/parser/tableref/emptytableref.hpp +2 -6
  189. package/src/duckdb/src/include/duckdb/parser/tableref/expressionlistref.hpp +2 -6
  190. package/src/duckdb/src/include/duckdb/parser/tableref/joinref.hpp +2 -6
  191. package/src/duckdb/src/include/duckdb/parser/tableref/pivotref.hpp +6 -14
  192. package/src/duckdb/src/include/duckdb/parser/tableref/subqueryref.hpp +2 -6
  193. package/src/duckdb/src/include/duckdb/parser/tableref/table_function_ref.hpp +2 -6
  194. package/src/duckdb/src/include/duckdb/parser/tableref.hpp +2 -10
  195. package/src/duckdb/src/include/duckdb/parser/transformer.hpp +1 -0
  196. package/src/duckdb/src/include/duckdb/planner/bound_constraint.hpp +0 -1
  197. package/src/duckdb/src/include/duckdb/planner/bound_result_modifier.hpp +2 -8
  198. package/src/duckdb/src/include/duckdb/planner/column_binding.hpp +4 -4
  199. package/src/duckdb/src/include/duckdb/planner/expression/bound_aggregate_expression.hpp +2 -4
  200. package/src/duckdb/src/include/duckdb/planner/expression/bound_between_expression.hpp +2 -4
  201. package/src/duckdb/src/include/duckdb/planner/expression/bound_case_expression.hpp +3 -9
  202. package/src/duckdb/src/include/duckdb/planner/expression/bound_cast_expression.hpp +2 -5
  203. package/src/duckdb/src/include/duckdb/planner/expression/bound_columnref_expression.hpp +2 -8
  204. package/src/duckdb/src/include/duckdb/planner/expression/bound_comparison_expression.hpp +2 -4
  205. package/src/duckdb/src/include/duckdb/planner/expression/bound_conjunction_expression.hpp +2 -5
  206. package/src/duckdb/src/include/duckdb/planner/expression/bound_constant_expression.hpp +2 -5
  207. package/src/duckdb/src/include/duckdb/planner/expression/bound_default_expression.hpp +2 -5
  208. package/src/duckdb/src/include/duckdb/planner/expression/bound_function_expression.hpp +2 -5
  209. package/src/duckdb/src/include/duckdb/planner/expression/bound_lambda_expression.hpp +2 -4
  210. package/src/duckdb/src/include/duckdb/planner/expression/bound_lambdaref_expression.hpp +2 -8
  211. package/src/duckdb/src/include/duckdb/planner/expression/bound_operator_expression.hpp +2 -5
  212. package/src/duckdb/src/include/duckdb/planner/expression/bound_parameter_data.hpp +2 -19
  213. package/src/duckdb/src/include/duckdb/planner/expression/bound_parameter_expression.hpp +2 -5
  214. package/src/duckdb/src/include/duckdb/planner/expression/bound_reference_expression.hpp +2 -5
  215. package/src/duckdb/src/include/duckdb/planner/expression/bound_subquery_expression.hpp +0 -3
  216. package/src/duckdb/src/include/duckdb/planner/expression/bound_unnest_expression.hpp +2 -5
  217. package/src/duckdb/src/include/duckdb/planner/expression/bound_window_expression.hpp +2 -5
  218. package/src/duckdb/src/include/duckdb/planner/expression.hpp +2 -14
  219. package/src/duckdb/src/include/duckdb/planner/filter/conjunction_filter.hpp +4 -8
  220. package/src/duckdb/src/include/duckdb/planner/filter/constant_filter.hpp +2 -4
  221. package/src/duckdb/src/include/duckdb/planner/filter/null_filter.hpp +4 -8
  222. package/src/duckdb/src/include/duckdb/planner/joinside.hpp +1 -6
  223. package/src/duckdb/src/include/duckdb/planner/logical_operator.hpp +2 -17
  224. package/src/duckdb/src/include/duckdb/planner/operator/logical_aggregate.hpp +2 -4
  225. package/src/duckdb/src/include/duckdb/planner/operator/logical_any_join.hpp +2 -4
  226. package/src/duckdb/src/include/duckdb/planner/operator/logical_column_data_get.hpp +2 -5
  227. package/src/duckdb/src/include/duckdb/planner/operator/logical_comparison_join.hpp +2 -6
  228. package/src/duckdb/src/include/duckdb/planner/operator/logical_copy_to_file.hpp +2 -4
  229. package/src/duckdb/src/include/duckdb/planner/operator/logical_create.hpp +2 -5
  230. package/src/duckdb/src/include/duckdb/planner/operator/logical_create_index.hpp +2 -5
  231. package/src/duckdb/src/include/duckdb/planner/operator/logical_create_table.hpp +2 -5
  232. package/src/duckdb/src/include/duckdb/planner/operator/logical_cross_product.hpp +2 -5
  233. package/src/duckdb/src/include/duckdb/planner/operator/logical_cteref.hpp +2 -4
  234. package/src/duckdb/src/include/duckdb/planner/operator/logical_delete.hpp +2 -5
  235. package/src/duckdb/src/include/duckdb/planner/operator/logical_delim_get.hpp +2 -4
  236. package/src/duckdb/src/include/duckdb/planner/operator/logical_dependent_join.hpp +0 -1
  237. package/src/duckdb/src/include/duckdb/planner/operator/logical_distinct.hpp +2 -4
  238. package/src/duckdb/src/include/duckdb/planner/operator/logical_dummy_scan.hpp +2 -4
  239. package/src/duckdb/src/include/duckdb/planner/operator/logical_empty_result.hpp +2 -4
  240. package/src/duckdb/src/include/duckdb/planner/operator/logical_execute.hpp +0 -2
  241. package/src/duckdb/src/include/duckdb/planner/operator/logical_explain.hpp +2 -5
  242. package/src/duckdb/src/include/duckdb/planner/operator/logical_export.hpp +0 -3
  243. package/src/duckdb/src/include/duckdb/planner/operator/logical_expression_get.hpp +2 -4
  244. package/src/duckdb/src/include/duckdb/planner/operator/logical_extension_operator.hpp +2 -4
  245. package/src/duckdb/src/include/duckdb/planner/operator/logical_filter.hpp +2 -4
  246. package/src/duckdb/src/include/duckdb/planner/operator/logical_get.hpp +2 -4
  247. package/src/duckdb/src/include/duckdb/planner/operator/logical_insert.hpp +2 -5
  248. package/src/duckdb/src/include/duckdb/planner/operator/logical_join.hpp +0 -2
  249. package/src/duckdb/src/include/duckdb/planner/operator/logical_limit.hpp +2 -5
  250. package/src/duckdb/src/include/duckdb/planner/operator/logical_limit_percent.hpp +2 -5
  251. package/src/duckdb/src/include/duckdb/planner/operator/logical_materialized_cte.hpp +2 -4
  252. package/src/duckdb/src/include/duckdb/planner/operator/logical_order.hpp +2 -5
  253. package/src/duckdb/src/include/duckdb/planner/operator/logical_pivot.hpp +2 -4
  254. package/src/duckdb/src/include/duckdb/planner/operator/logical_positional_join.hpp +2 -5
  255. package/src/duckdb/src/include/duckdb/planner/operator/logical_pragma.hpp +0 -2
  256. package/src/duckdb/src/include/duckdb/planner/operator/logical_prepare.hpp +0 -2
  257. package/src/duckdb/src/include/duckdb/planner/operator/logical_projection.hpp +2 -4
  258. package/src/duckdb/src/include/duckdb/planner/operator/logical_recursive_cte.hpp +2 -4
  259. package/src/duckdb/src/include/duckdb/planner/operator/logical_reset.hpp +2 -5
  260. package/src/duckdb/src/include/duckdb/planner/operator/logical_sample.hpp +2 -5
  261. package/src/duckdb/src/include/duckdb/planner/operator/logical_set.hpp +2 -5
  262. package/src/duckdb/src/include/duckdb/planner/operator/logical_set_operation.hpp +2 -5
  263. package/src/duckdb/src/include/duckdb/planner/operator/logical_show.hpp +2 -5
  264. package/src/duckdb/src/include/duckdb/planner/operator/logical_simple.hpp +2 -5
  265. package/src/duckdb/src/include/duckdb/planner/operator/logical_top_n.hpp +2 -4
  266. package/src/duckdb/src/include/duckdb/planner/operator/logical_unnest.hpp +2 -4
  267. package/src/duckdb/src/include/duckdb/planner/operator/logical_update.hpp +2 -4
  268. package/src/duckdb/src/include/duckdb/planner/operator/logical_window.hpp +2 -4
  269. package/src/duckdb/src/include/duckdb/planner/operator_extension.hpp +1 -3
  270. package/src/duckdb/src/include/duckdb/planner/parsed_data/bound_create_table_info.hpp +0 -5
  271. package/src/duckdb/src/include/duckdb/planner/table_filter.hpp +3 -12
  272. package/src/duckdb/src/include/duckdb/planner/tableref/bound_pivotref.hpp +2 -2
  273. package/src/duckdb/src/include/duckdb/storage/block.hpp +7 -4
  274. package/src/duckdb/src/include/duckdb/storage/checkpoint/row_group_writer.hpp +3 -2
  275. package/src/duckdb/src/include/duckdb/storage/checkpoint/table_data_writer.hpp +6 -6
  276. package/src/duckdb/src/include/duckdb/storage/checkpoint_manager.hpp +18 -18
  277. package/src/duckdb/src/include/duckdb/storage/data_pointer.hpp +6 -0
  278. package/src/duckdb/src/include/duckdb/storage/data_table.hpp +1 -1
  279. package/src/duckdb/src/include/duckdb/storage/metadata/metadata_manager.hpp +4 -5
  280. package/src/duckdb/src/include/duckdb/storage/metadata/metadata_reader.hpp +2 -1
  281. package/src/duckdb/src/include/duckdb/storage/metadata/metadata_writer.hpp +2 -2
  282. package/src/duckdb/src/include/duckdb/storage/partial_block_manager.hpp +35 -19
  283. package/src/duckdb/src/include/duckdb/storage/statistics/base_statistics.hpp +2 -11
  284. package/src/duckdb/src/include/duckdb/storage/statistics/column_statistics.hpp +3 -5
  285. package/src/duckdb/src/include/duckdb/storage/statistics/distinct_statistics.hpp +3 -11
  286. package/src/duckdb/src/include/duckdb/storage/statistics/list_stats.hpp +2 -7
  287. package/src/duckdb/src/include/duckdb/storage/statistics/node_statistics.hpp +0 -26
  288. package/src/duckdb/src/include/duckdb/storage/statistics/numeric_stats.hpp +2 -7
  289. package/src/duckdb/src/include/duckdb/storage/statistics/string_stats.hpp +2 -7
  290. package/src/duckdb/src/include/duckdb/storage/statistics/struct_stats.hpp +2 -7
  291. package/src/duckdb/src/include/duckdb/storage/storage_info.hpp +4 -6
  292. package/src/duckdb/src/include/duckdb/storage/table/chunk_info.hpp +8 -17
  293. package/src/duckdb/src/include/duckdb/storage/table/column_checkpoint_state.hpp +5 -20
  294. package/src/duckdb/src/include/duckdb/storage/table/column_data.hpp +2 -2
  295. package/src/duckdb/src/include/duckdb/storage/table/list_column_data.hpp +1 -1
  296. package/src/duckdb/src/include/duckdb/storage/table/row_group.hpp +2 -7
  297. package/src/duckdb/src/include/duckdb/storage/table/standard_column_data.hpp +2 -2
  298. package/src/duckdb/src/include/duckdb/storage/table/table_statistics.hpp +4 -7
  299. package/src/duckdb/src/include/duckdb/storage/write_ahead_log.hpp +27 -29
  300. package/src/duckdb/src/include/duckdb/verification/statement_verifier.hpp +0 -2
  301. package/src/duckdb/src/main/client_context.cpp +0 -6
  302. package/src/duckdb/src/main/client_verify.cpp +0 -2
  303. package/src/duckdb/src/main/extension/extension_helper.cpp +1 -0
  304. package/src/duckdb/src/main/relation.cpp +15 -2
  305. package/src/duckdb/src/parser/column_definition.cpp +0 -25
  306. package/src/duckdb/src/parser/column_list.cpp +0 -13
  307. package/src/duckdb/src/parser/constraint.cpp +0 -33
  308. package/src/duckdb/src/parser/constraints/check_constraint.cpp +0 -11
  309. package/src/duckdb/src/parser/constraints/foreign_key_constraint.cpp +0 -27
  310. package/src/duckdb/src/parser/constraints/not_null_constraint.cpp +0 -11
  311. package/src/duckdb/src/parser/constraints/unique_constraint.cpp +0 -24
  312. package/src/duckdb/src/parser/expression/between_expression.cpp +2 -16
  313. package/src/duckdb/src/parser/expression/case_expression.cpp +2 -29
  314. package/src/duckdb/src/parser/expression/cast_expression.cpp +2 -16
  315. package/src/duckdb/src/parser/expression/collate_expression.cpp +2 -14
  316. package/src/duckdb/src/parser/expression/columnref_expression.cpp +2 -13
  317. package/src/duckdb/src/parser/expression/comparison_expression.cpp +2 -14
  318. package/src/duckdb/src/parser/expression/conjunction_expression.cpp +2 -13
  319. package/src/duckdb/src/parser/expression/constant_expression.cpp +2 -12
  320. package/src/duckdb/src/parser/expression/default_expression.cpp +2 -9
  321. package/src/duckdb/src/parser/expression/function_expression.cpp +2 -32
  322. package/src/duckdb/src/parser/expression/lambda_expression.cpp +2 -14
  323. package/src/duckdb/src/parser/expression/operator_expression.cpp +2 -13
  324. package/src/duckdb/src/parser/expression/parameter_expression.cpp +2 -13
  325. package/src/duckdb/src/parser/expression/positional_reference_expression.cpp +2 -12
  326. package/src/duckdb/src/parser/expression/star_expression.cpp +2 -43
  327. package/src/duckdb/src/parser/expression/subquery_expression.cpp +2 -28
  328. package/src/duckdb/src/parser/expression/window_expression.cpp +2 -53
  329. package/src/duckdb/src/parser/parsed_data/alter_info.cpp +0 -35
  330. package/src/duckdb/src/parser/parsed_data/alter_scalar_function_info.cpp +0 -18
  331. package/src/duckdb/src/parser/parsed_data/alter_table_function_info.cpp +0 -13
  332. package/src/duckdb/src/parser/parsed_data/alter_table_info.cpp +1 -189
  333. package/src/duckdb/src/parser/parsed_data/attach_info.cpp +0 -29
  334. package/src/duckdb/src/parser/parsed_data/create_collation_info.cpp +0 -4
  335. package/src/duckdb/src/parser/parsed_data/create_copy_function_info.cpp +0 -4
  336. package/src/duckdb/src/parser/parsed_data/create_index_info.cpp +0 -48
  337. package/src/duckdb/src/parser/parsed_data/create_info.cpp +0 -47
  338. package/src/duckdb/src/parser/parsed_data/create_macro_info.cpp +1 -28
  339. package/src/duckdb/src/parser/parsed_data/create_sequence_info.cpp +0 -31
  340. package/src/duckdb/src/parser/parsed_data/create_table_info.cpp +0 -23
  341. package/src/duckdb/src/parser/parsed_data/create_type_info.cpp +0 -22
  342. package/src/duckdb/src/parser/parsed_data/create_view_info.cpp +0 -23
  343. package/src/duckdb/src/parser/parsed_data/detach_info.cpp +0 -19
  344. package/src/duckdb/src/parser/parsed_data/drop_info.cpp +0 -26
  345. package/src/duckdb/src/parser/parsed_data/sample_options.cpp +2 -25
  346. package/src/duckdb/src/parser/parsed_data/transaction_info.cpp +0 -16
  347. package/src/duckdb/src/parser/parsed_data/vacuum_info.cpp +0 -20
  348. package/src/duckdb/src/parser/parsed_expression.cpp +2 -79
  349. package/src/duckdb/src/parser/query_node/cte_node.cpp +2 -19
  350. package/src/duckdb/src/parser/query_node/recursive_cte_node.cpp +2 -21
  351. package/src/duckdb/src/parser/query_node/select_node.cpp +2 -47
  352. package/src/duckdb/src/parser/query_node/set_operation_node.cpp +2 -17
  353. package/src/duckdb/src/parser/query_node.cpp +2 -62
  354. package/src/duckdb/src/parser/result_modifier.cpp +2 -96
  355. package/src/duckdb/src/parser/statement/select_statement.cpp +2 -13
  356. package/src/duckdb/src/parser/tableref/basetableref.cpp +2 -21
  357. package/src/duckdb/src/parser/tableref/emptytableref.cpp +0 -9
  358. package/src/duckdb/src/parser/tableref/expressionlistref.cpp +2 -28
  359. package/src/duckdb/src/parser/tableref/joinref.cpp +2 -23
  360. package/src/duckdb/src/parser/tableref/pivotref.cpp +0 -61
  361. package/src/duckdb/src/parser/tableref/subqueryref.cpp +2 -15
  362. package/src/duckdb/src/parser/tableref/table_function.cpp +2 -17
  363. package/src/duckdb/src/parser/tableref.cpp +2 -52
  364. package/src/duckdb/src/planner/binder/expression/bind_subquery_expression.cpp +1 -4
  365. package/src/duckdb/src/planner/bound_result_modifier.cpp +0 -33
  366. package/src/duckdb/src/planner/expression/bound_aggregate_expression.cpp +6 -30
  367. package/src/duckdb/src/planner/expression/bound_between_expression.cpp +0 -19
  368. package/src/duckdb/src/planner/expression/bound_case_expression.cpp +0 -36
  369. package/src/duckdb/src/planner/expression/bound_cast_expression.cpp +0 -15
  370. package/src/duckdb/src/planner/expression/bound_columnref_expression.cpp +0 -20
  371. package/src/duckdb/src/planner/expression/bound_comparison_expression.cpp +0 -13
  372. package/src/duckdb/src/planner/expression/bound_conjunction_expression.cpp +0 -13
  373. package/src/duckdb/src/planner/expression/bound_constant_expression.cpp +0 -11
  374. package/src/duckdb/src/planner/expression/bound_expression.cpp +1 -5
  375. package/src/duckdb/src/planner/expression/bound_function_expression.cpp +8 -28
  376. package/src/duckdb/src/planner/expression/bound_lambda_expression.cpp +0 -4
  377. package/src/duckdb/src/planner/expression/bound_lambdaref_expression.cpp +0 -23
  378. package/src/duckdb/src/planner/expression/bound_operator_expression.cpp +0 -16
  379. package/src/duckdb/src/planner/expression/bound_parameter_expression.cpp +0 -18
  380. package/src/duckdb/src/planner/expression/bound_reference_expression.cpp +0 -16
  381. package/src/duckdb/src/planner/expression/bound_subquery_expression.cpp +0 -4
  382. package/src/duckdb/src/planner/expression/bound_unnest_expression.cpp +0 -15
  383. package/src/duckdb/src/planner/expression/bound_window_expression.cpp +7 -60
  384. package/src/duckdb/src/planner/expression.cpp +0 -74
  385. package/src/duckdb/src/planner/filter/conjunction_filter.cpp +0 -21
  386. package/src/duckdb/src/planner/filter/constant_filter.cpp +0 -12
  387. package/src/duckdb/src/planner/filter/null_filter.cpp +0 -14
  388. package/src/duckdb/src/planner/joinside.cpp +0 -24
  389. package/src/duckdb/src/planner/logical_operator.cpp +15 -215
  390. package/src/duckdb/src/planner/operator/logical_aggregate.cpp +0 -46
  391. package/src/duckdb/src/planner/operator/logical_any_join.cpp +0 -14
  392. package/src/duckdb/src/planner/operator/logical_column_data_get.cpp +0 -23
  393. package/src/duckdb/src/planner/operator/logical_comparison_join.cpp +0 -23
  394. package/src/duckdb/src/planner/operator/logical_copy_to_file.cpp +2 -56
  395. package/src/duckdb/src/planner/operator/logical_create.cpp +0 -12
  396. package/src/duckdb/src/planner/operator/logical_create_index.cpp +0 -25
  397. package/src/duckdb/src/planner/operator/logical_create_table.cpp +0 -10
  398. package/src/duckdb/src/planner/operator/logical_cross_product.cpp +0 -9
  399. package/src/duckdb/src/planner/operator/logical_cteref.cpp +0 -18
  400. package/src/duckdb/src/planner/operator/logical_delete.cpp +0 -22
  401. package/src/duckdb/src/planner/operator/logical_delim_get.cpp +0 -12
  402. package/src/duckdb/src/planner/operator/logical_dependent_join.cpp +0 -4
  403. package/src/duckdb/src/planner/operator/logical_distinct.cpp +0 -16
  404. package/src/duckdb/src/planner/operator/logical_dummy_scan.cpp +0 -10
  405. package/src/duckdb/src/planner/operator/logical_empty_result.cpp +0 -15
  406. package/src/duckdb/src/planner/operator/logical_expression_get.cpp +0 -24
  407. package/src/duckdb/src/planner/operator/logical_extension_operator.cpp +6 -19
  408. package/src/duckdb/src/planner/operator/logical_filter.cpp +0 -15
  409. package/src/duckdb/src/planner/operator/logical_get.cpp +12 -97
  410. package/src/duckdb/src/planner/operator/logical_insert.cpp +0 -77
  411. package/src/duckdb/src/planner/operator/logical_join.cpp +0 -17
  412. package/src/duckdb/src/planner/operator/logical_limit.cpp +0 -16
  413. package/src/duckdb/src/planner/operator/logical_limit_percent.cpp +0 -16
  414. package/src/duckdb/src/planner/operator/logical_materialized_cte.cpp +0 -13
  415. package/src/duckdb/src/planner/operator/logical_order.cpp +0 -15
  416. package/src/duckdb/src/planner/operator/logical_pivot.cpp +0 -20
  417. package/src/duckdb/src/planner/operator/logical_positional_join.cpp +0 -10
  418. package/src/duckdb/src/planner/operator/logical_pragma.cpp +0 -8
  419. package/src/duckdb/src/planner/operator/logical_prepare.cpp +0 -8
  420. package/src/duckdb/src/planner/operator/logical_projection.cpp +0 -12
  421. package/src/duckdb/src/planner/operator/logical_recursive_cte.cpp +0 -15
  422. package/src/duckdb/src/planner/operator/logical_reset.cpp +0 -12
  423. package/src/duckdb/src/planner/operator/logical_sample.cpp +0 -11
  424. package/src/duckdb/src/planner/operator/logical_set.cpp +0 -14
  425. package/src/duckdb/src/planner/operator/logical_set_operation.cpp +0 -13
  426. package/src/duckdb/src/planner/operator/logical_simple.cpp +0 -60
  427. package/src/duckdb/src/planner/operator/logical_top_n.cpp +0 -14
  428. package/src/duckdb/src/planner/operator/logical_unnest.cpp +0 -14
  429. package/src/duckdb/src/planner/operator/logical_update.cpp +0 -28
  430. package/src/duckdb/src/planner/operator/logical_window.cpp +0 -13
  431. package/src/duckdb/src/planner/planner.cpp +13 -22
  432. package/src/duckdb/src/planner/table_filter.cpp +0 -59
  433. package/src/duckdb/src/storage/checkpoint/row_group_writer.cpp +7 -17
  434. package/src/duckdb/src/storage/checkpoint/table_data_reader.cpp +7 -4
  435. package/src/duckdb/src/storage/checkpoint/table_data_writer.cpp +24 -22
  436. package/src/duckdb/src/storage/checkpoint_manager.cpp +203 -180
  437. package/src/duckdb/src/storage/data_table.cpp +2 -2
  438. package/src/duckdb/src/storage/metadata/metadata_manager.cpp +11 -9
  439. package/src/duckdb/src/storage/partial_block_manager.cpp +42 -15
  440. package/src/duckdb/src/storage/serialization/serialize_constraint.cpp +20 -20
  441. package/src/duckdb/src/storage/serialization/serialize_create_info.cpp +46 -42
  442. package/src/duckdb/src/storage/serialization/serialize_expression.cpp +63 -63
  443. package/src/duckdb/src/storage/serialization/serialize_logical_operator.cpp +167 -165
  444. package/src/duckdb/src/storage/serialization/serialize_macro_function.cpp +12 -12
  445. package/src/duckdb/src/storage/serialization/serialize_nodes.cpp +54 -54
  446. package/src/duckdb/src/storage/serialization/serialize_parse_info.cpp +88 -88
  447. package/src/duckdb/src/storage/serialization/serialize_parsed_expression.cpp +72 -72
  448. package/src/duckdb/src/storage/serialization/serialize_query_node.cpp +20 -20
  449. package/src/duckdb/src/storage/serialization/serialize_result_modifier.cpp +22 -22
  450. package/src/duckdb/src/storage/serialization/serialize_statement.cpp +4 -4
  451. package/src/duckdb/src/storage/serialization/serialize_storage.cpp +41 -6
  452. package/src/duckdb/src/storage/serialization/serialize_table_filter.cpp +24 -24
  453. package/src/duckdb/src/storage/serialization/serialize_tableref.cpp +32 -32
  454. package/src/duckdb/src/storage/serialization/serialize_types.cpp +29 -29
  455. package/src/duckdb/src/storage/single_file_block_manager.cpp +17 -22
  456. package/src/duckdb/src/storage/statistics/base_statistics.cpp +31 -85
  457. package/src/duckdb/src/storage/statistics/column_statistics.cpp +6 -19
  458. package/src/duckdb/src/storage/statistics/distinct_statistics.cpp +0 -26
  459. package/src/duckdb/src/storage/statistics/list_stats.cpp +6 -22
  460. package/src/duckdb/src/storage/statistics/numeric_stats.cpp +20 -135
  461. package/src/duckdb/src/storage/statistics/string_stats.cpp +5 -28
  462. package/src/duckdb/src/storage/statistics/struct_stats.cpp +8 -30
  463. package/src/duckdb/src/storage/storage_info.cpp +1 -1
  464. package/src/duckdb/src/storage/table/chunk_info.cpp +9 -88
  465. package/src/duckdb/src/storage/table/column_checkpoint_state.cpp +28 -34
  466. package/src/duckdb/src/storage/table/column_data.cpp +20 -25
  467. package/src/duckdb/src/storage/table/list_column_data.cpp +16 -9
  468. package/src/duckdb/src/storage/table/row_group.cpp +16 -92
  469. package/src/duckdb/src/storage/table/row_group_collection.cpp +5 -1
  470. package/src/duckdb/src/storage/table/standard_column_data.cpp +10 -7
  471. package/src/duckdb/src/storage/table/struct_column_data.cpp +17 -11
  472. package/src/duckdb/src/storage/table/table_statistics.cpp +13 -22
  473. package/src/duckdb/src/storage/wal_replay.cpp +108 -106
  474. package/src/duckdb/src/storage/write_ahead_log.cpp +135 -64
  475. package/src/duckdb/src/transaction/commit_state.cpp +22 -8
  476. package/src/duckdb/src/verification/deserialized_statement_verifier.cpp +11 -6
  477. package/src/duckdb/src/verification/statement_verifier.cpp +0 -5
  478. package/src/duckdb/third_party/parquet/parquet_types.h +1 -1
  479. package/src/duckdb/ub_src_common.cpp +0 -4
  480. package/src/duckdb/ub_src_common_serializer.cpp +2 -4
  481. package/src/duckdb/ub_src_planner.cpp +0 -2
  482. package/src/duckdb/ub_src_planner_expression.cpp +0 -2
  483. package/src/duckdb/ub_src_planner_operator.cpp +0 -8
  484. package/src/duckdb_node.cpp +6 -12
  485. package/src/duckdb_node.hpp +23 -13
  486. package/src/statement.cpp +15 -16
  487. package/test/database_fail.test.ts +20 -0
  488. package/test/worker.js +7 -0
  489. package/src/duckdb/src/common/field_writer.cpp +0 -97
  490. package/src/duckdb/src/common/serializer/buffered_deserializer.cpp +0 -27
  491. package/src/duckdb/src/common/serializer/buffered_serializer.cpp +0 -36
  492. package/src/duckdb/src/common/serializer.cpp +0 -24
  493. package/src/duckdb/src/include/duckdb/common/field_writer.hpp +0 -379
  494. package/src/duckdb/src/include/duckdb/common/serializer/buffered_deserializer.hpp +0 -41
  495. package/src/duckdb/src/include/duckdb/common/serializer/buffered_serializer.hpp +0 -50
  496. package/src/duckdb/src/include/duckdb/common/serializer.hpp +0 -151
  497. package/src/duckdb/src/include/duckdb/planner/plan_serialization.hpp +0 -44
  498. package/src/duckdb/src/include/duckdb/verification/deserialized_statement_verifier_v2.hpp +0 -32
  499. package/src/duckdb/src/planner/expression/bound_default_expression.cpp +0 -16
  500. package/src/duckdb/src/planner/operator/logical_execute.cpp +0 -12
  501. package/src/duckdb/src/planner/operator/logical_explain.cpp +0 -22
  502. package/src/duckdb/src/planner/operator/logical_export.cpp +0 -13
  503. package/src/duckdb/src/planner/operator/logical_show.cpp +0 -21
  504. package/src/duckdb/src/planner/parsed_data/bound_create_table_info.cpp +0 -22
  505. package/src/duckdb/src/planner/plan_serialization.cpp +0 -20
  506. package/src/duckdb/src/verification/deserialized_statement_verifier_v2.cpp +0 -34
  507. package/src/duckdb/ub_src_planner_parsed_data.cpp +0 -2
@@ -26,11 +26,8 @@ public:
26
26
  unique_ptr<ParseInfo> info;
27
27
 
28
28
  public:
29
- void Serialize(FieldWriter &writer) const override;
30
- static unique_ptr<LogicalOperator> Deserialize(LogicalDeserializationState &state, FieldReader &reader);
31
-
32
- void FormatSerialize(FormatSerializer &serializer) const override;
33
- static unique_ptr<LogicalOperator> FormatDeserialize(FormatDeserializer &deserializer);
29
+ void Serialize(Serializer &serializer) const override;
30
+ static unique_ptr<LogicalOperator> Deserialize(Deserializer &deserializer);
34
31
  idx_t EstimateCardinality(ClientContext &context) override;
35
32
 
36
33
  protected:
@@ -33,11 +33,9 @@ public:
33
33
  vector<ColumnBinding> GetColumnBindings() override {
34
34
  return children[0]->GetColumnBindings();
35
35
  }
36
- void Serialize(FieldWriter &writer) const override;
37
- static unique_ptr<LogicalOperator> Deserialize(LogicalDeserializationState &state, FieldReader &reader);
38
36
 
39
- void FormatSerialize(FormatSerializer &serializer) const override;
40
- static unique_ptr<LogicalOperator> FormatDeserialize(FormatDeserializer &deserializer);
37
+ void Serialize(Serializer &serializer) const override;
38
+ static unique_ptr<LogicalOperator> Deserialize(Deserializer &deserializer);
41
39
 
42
40
  idx_t EstimateCardinality(ClientContext &context) override;
43
41
 
@@ -26,10 +26,8 @@ public:
26
26
 
27
27
  public:
28
28
  vector<ColumnBinding> GetColumnBindings() override;
29
- void Serialize(FieldWriter &writer) const override;
30
- static unique_ptr<LogicalOperator> Deserialize(LogicalDeserializationState &state, FieldReader &reader);
31
- void FormatSerialize(FormatSerializer &serializer) const override;
32
- static unique_ptr<LogicalOperator> FormatDeserialize(FormatDeserializer &deserializer);
29
+ void Serialize(Serializer &serializer) const override;
30
+ static unique_ptr<LogicalOperator> Deserialize(Deserializer &deserializer);
33
31
  vector<idx_t> GetTableIndex() const override;
34
32
  string GetName() const override;
35
33
 
@@ -31,10 +31,8 @@ public:
31
31
  bool update_is_del_and_insert;
32
32
 
33
33
  public:
34
- void Serialize(FieldWriter &writer) const override;
35
- static unique_ptr<LogicalOperator> Deserialize(LogicalDeserializationState &state, FieldReader &reader);
36
- void FormatSerialize(FormatSerializer &serializer) const override;
37
- static unique_ptr<LogicalOperator> FormatDeserialize(FormatDeserializer &deserializer);
34
+ void Serialize(Serializer &serializer) const override;
35
+ static unique_ptr<LogicalOperator> Deserialize(Deserializer &deserializer);
38
36
 
39
37
  idx_t EstimateCardinality(ClientContext &context) override;
40
38
  string GetName() const override;
@@ -27,11 +27,9 @@ public:
27
27
 
28
28
  public:
29
29
  vector<ColumnBinding> GetColumnBindings() override;
30
- void Serialize(FieldWriter &writer) const override;
31
- static unique_ptr<LogicalOperator> Deserialize(LogicalDeserializationState &state, FieldReader &reader);
32
30
 
33
- void FormatSerialize(FormatSerializer &serializer) const override;
34
- static unique_ptr<LogicalOperator> FormatDeserialize(FormatDeserializer &deserializer);
31
+ void Serialize(Serializer &serializer) const override;
32
+ static unique_ptr<LogicalOperator> Deserialize(Deserializer &deserializer);
35
33
  vector<idx_t> GetTableIndex() const override;
36
34
  string GetName() const override;
37
35
 
@@ -34,9 +34,7 @@ public:
34
34
  shared_ptr<OperatorExtensionInfo> operator_info;
35
35
 
36
36
  virtual std::string GetName() = 0;
37
- virtual unique_ptr<LogicalExtensionOperator> Deserialize(LogicalDeserializationState &state,
38
- FieldReader &reader) = 0;
39
- virtual unique_ptr<LogicalExtensionOperator> FormatDeserialize(FormatDeserializer &deserializer) = 0;
37
+ virtual unique_ptr<LogicalExtensionOperator> Deserialize(Deserializer &deserializer) = 0;
40
38
 
41
39
  virtual ~OperatorExtension() {
42
40
  }
@@ -49,11 +49,6 @@ struct BoundCreateTableInfo {
49
49
  //! Indexes created by this table <Block_ID, Offset>
50
50
  vector<BlockPointer> indexes;
51
51
 
52
- //! Serializes a BoundCreateTableInfo to a stand-alone binary blob
53
- void Serialize(Serializer &serializer) const;
54
- //! Deserializes a blob back into a BoundCreateTableInfo
55
- static unique_ptr<BoundCreateTableInfo> Deserialize(Deserializer &source, PlanDeserializationState &state);
56
-
57
52
  CreateTableInfo &Base() {
58
53
  D_ASSERT(base);
59
54
  return (CreateTableInfo &)*base;
@@ -15,8 +15,6 @@
15
15
 
16
16
  namespace duckdb {
17
17
  class BaseStatistics;
18
- class FieldWriter;
19
- class FieldReader;
20
18
 
21
19
  enum class TableFilterType : uint8_t {
22
20
  CONSTANT_COMPARISON = 0, // constant comparison (e.g. =C, >C, >=C, <C, <=C)
@@ -44,12 +42,8 @@ public:
44
42
  return filter_type != other.filter_type;
45
43
  }
46
44
 
47
- void Serialize(Serializer &serializer) const;
48
- virtual void Serialize(FieldWriter &writer) const = 0;
49
- static unique_ptr<TableFilter> Deserialize(Deserializer &source);
50
-
51
- virtual void FormatSerialize(FormatSerializer &serializer) const;
52
- static unique_ptr<TableFilter> FormatDeserialize(FormatDeserializer &deserializer);
45
+ virtual void Serialize(Serializer &serializer) const;
46
+ static unique_ptr<TableFilter> Deserialize(Deserializer &deserializer);
53
47
 
54
48
  public:
55
49
  template <class TARGET>
@@ -102,10 +96,7 @@ public:
102
96
  }
103
97
 
104
98
  void Serialize(Serializer &serializer) const;
105
- static unique_ptr<TableFilterSet> Deserialize(Deserializer &source);
106
-
107
- void FormatSerialize(FormatSerializer &serializer) const;
108
- static TableFilterSet FormatDeserialize(FormatDeserializer &deserializer);
99
+ static TableFilterSet Deserialize(Deserializer &deserializer);
109
100
  };
110
101
 
111
102
  } // namespace duckdb
@@ -26,8 +26,8 @@ struct BoundPivotInfo {
26
26
  //! The set of aggregate functions that is being executed
27
27
  vector<unique_ptr<Expression>> aggregates;
28
28
 
29
- void FormatSerialize(FormatSerializer &serializer) const;
30
- static BoundPivotInfo FormatDeserialize(FormatDeserializer &deserializer);
29
+ void Serialize(Serializer &serializer) const;
30
+ static BoundPivotInfo Deserialize(Deserializer &deserializer);
31
31
  };
32
32
 
33
33
  class BoundPivotRef : public BoundTableRef {
@@ -14,8 +14,8 @@
14
14
 
15
15
  namespace duckdb {
16
16
 
17
- class FormatSerializer;
18
- class FormatDeserializer;
17
+ class Serializer;
18
+ class Deserializer;
19
19
 
20
20
  class Block : public FileBuffer {
21
21
  public:
@@ -38,6 +38,9 @@ struct BlockPointer {
38
38
  bool IsValid() const {
39
39
  return block_id != INVALID_BLOCK;
40
40
  }
41
+
42
+ void Serialize(Serializer &serializer) const;
43
+ static BlockPointer Deserialize(Deserializer &source);
41
44
  };
42
45
 
43
46
  struct MetaBlockPointer {
@@ -55,8 +58,8 @@ struct MetaBlockPointer {
55
58
  block_id_t GetBlockId();
56
59
  uint32_t GetBlockIndex();
57
60
 
58
- void FormatSerialize(FormatSerializer &serializer) const;
59
- static MetaBlockPointer FormatDeserialize(FormatDeserializer &source);
61
+ void Serialize(Serializer &serializer) const;
62
+ static MetaBlockPointer Deserialize(Deserializer &source);
60
63
  };
61
64
 
62
65
  } // namespace duckdb
@@ -30,7 +30,7 @@ public:
30
30
 
31
31
  CompressionType GetColumnCompressionType(idx_t i);
32
32
 
33
- virtual void WriteColumnDataPointers(ColumnCheckpointState &column_checkpoint_state) = 0;
33
+ virtual void WriteColumnDataPointers(ColumnCheckpointState &column_checkpoint_state, Serializer &serializer) = 0;
34
34
 
35
35
  virtual MetadataWriter &GetPayloadWriter() = 0;
36
36
 
@@ -59,7 +59,8 @@ public:
59
59
  MetadataWriter &table_data_writer;
60
60
 
61
61
  public:
62
- virtual void WriteColumnDataPointers(ColumnCheckpointState &column_checkpoint_state) override;
62
+ virtual void WriteColumnDataPointers(ColumnCheckpointState &column_checkpoint_state,
63
+ Serializer &serializer) override;
63
64
 
64
65
  virtual MetadataWriter &GetPayloadWriter() override;
65
66
  };
@@ -27,11 +27,12 @@ public:
27
27
  virtual ~TableDataWriter();
28
28
 
29
29
  public:
30
- void WriteTableData();
30
+ void WriteTableData(Serializer &metadata_serializer);
31
31
 
32
32
  CompressionType GetColumnCompressionType(idx_t i);
33
33
 
34
- virtual void FinalizeTable(TableStatistics &&global_stats, DataTableInfo *info) = 0;
34
+ virtual void FinalizeTable(TableStatistics &&global_stats, DataTableInfo *info,
35
+ Serializer &metadata_serializer) = 0;
35
36
  virtual unique_ptr<RowGroupWriter> GetRowGroupWriter(RowGroup &row_group) = 0;
36
37
 
37
38
  virtual void AddRowGroup(RowGroupPointer &&row_group_pointer, unique_ptr<RowGroupWriter> &&writer);
@@ -45,18 +46,17 @@ protected:
45
46
  class SingleFileTableDataWriter : public TableDataWriter {
46
47
  public:
47
48
  SingleFileTableDataWriter(SingleFileCheckpointWriter &checkpoint_manager, TableCatalogEntry &table,
48
- MetadataWriter &table_data_writer, MetadataWriter &meta_data_writer);
49
+ MetadataWriter &table_data_writer);
49
50
 
50
51
  public:
51
- virtual void FinalizeTable(TableStatistics &&global_stats, DataTableInfo *info) override;
52
+ virtual void FinalizeTable(TableStatistics &&global_stats, DataTableInfo *info,
53
+ Serializer &metadata_serializer) override;
52
54
  virtual unique_ptr<RowGroupWriter> GetRowGroupWriter(RowGroup &row_group) override;
53
55
 
54
56
  private:
55
57
  SingleFileCheckpointWriter &checkpoint_manager;
56
58
  // Writes the actual table data
57
59
  MetadataWriter &table_data_writer;
58
- // Writes the metadata of the table
59
- MetadataWriter &meta_data_writer;
60
60
  };
61
61
 
62
62
  } // namespace duckdb
@@ -38,14 +38,14 @@ public:
38
38
  virtual unique_ptr<TableDataWriter> GetTableDataWriter(TableCatalogEntry &table) = 0;
39
39
 
40
40
  protected:
41
- virtual void WriteSchema(SchemaCatalogEntry &schema);
42
- virtual void WriteTable(TableCatalogEntry &table);
43
- virtual void WriteView(ViewCatalogEntry &table);
44
- virtual void WriteSequence(SequenceCatalogEntry &table);
45
- virtual void WriteMacro(ScalarMacroCatalogEntry &table);
46
- virtual void WriteTableMacro(TableMacroCatalogEntry &table);
47
- virtual void WriteIndex(IndexCatalogEntry &index_catalog);
48
- virtual void WriteType(TypeCatalogEntry &type);
41
+ virtual void WriteSchema(SchemaCatalogEntry &schema, Serializer &serializer);
42
+ virtual void WriteTable(TableCatalogEntry &table, Serializer &serializer);
43
+ virtual void WriteView(ViewCatalogEntry &table, Serializer &serializer);
44
+ virtual void WriteSequence(SequenceCatalogEntry &table, Serializer &serializer);
45
+ virtual void WriteMacro(ScalarMacroCatalogEntry &table, Serializer &serializer);
46
+ virtual void WriteTableMacro(TableMacroCatalogEntry &table, Serializer &serializer);
47
+ virtual void WriteIndex(IndexCatalogEntry &index_catalog, Serializer &serializer);
48
+ virtual void WriteType(TypeCatalogEntry &type, Serializer &serializer);
49
49
  };
50
50
 
51
51
  class CheckpointReader {
@@ -60,16 +60,16 @@ protected:
60
60
 
61
61
  protected:
62
62
  virtual void LoadCheckpoint(ClientContext &context, MetadataReader &reader);
63
- virtual void ReadSchema(ClientContext &context, MetadataReader &reader);
64
- virtual void ReadTable(ClientContext &context, MetadataReader &reader);
65
- virtual void ReadView(ClientContext &context, MetadataReader &reader);
66
- virtual void ReadSequence(ClientContext &context, MetadataReader &reader);
67
- virtual void ReadMacro(ClientContext &context, MetadataReader &reader);
68
- virtual void ReadTableMacro(ClientContext &context, MetadataReader &reader);
69
- virtual void ReadIndex(ClientContext &context, MetadataReader &reader);
70
- virtual void ReadType(ClientContext &context, MetadataReader &reader);
71
-
72
- virtual void ReadTableData(ClientContext &context, MetadataReader &reader, BoundCreateTableInfo &bound_info);
63
+ virtual void ReadSchema(ClientContext &context, Deserializer &deserializer);
64
+ virtual void ReadTable(ClientContext &context, Deserializer &deserializer);
65
+ virtual void ReadView(ClientContext &context, Deserializer &deserializer);
66
+ virtual void ReadSequence(ClientContext &context, Deserializer &deserializer);
67
+ virtual void ReadMacro(ClientContext &context, Deserializer &deserializer);
68
+ virtual void ReadTableMacro(ClientContext &context, Deserializer &deserializer);
69
+ virtual void ReadIndex(ClientContext &context, Deserializer &deserializer);
70
+ virtual void ReadType(ClientContext &context, Deserializer &deserializer);
71
+
72
+ virtual void ReadTableData(ClientContext &context, Deserializer &deserializer, BoundCreateTableInfo &bound_info);
73
73
  };
74
74
 
75
75
  class SingleFileCheckpointReader final : public CheckpointReader {
@@ -17,6 +17,9 @@
17
17
 
18
18
  namespace duckdb {
19
19
 
20
+ class Serializer;
21
+ class Deserializer;
22
+
20
23
  struct DataPointer {
21
24
  DataPointer(BaseStatistics stats) : statistics(std::move(stats)) {
22
25
  }
@@ -27,6 +30,9 @@ struct DataPointer {
27
30
  CompressionType compression_type;
28
31
  //! Type-specific statistics of the segment
29
32
  BaseStatistics statistics;
33
+
34
+ void Serialize(Serializer &serializer) const;
35
+ static DataPointer Deserialize(Deserializer &source);
30
36
  };
31
37
 
32
38
  struct RowGroupPointer {
@@ -175,7 +175,7 @@ public:
175
175
  void SetDistinct(column_t column_id, unique_ptr<DistinctStatistics> distinct_stats);
176
176
 
177
177
  //! Checkpoint the table to the specified table data writer
178
- void Checkpoint(TableDataWriter &writer);
178
+ void Checkpoint(TableDataWriter &writer, Serializer &metadata_serializer);
179
179
  void CommitDropTable();
180
180
  void CommitDropColumn(idx_t index);
181
181
 
@@ -9,7 +9,6 @@
9
9
  #pragma once
10
10
 
11
11
  #include "duckdb/common/common.hpp"
12
- #include "duckdb/common/serializer.hpp"
13
12
  #include "duckdb/storage/block.hpp"
14
13
  #include "duckdb/storage/block_manager.hpp"
15
14
  #include "duckdb/common/set.hpp"
@@ -23,8 +22,8 @@ struct MetadataBlock {
23
22
  block_id_t block_id;
24
23
  vector<uint8_t> free_blocks;
25
24
 
26
- void Serialize(Serializer &serializer);
27
- static MetadataBlock Deserialize(Deserializer &source);
25
+ void Write(WriteStream &sink);
26
+ static MetadataBlock Read(ReadStream &source);
28
27
 
29
28
  idx_t FreeBlocksToInteger();
30
29
  void FreeBlocksFromInteger(idx_t blocks);
@@ -68,8 +67,8 @@ public:
68
67
 
69
68
  idx_t BlockCount();
70
69
 
71
- void Serialize(Serializer &serializer);
72
- void Deserialize(Deserializer &source);
70
+ void Write(WriteStream &sink);
71
+ void Read(ReadStream &source);
73
72
 
74
73
  protected:
75
74
  BlockManager &block_manager;
@@ -9,12 +9,13 @@
9
9
  #pragma once
10
10
 
11
11
  #include "duckdb/storage/metadata/metadata_manager.hpp"
12
+ #include "duckdb/common/serializer/read_stream.hpp"
12
13
 
13
14
  namespace duckdb {
14
15
 
15
16
  enum class BlockReaderType { EXISTING_BLOCKS, REGISTER_BLOCKS };
16
17
 
17
- class MetadataReader : public Deserializer {
18
+ class MetadataReader : public ReadStream {
18
19
  public:
19
20
  MetadataReader(MetadataManager &manager, MetaBlockPointer pointer,
20
21
  BlockReaderType type = BlockReaderType::EXISTING_BLOCKS);
@@ -9,10 +9,11 @@
9
9
  #pragma once
10
10
 
11
11
  #include "duckdb/storage/metadata/metadata_manager.hpp"
12
+ #include "duckdb/common/serializer/write_stream.hpp"
12
13
 
13
14
  namespace duckdb {
14
15
 
15
- class MetadataWriter : public Serializer {
16
+ class MetadataWriter : public WriteStream {
16
17
  public:
17
18
  MetadataWriter(const MetadataWriter &) = delete;
18
19
  MetadataWriter &operator=(const MetadataWriter &) = delete;
@@ -22,7 +23,6 @@ public:
22
23
 
23
24
  public:
24
25
  void WriteData(const_data_ptr_t buffer, idx_t write_size) override;
25
-
26
26
  void Flush();
27
27
 
28
28
  BlockPointer GetBlockPointer();
@@ -25,30 +25,46 @@ class TableCatalogEntry;
25
25
  class ViewCatalogEntry;
26
26
  class TypeCatalogEntry;
27
27
 
28
+ //! Regions that require zero-initialization to avoid leaking memory
29
+ struct UninitializedRegion {
30
+ idx_t start;
31
+ idx_t end;
32
+ };
33
+
34
+ //! The current state of a partial block
28
35
  struct PartialBlockState {
36
+ //! The block id of the partial block
29
37
  block_id_t block_id;
30
- //! How big is the block we're writing to. (Total bytes to assign).
38
+ //! The total bytes that we can assign to this block
31
39
  uint32_t block_size;
32
- //! How many bytes of the allocation are used. (offset_in_block of next allocation)
33
- uint32_t offset_in_block;
34
- //! How many times has the block been used?
40
+ //! Next allocation offset, and also the current allocation size
41
+ uint32_t offset;
42
+ //! The number of times that this block has been used for partial allocations
35
43
  uint32_t block_use_count;
36
44
  };
37
45
 
38
46
  struct PartialBlock {
39
- explicit PartialBlock(PartialBlockState state) : state(std::move(state)) {
40
- }
47
+ PartialBlock(PartialBlockState state, BlockManager &block_manager, const shared_ptr<BlockHandle> &block_handle);
41
48
  virtual ~PartialBlock() {
42
49
  }
43
50
 
51
+ //! The current state of a partial block
44
52
  PartialBlockState state;
53
+ //! All uninitialized regions on this block, we need to zero-initialize them when flushing
54
+ vector<UninitializedRegion> uninitialized_regions;
55
+ //! The block manager of the partial block manager
56
+ BlockManager &block_manager;
57
+ //! The block handle of the underlying block that this partial block writes to
58
+ shared_ptr<BlockHandle> block_handle;
45
59
 
46
60
  public:
47
- virtual void AddUninitializedRegion(idx_t start, idx_t end) = 0;
48
- virtual void Flush(idx_t free_space_left) = 0;
49
- virtual void Clear() {
50
- }
51
- virtual void Merge(PartialBlock &other, idx_t offset, idx_t other_size);
61
+ //! Add regions that need zero-initialization to avoid leaking memory
62
+ void AddUninitializedRegion(const idx_t start, const idx_t end);
63
+ //! Flush the block to disk and zero-initialize any free space and uninitialized regions
64
+ virtual void Flush(const idx_t free_space_left) = 0;
65
+ void FlushInternal(const idx_t free_space_left);
66
+ virtual void Merge(PartialBlock &other, idx_t offset, idx_t other_size) = 0;
67
+ virtual void Clear() = 0;
52
68
 
53
69
  public:
54
70
  template <class TARGET>
@@ -59,13 +75,13 @@ public:
59
75
  };
60
76
 
61
77
  struct PartialBlockAllocation {
62
- // BlockManager owning the block_id
78
+ //! The BlockManager owning the block_id
63
79
  BlockManager *block_manager {nullptr};
64
- //! How many bytes assigned to the caller?
80
+ //! The number of assigned bytes to the caller
65
81
  uint32_t allocation_size;
66
- //! State of assigned block.
82
+ //! The current state of the partial block
67
83
  PartialBlockState state;
68
- //! Arbitrary state related to partial block storage.
84
+ //! Arbitrary state related to the partial block storage
69
85
  unique_ptr<PartialBlock> partial_block;
70
86
  };
71
87
 
@@ -76,12 +92,12 @@ enum class CheckpointType { FULL_CHECKPOINT, APPEND_TO_TABLE };
76
92
  //! In any case, they must share a block manager.
77
93
  class PartialBlockManager {
78
94
  public:
79
- // 20% free / 80% utilization
95
+ //! 20% free / 80% utilization
80
96
  static constexpr const idx_t DEFAULT_MAX_PARTIAL_BLOCK_SIZE = Storage::BLOCK_SIZE / 5 * 4;
81
- // Max number of shared references to a block. No effective limit by default.
97
+ //! Max number of shared references to a block. No effective limit by default.
82
98
  static constexpr const idx_t DEFAULT_MAX_USE_COUNT = 1u << 20;
83
- // No point letting map size grow unbounded. We'll drop blocks with the
84
- // least free space first.
99
+ //! No point letting map size grow unbounded. We'll drop blocks with the
100
+ //! least free space first.
85
101
  static constexpr const idx_t MAX_BLOCK_MAP_SIZE = 1u << 31;
86
102
 
87
103
  public:
@@ -19,13 +19,9 @@
19
19
  namespace duckdb {
20
20
  struct SelectionVector;
21
21
 
22
- class FormatSerializer;
23
- class FormatDeserializer;
24
-
25
22
  class Serializer;
26
23
  class Deserializer;
27
- class FieldWriter;
28
- class FieldReader;
24
+
29
25
  class Vector;
30
26
  struct UnifiedVectorFormat;
31
27
 
@@ -96,11 +92,7 @@ public:
96
92
  void CopyBase(const BaseStatistics &orig);
97
93
 
98
94
  void Serialize(Serializer &serializer) const;
99
- void Serialize(FieldWriter &writer) const;
100
- static BaseStatistics Deserialize(Deserializer &source, LogicalType type);
101
-
102
- void FormatSerialize(FormatSerializer &serializer) const;
103
- static BaseStatistics FormatDeserialize(FormatDeserializer &deserializer);
95
+ static BaseStatistics Deserialize(Deserializer &deserializer);
104
96
 
105
97
  //! Verify that a vector does not violate the statistics
106
98
  void Verify(Vector &vector, const SelectionVector &sel, idx_t count) const;
@@ -122,7 +114,6 @@ private:
122
114
 
123
115
  static BaseStatistics CreateUnknownType(LogicalType type);
124
116
  static BaseStatistics CreateEmptyType(LogicalType type);
125
- static BaseStatistics DeserializeType(FieldReader &reader, LogicalType type);
126
117
  static BaseStatistics FromConstantType(const Value &input);
127
118
 
128
119
  private:
@@ -12,7 +12,7 @@
12
12
  #include "duckdb/storage/statistics/distinct_statistics.hpp"
13
13
 
14
14
  namespace duckdb {
15
- class FormatSerializer;
15
+ class Serializer;
16
16
 
17
17
  class ColumnStatistics {
18
18
  public:
@@ -33,11 +33,9 @@ public:
33
33
  void SetDistinct(unique_ptr<DistinctStatistics> distinct_stats);
34
34
 
35
35
  shared_ptr<ColumnStatistics> Copy() const;
36
- void Serialize(Serializer &serializer) const;
37
- static shared_ptr<ColumnStatistics> Deserialize(Deserializer &source, const LogicalType &type);
38
36
 
39
- void FormatSerialize(FormatSerializer &serializer) const;
40
- static shared_ptr<ColumnStatistics> FormatDeserialize(FormatDeserializer &source);
37
+ void Serialize(Serializer &serializer) const;
38
+ static shared_ptr<ColumnStatistics> Deserialize(Deserializer &source);
41
39
 
42
40
  private:
43
41
  BaseStatistics stats;
@@ -13,11 +13,9 @@
13
13
  #include "duckdb/storage/statistics/base_statistics.hpp"
14
14
 
15
15
  namespace duckdb {
16
+ class Vector;
16
17
  class Serializer;
17
18
  class Deserializer;
18
- class Vector;
19
- class FormatSerializer;
20
- class FormatDeserializer;
21
19
 
22
20
  class DistinctStatistics {
23
21
  public:
@@ -36,12 +34,6 @@ public:
36
34
 
37
35
  unique_ptr<DistinctStatistics> Copy() const;
38
36
 
39
- void Serialize(Serializer &serializer) const;
40
- void Serialize(FieldWriter &writer) const;
41
-
42
- static unique_ptr<DistinctStatistics> Deserialize(Deserializer &source);
43
- static unique_ptr<DistinctStatistics> Deserialize(FieldReader &reader);
44
-
45
37
  void Update(Vector &update, idx_t count, bool sample = true);
46
38
  void Update(UnifiedVectorFormat &update_data, const LogicalType &ptype, idx_t count, bool sample = true);
47
39
 
@@ -50,8 +42,8 @@ public:
50
42
 
51
43
  static bool TypeIsSupported(const LogicalType &type);
52
44
 
53
- void FormatSerialize(FormatSerializer &serializer) const;
54
- static unique_ptr<DistinctStatistics> FormatDeserialize(FormatDeserializer &deserializer);
45
+ void Serialize(Serializer &serializer) const;
46
+ static unique_ptr<DistinctStatistics> Deserialize(Deserializer &deserializer);
55
47
 
56
48
  private:
57
49
  //! For distinct statistics we sample the input to speed up insertions
@@ -14,8 +14,6 @@
14
14
 
15
15
  namespace duckdb {
16
16
  class BaseStatistics;
17
- class FieldWriter;
18
- class FieldReader;
19
17
  struct SelectionVector;
20
18
  class Vector;
21
19
 
@@ -28,11 +26,8 @@ struct ListStats {
28
26
  DUCKDB_API static BaseStatistics &GetChildStats(BaseStatistics &stats);
29
27
  DUCKDB_API static void SetChildStats(BaseStatistics &stats, unique_ptr<BaseStatistics> new_stats);
30
28
 
31
- DUCKDB_API static void Serialize(const BaseStatistics &stats, FieldWriter &writer);
32
- DUCKDB_API static BaseStatistics Deserialize(FieldReader &reader, LogicalType type);
33
-
34
- DUCKDB_API static void FormatSerialize(const BaseStatistics &stats, FormatSerializer &serializer);
35
- DUCKDB_API static BaseStatistics FormatDeserialize(FormatDeserializer &deserializer, LogicalType type);
29
+ DUCKDB_API static void Serialize(const BaseStatistics &stats, Serializer &serializer);
30
+ DUCKDB_API static void Deserialize(Deserializer &deserializer, BaseStatistics &base);
36
31
 
37
32
  DUCKDB_API static string ToString(const BaseStatistics &stats);
38
33
 
@@ -9,7 +9,6 @@
9
9
  #pragma once
10
10
 
11
11
  #include "duckdb/common/common.hpp"
12
- #include "duckdb/common/serializer.hpp"
13
12
 
14
13
  namespace duckdb {
15
14
 
@@ -24,31 +23,6 @@ public:
24
23
  : has_estimated_cardinality(true), estimated_cardinality(estimated_cardinality), has_max_cardinality(true),
25
24
  max_cardinality(max_cardinality) {
26
25
  }
27
- void Serialize(Serializer &serializer) const {
28
- serializer.Write(has_estimated_cardinality);
29
- if (has_estimated_cardinality) {
30
- serializer.Write(estimated_cardinality);
31
- serializer.Write(has_max_cardinality);
32
- if (has_max_cardinality) {
33
- serializer.Write(max_cardinality);
34
- }
35
- } else {
36
- D_ASSERT(!has_max_cardinality);
37
- }
38
- }
39
- static unique_ptr<NodeStatistics> Deserialize(Deserializer &source) {
40
- bool has_estimated_cardinality = source.Read<bool>();
41
- if (!has_estimated_cardinality) {
42
- return make_uniq<NodeStatistics>();
43
- }
44
- idx_t estimated_cardinality = source.Read<idx_t>();
45
- bool has_max_cardinality = source.Read<bool>();
46
- if (!has_max_cardinality) {
47
- return make_uniq<NodeStatistics>(estimated_cardinality);
48
- }
49
- idx_t max_cardinality = source.Read<idx_t>();
50
- return make_uniq<NodeStatistics>(estimated_cardinality, max_cardinality);
51
- }
52
26
 
53
27
  //! Whether or not the node has an estimated cardinality specified
54
28
  bool has_estimated_cardinality;