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
@@ -6,7 +6,6 @@
6
6
  #include "duckdb/common/operator/comparison_operators.hpp"
7
7
  #include "duckdb/common/pair.hpp"
8
8
  #include "duckdb/common/printer.hpp"
9
- #include "duckdb/common/serializer.hpp"
10
9
  #include "duckdb/common/types/null_value.hpp"
11
10
  #include "duckdb/common/types/sel_cache.hpp"
12
11
  #include "duckdb/common/types/vector_cache.hpp"
@@ -20,8 +19,8 @@
20
19
  #include "duckdb/common/types/bit.hpp"
21
20
  #include "duckdb/common/types/value_map.hpp"
22
21
 
23
- #include "duckdb/common/serializer/format_serializer.hpp"
24
- #include "duckdb/common/serializer/format_deserializer.hpp"
22
+ #include "duckdb/common/serializer/serializer.hpp"
23
+ #include "duckdb/common/serializer/deserializer.hpp"
25
24
 
26
25
  #include <cstring> // strlen() on Solaris
27
26
 
@@ -924,75 +923,7 @@ void Vector::Sequence(int64_t start, int64_t increment, idx_t count) {
924
923
  auxiliary.reset();
925
924
  }
926
925
 
927
- void Vector::Serialize(idx_t count, Serializer &serializer) {
928
- auto &type = GetType();
929
-
930
- UnifiedVectorFormat vdata;
931
- ToUnifiedFormat(count, vdata);
932
-
933
- const auto write_validity = (count > 0) && !vdata.validity.AllValid();
934
- serializer.Write<bool>(write_validity);
935
- if (write_validity) {
936
- ValidityMask flat_mask(count);
937
- for (idx_t i = 0; i < count; ++i) {
938
- auto row_idx = vdata.sel->get_index(i);
939
- flat_mask.Set(i, vdata.validity.RowIsValid(row_idx));
940
- }
941
- serializer.WriteData(const_data_ptr_cast(flat_mask.GetData()), flat_mask.ValidityMaskSize(count));
942
- }
943
- if (TypeIsConstantSize(type.InternalType())) {
944
- // constant size type: simple copy
945
- idx_t write_size = GetTypeIdSize(type.InternalType()) * count;
946
- auto ptr = make_unsafe_uniq_array<data_t>(write_size);
947
- VectorOperations::WriteToStorage(*this, count, ptr.get());
948
- serializer.WriteData(ptr.get(), write_size);
949
- } else {
950
- switch (type.InternalType()) {
951
- case PhysicalType::VARCHAR: {
952
- auto strings = UnifiedVectorFormat::GetData<string_t>(vdata);
953
- for (idx_t i = 0; i < count; i++) {
954
- auto idx = vdata.sel->get_index(i);
955
- auto source = !vdata.validity.RowIsValid(idx) ? NullValue<string_t>() : strings[idx];
956
- serializer.WriteStringLen(const_data_ptr_cast(source.GetData()), source.GetSize());
957
- }
958
- break;
959
- }
960
- case PhysicalType::STRUCT: {
961
- Flatten(count);
962
- auto &entries = StructVector::GetEntries(*this);
963
- for (auto &entry : entries) {
964
- entry->Serialize(count, serializer);
965
- }
966
- break;
967
- }
968
- case PhysicalType::LIST: {
969
- auto &child = ListVector::GetEntry(*this);
970
- auto list_size = ListVector::GetListSize(*this);
971
-
972
- // serialize the list entries in a flat array
973
- auto data = make_unsafe_uniq_array<list_entry_t>(count);
974
- auto source_array = UnifiedVectorFormat::GetData<list_entry_t>(vdata);
975
- for (idx_t i = 0; i < count; i++) {
976
- auto idx = vdata.sel->get_index(i);
977
- auto source = source_array[idx];
978
- data[i].offset = source.offset;
979
- data[i].length = source.length;
980
- }
981
-
982
- // write the list size
983
- serializer.Write<idx_t>(list_size);
984
- serializer.WriteData(const_data_ptr_cast(data.get()), count * sizeof(list_entry_t));
985
-
986
- child.Serialize(list_size, serializer);
987
- break;
988
- }
989
- default:
990
- throw InternalException("Unimplemented variable width type for Vector::Serialize!");
991
- }
992
- }
993
- }
994
-
995
- void Vector::FormatSerialize(FormatSerializer &serializer, idx_t count) {
926
+ void Vector::Serialize(Serializer &serializer, idx_t count) {
996
927
  auto &logical_type = GetType();
997
928
 
998
929
  UnifiedVectorFormat vdata;
@@ -1021,7 +952,7 @@ void Vector::FormatSerialize(FormatSerializer &serializer, idx_t count) {
1021
952
  auto strings = UnifiedVectorFormat::GetData<string_t>(vdata);
1022
953
 
1023
954
  // Serialize data as a list
1024
- serializer.WriteList(102, "data", count, [&](FormatSerializer::List &list, idx_t i) {
955
+ serializer.WriteList(102, "data", count, [&](Serializer::List &list, idx_t i) {
1025
956
  auto idx = vdata.sel->get_index(i);
1026
957
  auto str = !vdata.validity.RowIsValid(idx) ? NullValue<string_t>() : strings[idx];
1027
958
  list.WriteElement(str);
@@ -1033,8 +964,8 @@ void Vector::FormatSerialize(FormatSerializer &serializer, idx_t count) {
1033
964
  auto &entries = StructVector::GetEntries(*this);
1034
965
 
1035
966
  // Serialize entries as a list
1036
- serializer.WriteList(103, "children", count, [&](FormatSerializer::List &list, idx_t i) {
1037
- list.WriteObject([&](FormatSerializer &object) { entries[i]->FormatSerialize(object, count); });
967
+ serializer.WriteList(103, "children", entries.size(), [&](Serializer::List &list, idx_t i) {
968
+ list.WriteObject([&](Serializer &object) { entries[i]->Serialize(object, count); });
1038
969
  });
1039
970
  break;
1040
971
  }
@@ -1052,14 +983,13 @@ void Vector::FormatSerialize(FormatSerializer &serializer, idx_t count) {
1052
983
  entries[i].length = source.length;
1053
984
  }
1054
985
  serializer.WriteProperty(104, "list_size", list_size);
1055
- serializer.WriteList(105, "entries", count, [&](FormatSerializer::List &list, idx_t i) {
1056
- list.WriteObject([&](FormatSerializer &object) {
986
+ serializer.WriteList(105, "entries", count, [&](Serializer::List &list, idx_t i) {
987
+ list.WriteObject([&](Serializer &object) {
1057
988
  object.WriteProperty(100, "offset", entries[i].offset);
1058
989
  object.WriteProperty(101, "length", entries[i].length);
1059
990
  });
1060
991
  });
1061
- serializer.WriteObject(106, "child",
1062
- [&](FormatSerializer &object) { child.FormatSerialize(object, list_size); });
992
+ serializer.WriteObject(106, "child", [&](Serializer &object) { child.Serialize(object, list_size); });
1063
993
  break;
1064
994
  }
1065
995
  default:
@@ -1068,7 +998,7 @@ void Vector::FormatSerialize(FormatSerializer &serializer, idx_t count) {
1068
998
  }
1069
999
  }
1070
1000
 
1071
- void Vector::FormatDeserialize(FormatDeserializer &deserializer, idx_t count) {
1001
+ void Vector::Deserialize(Deserializer &deserializer, idx_t count) {
1072
1002
  auto &logical_type = GetType();
1073
1003
 
1074
1004
  auto &validity = FlatVector::Validity(*this);
@@ -1090,7 +1020,7 @@ void Vector::FormatDeserialize(FormatDeserializer &deserializer, idx_t count) {
1090
1020
  switch (logical_type.InternalType()) {
1091
1021
  case PhysicalType::VARCHAR: {
1092
1022
  auto strings = FlatVector::GetData<string_t>(*this);
1093
- deserializer.ReadList(102, "data", [&](FormatDeserializer::List &list, idx_t i) {
1023
+ deserializer.ReadList(102, "data", [&](Deserializer::List &list, idx_t i) {
1094
1024
  auto str = list.ReadElement<string>();
1095
1025
  if (validity.RowIsValid(i)) {
1096
1026
  strings[i] = StringVector::AddStringOrBlob(*this, str);
@@ -1101,8 +1031,8 @@ void Vector::FormatDeserialize(FormatDeserializer &deserializer, idx_t count) {
1101
1031
  case PhysicalType::STRUCT: {
1102
1032
  auto &entries = StructVector::GetEntries(*this);
1103
1033
  // Deserialize entries as a list
1104
- deserializer.ReadList(103, "children", [&](FormatDeserializer::List &list, idx_t i) {
1105
- list.ReadObject([&](FormatDeserializer &obj) { entries[i]->FormatDeserialize(obj, count); });
1034
+ deserializer.ReadList(103, "children", [&](Deserializer::List &list, idx_t i) {
1035
+ list.ReadObject([&](Deserializer &obj) { entries[i]->Deserialize(obj, count); });
1106
1036
  });
1107
1037
  break;
1108
1038
  }
@@ -1114,17 +1044,17 @@ void Vector::FormatDeserialize(FormatDeserializer &deserializer, idx_t count) {
1114
1044
 
1115
1045
  // Read the entries
1116
1046
  auto list_entries = FlatVector::GetData<list_entry_t>(*this);
1117
- deserializer.ReadList(105, "entries", [&](FormatDeserializer::List &list, idx_t i) {
1118
- list.ReadObject([&](FormatDeserializer &obj) {
1047
+ deserializer.ReadList(105, "entries", [&](Deserializer::List &list, idx_t i) {
1048
+ list.ReadObject([&](Deserializer &obj) {
1119
1049
  list_entries[i].offset = obj.ReadProperty<uint64_t>(100, "offset");
1120
1050
  list_entries[i].length = obj.ReadProperty<uint64_t>(101, "length");
1121
1051
  });
1122
1052
  });
1123
1053
 
1124
1054
  // Read the child vector
1125
- deserializer.ReadObject(106, "child", [&](FormatDeserializer &obj) {
1055
+ deserializer.ReadObject(106, "child", [&](Deserializer &obj) {
1126
1056
  auto &child = ListVector::GetEntry(*this);
1127
- child.FormatDeserialize(obj, list_size);
1057
+ child.Deserialize(obj, list_size);
1128
1058
  });
1129
1059
  break;
1130
1060
  }
@@ -1134,68 +1064,6 @@ void Vector::FormatDeserialize(FormatDeserializer &deserializer, idx_t count) {
1134
1064
  }
1135
1065
  }
1136
1066
 
1137
- void Vector::Deserialize(idx_t count, Deserializer &source) {
1138
- auto &type = GetType();
1139
-
1140
- auto &validity = FlatVector::Validity(*this);
1141
- validity.Reset();
1142
- const auto has_validity = source.Read<bool>();
1143
- if (has_validity) {
1144
- validity.Initialize(count);
1145
- source.ReadData(data_ptr_cast(validity.GetData()), validity.ValidityMaskSize(count));
1146
- }
1147
-
1148
- if (TypeIsConstantSize(type.InternalType())) {
1149
- // constant size type: read fixed amount of data from
1150
- auto column_size = GetTypeIdSize(type.InternalType()) * count;
1151
- auto ptr = make_unsafe_uniq_array<data_t>(column_size);
1152
- source.ReadData(ptr.get(), column_size);
1153
-
1154
- VectorOperations::ReadFromStorage(ptr.get(), count, *this);
1155
- } else {
1156
- switch (type.InternalType()) {
1157
- case PhysicalType::VARCHAR: {
1158
- auto strings = FlatVector::GetData<string_t>(*this);
1159
- for (idx_t i = 0; i < count; i++) {
1160
- // read the strings
1161
- auto str = source.Read<string>();
1162
- // now add the string to the StringHeap of the vector
1163
- // and write the pointer into the vector
1164
- if (validity.RowIsValid(i)) {
1165
- strings[i] = StringVector::AddStringOrBlob(*this, str);
1166
- }
1167
- }
1168
- break;
1169
- }
1170
- case PhysicalType::STRUCT: {
1171
- auto &entries = StructVector::GetEntries(*this);
1172
- for (auto &entry : entries) {
1173
- entry->Deserialize(count, source);
1174
- }
1175
- break;
1176
- }
1177
- case PhysicalType::LIST: {
1178
- // read the list size
1179
- auto list_size = source.Read<idx_t>();
1180
- ListVector::Reserve(*this, list_size);
1181
- ListVector::SetListSize(*this, list_size);
1182
-
1183
- // read the list entry
1184
- auto list_entries = FlatVector::GetData(*this);
1185
- source.ReadData(list_entries, count * sizeof(list_entry_t));
1186
-
1187
- // deserialize the child vector
1188
- auto &child = ListVector::GetEntry(*this);
1189
- child.Deserialize(list_size, source);
1190
-
1191
- break;
1192
- }
1193
- default:
1194
- throw InternalException("Unimplemented variable width type for Vector::Deserialize!");
1195
- }
1196
- }
1197
- }
1198
-
1199
1067
  void Vector::SetVectorType(VectorType vector_type_p) {
1200
1068
  this->vector_type = vector_type_p;
1201
1069
  if (TypeIsConstantSize(GetType().InternalType()) &&
@@ -4,10 +4,8 @@
4
4
  #include "duckdb/catalog/catalog_search_path.hpp"
5
5
  #include "duckdb/catalog/default/default_types.hpp"
6
6
  #include "duckdb/common/exception.hpp"
7
- #include "duckdb/common/field_writer.hpp"
8
7
  #include "duckdb/common/limits.hpp"
9
8
  #include "duckdb/common/operator/comparison_operators.hpp"
10
- #include "duckdb/common/serializer.hpp"
11
9
  #include "duckdb/common/string_util.hpp"
12
10
  #include "duckdb/common/types/decimal.hpp"
13
11
  #include "duckdb/common/types/hash.hpp"
@@ -24,9 +22,9 @@
24
22
  #include "duckdb/parser/keyword_helper.hpp"
25
23
  #include "duckdb/parser/parser.hpp"
26
24
  #include "duckdb/common/extra_type_info.hpp"
27
- #include "duckdb/common/serializer/format_deserializer.hpp"
25
+ #include "duckdb/common/serializer/deserializer.hpp"
28
26
  #include "duckdb/common/enum_util.hpp"
29
- #include "duckdb/common/serializer/format_serializer.hpp"
27
+ #include "duckdb/common/serializer/serializer.hpp"
30
28
  #include "duckdb/catalog/catalog_entry/type_catalog_entry.hpp"
31
29
  #include <cmath>
32
30
 
@@ -1065,22 +1063,6 @@ PhysicalType EnumType::GetPhysicalType(const LogicalType &type) {
1065
1063
  LogicalType::~LogicalType() {
1066
1064
  }
1067
1065
 
1068
- void LogicalType::Serialize(Serializer &serializer) const {
1069
- FieldWriter writer(serializer);
1070
- writer.WriteField<LogicalTypeId>(id_);
1071
- ExtraTypeInfo::Serialize(type_info_.get(), writer);
1072
- writer.Finalize();
1073
- }
1074
-
1075
- LogicalType LogicalType::Deserialize(Deserializer &source) {
1076
- FieldReader reader(source);
1077
- auto id = reader.ReadRequired<LogicalTypeId>();
1078
- auto info = ExtraTypeInfo::Deserialize(reader);
1079
- reader.Finalize();
1080
-
1081
- return LogicalType(id, std::move(info));
1082
- }
1083
-
1084
1066
  bool LogicalType::EqualTypeInfo(const LogicalType &rhs) const {
1085
1067
  if (type_info_.get() == rhs.type_info_.get()) {
1086
1068
  return true;
@@ -4,7 +4,6 @@
4
4
  #include "duckdb/common/exception.hpp"
5
5
  #include "duckdb/function/function_set.hpp"
6
6
  #include "duckdb/planner/expression.hpp"
7
- #include "duckdb/common/field_writer.hpp"
8
7
 
9
8
  namespace duckdb {
10
9
 
@@ -5,7 +5,8 @@
5
5
  #include "duckdb/common/algorithm.hpp"
6
6
  #include "duckdb/execution/expression_executor.hpp"
7
7
  #include "duckdb/planner/expression/bound_constant_expression.hpp"
8
- #include "duckdb/common/field_writer.hpp"
8
+ #include "duckdb/common/serializer/serializer.hpp"
9
+ #include "duckdb/common/serializer/deserializer.hpp"
9
10
 
10
11
  namespace duckdb {
11
12
 
@@ -140,16 +141,14 @@ unique_ptr<FunctionData> StringAggBind(ClientContext &context, AggregateFunction
140
141
  return make_uniq<StringAggBindData>(std::move(separator_string));
141
142
  }
142
143
 
143
- static void StringAggSerialize(FieldWriter &writer, const FunctionData *bind_data_p,
144
+ static void StringAggSerialize(Serializer &serializer, const optional_ptr<FunctionData> bind_data_p,
144
145
  const AggregateFunction &function) {
145
- D_ASSERT(bind_data_p);
146
146
  auto bind_data = bind_data_p->Cast<StringAggBindData>();
147
- writer.WriteString(bind_data.sep);
147
+ serializer.WriteProperty(100, "separator", bind_data.sep);
148
148
  }
149
149
 
150
- unique_ptr<FunctionData> StringAggDeserialize(PlanDeserializationState &state, FieldReader &reader,
151
- AggregateFunction &bound_function) {
152
- auto sep = reader.ReadRequired<string>();
150
+ unique_ptr<FunctionData> StringAggDeserialize(Deserializer &deserializer, AggregateFunction &bound_function) {
151
+ auto sep = deserializer.ReadProperty<string>(100, "separator");
153
152
  return make_uniq<StringAggBindData>(std::move(sep));
154
153
  }
155
154
 
@@ -3,9 +3,8 @@
3
3
  #include "t_digest.hpp"
4
4
  #include "duckdb/planner/expression.hpp"
5
5
  #include "duckdb/common/operator/cast_operators.hpp"
6
- #include "duckdb/common/field_writer.hpp"
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
  #include <algorithm>
11
10
  #include <cmath>
@@ -40,25 +39,13 @@ struct ApproximateQuantileBindData : public FunctionData {
40
39
  return true;
41
40
  }
42
41
 
43
- static void Serialize(FieldWriter &writer, const FunctionData *bind_data_p, const AggregateFunction &function) {
44
- D_ASSERT(bind_data_p);
45
- auto &bind_data = bind_data_p->Cast<ApproximateQuantileBindData>();
46
- writer.WriteList<float>(bind_data.quantiles);
47
- }
48
-
49
- static unique_ptr<FunctionData> Deserialize(PlanDeserializationState &state, FieldReader &reader,
50
- AggregateFunction &bound_function) {
51
- auto quantiles = reader.ReadRequiredList<float>();
52
- return make_uniq<ApproximateQuantileBindData>(std::move(quantiles));
53
- }
54
-
55
- static void FormatSerialize(FormatSerializer &serializer, const optional_ptr<FunctionData> bind_data_p,
56
- const AggregateFunction &function) {
42
+ static void Serialize(Serializer &serializer, const optional_ptr<FunctionData> bind_data_p,
43
+ const AggregateFunction &function) {
57
44
  auto &bind_data = bind_data_p->Cast<ApproximateQuantileBindData>();
58
45
  serializer.WriteProperty(100, "quantiles", bind_data.quantiles);
59
46
  }
60
47
 
61
- static unique_ptr<FunctionData> FormatDeserialize(FormatDeserializer &deserializer, AggregateFunction &function) {
48
+ static unique_ptr<FunctionData> Deserialize(Deserializer &deserializer, AggregateFunction &function) {
62
49
  auto result = make_uniq<ApproximateQuantileBindData>();
63
50
  deserializer.ReadProperty(100, "quantiles", result->quantiles);
64
51
  return std::move(result);
@@ -208,8 +195,6 @@ unique_ptr<FunctionData> BindApproxQuantileDecimal(ClientContext &context, Aggre
208
195
  function.name = "approx_quantile";
209
196
  function.serialize = ApproximateQuantileBindData::Serialize;
210
197
  function.deserialize = ApproximateQuantileBindData::Deserialize;
211
- function.format_serialize = ApproximateQuantileBindData::FormatSerialize;
212
- function.format_deserialize = ApproximateQuantileBindData::FormatDeserialize;
213
198
  return bind_data;
214
199
  }
215
200
 
@@ -218,8 +203,6 @@ AggregateFunction GetApproximateQuantileAggregate(PhysicalType type) {
218
203
  fun.bind = BindApproxQuantile;
219
204
  fun.serialize = ApproximateQuantileBindData::Serialize;
220
205
  fun.deserialize = ApproximateQuantileBindData::Deserialize;
221
- fun.format_serialize = ApproximateQuantileBindData::FormatSerialize;
222
- fun.format_deserialize = ApproximateQuantileBindData::FormatDeserialize;
223
206
  // temporarily push an argument so we can bind the actual quantile
224
207
  fun.arguments.emplace_back(LogicalType::FLOAT);
225
208
  return fun;
@@ -275,8 +258,6 @@ AggregateFunction GetTypedApproxQuantileListAggregateFunction(const LogicalType
275
258
  auto fun = ApproxQuantileListAggregate<STATE, INPUT_TYPE, list_entry_t, OP>(type, type);
276
259
  fun.serialize = ApproximateQuantileBindData::Serialize;
277
260
  fun.deserialize = ApproximateQuantileBindData::Deserialize;
278
- fun.format_serialize = ApproximateQuantileBindData::FormatSerialize;
279
- fun.format_deserialize = ApproximateQuantileBindData::FormatDeserialize;
280
261
  return fun;
281
262
  }
282
263
 
@@ -322,8 +303,6 @@ unique_ptr<FunctionData> BindApproxQuantileDecimalList(ClientContext &context, A
322
303
  function.name = "approx_quantile";
323
304
  function.serialize = ApproximateQuantileBindData::Serialize;
324
305
  function.deserialize = ApproximateQuantileBindData::Deserialize;
325
- function.format_serialize = ApproximateQuantileBindData::FormatSerialize;
326
- function.format_deserialize = ApproximateQuantileBindData::FormatDeserialize;
327
306
  return bind_data;
328
307
  }
329
308
 
@@ -332,8 +311,6 @@ AggregateFunction GetApproxQuantileListAggregate(const LogicalType &type) {
332
311
  fun.bind = BindApproxQuantile;
333
312
  fun.serialize = ApproximateQuantileBindData::Serialize;
334
313
  fun.deserialize = ApproximateQuantileBindData::Deserialize;
335
- fun.format_serialize = ApproximateQuantileBindData::FormatSerialize;
336
- fun.format_deserialize = ApproximateQuantileBindData::FormatDeserialize;
337
314
  // temporarily push an argument so we can bind the actual quantile
338
315
  auto list_of_float = LogicalType::LIST(LogicalType::FLOAT);
339
316
  fun.arguments.push_back(list_of_float);
@@ -7,9 +7,8 @@
7
7
  #include "duckdb/common/types/chunk_collection.hpp"
8
8
  #include "duckdb/common/types/timestamp.hpp"
9
9
  #include "duckdb/common/queue.hpp"
10
- #include "duckdb/common/field_writer.hpp"
11
- #include "duckdb/common/serializer/format_serializer.hpp"
12
- #include "duckdb/common/serializer/format_deserializer.hpp"
10
+ #include "duckdb/common/serializer/serializer.hpp"
11
+ #include "duckdb/common/serializer/deserializer.hpp"
13
12
 
14
13
  #include <algorithm>
15
14
  #include <stdlib.h>
@@ -458,15 +457,15 @@ struct QuantileBindData : public FunctionData {
458
457
  return desc == other.desc && quantiles == other.quantiles && order == other.order;
459
458
  }
460
459
 
461
- static void FormatSerialize(FormatSerializer &serializer, const optional_ptr<FunctionData> bind_data_p,
462
- const AggregateFunction &function) {
460
+ static void Serialize(Serializer &serializer, const optional_ptr<FunctionData> bind_data_p,
461
+ const AggregateFunction &function) {
463
462
  auto &bind_data = bind_data_p->Cast<QuantileBindData>();
464
463
  serializer.WriteProperty(100, "quantiles", bind_data.quantiles);
465
464
  serializer.WriteProperty(101, "order", bind_data.order);
466
465
  serializer.WriteProperty(102, "desc", bind_data.desc);
467
466
  }
468
467
 
469
- static unique_ptr<FunctionData> FormatDeserialize(FormatDeserializer &deserializer, AggregateFunction &function) {
468
+ static unique_ptr<FunctionData> Deserialize(Deserializer &deserializer, AggregateFunction &function) {
470
469
  auto result = make_uniq<QuantileBindData>();
471
470
  deserializer.ReadProperty(100, "quantiles", result->quantiles);
472
471
  deserializer.ReadProperty(101, "order", result->order);
@@ -474,9 +473,9 @@ struct QuantileBindData : public FunctionData {
474
473
  return std::move(result);
475
474
  }
476
475
 
477
- static void FormatSerializeDecimal(FormatSerializer &serializer, const optional_ptr<FunctionData> bind_data_p,
478
- const AggregateFunction &function) {
479
- throw SerializationException("FIXME: quantile serialize for decimal");
476
+ static void SerializeDecimal(Serializer &serializer, const optional_ptr<FunctionData> bind_data_p,
477
+ const AggregateFunction &function) {
478
+ throw NotImplementedException("FIXME: serializing quantiles with decimals is not supported right now");
480
479
  }
481
480
 
482
481
  vector<Value> quantiles;
@@ -1174,31 +1173,6 @@ AggregateFunction GetMedianAbsoluteDeviationAggregateFunction(const LogicalType
1174
1173
  }
1175
1174
  }
1176
1175
 
1177
- static void QuantileSerialize(FieldWriter &writer, const FunctionData *bind_data_p, const AggregateFunction &function) {
1178
- D_ASSERT(bind_data_p);
1179
- auto bind_data = dynamic_cast<const QuantileBindData *>(bind_data_p);
1180
- D_ASSERT(bind_data);
1181
- writer.WriteRegularSerializableList<Value>(bind_data->quantiles);
1182
- writer.WriteList<idx_t>(bind_data->order);
1183
- writer.WriteField<bool>(bind_data->desc);
1184
- }
1185
-
1186
- unique_ptr<FunctionData> QuantileDeserialize(PlanDeserializationState &state, FieldReader &reader,
1187
- AggregateFunction &bound_function) {
1188
- auto quantiles = reader.ReadRequiredSerializableList<Value, Value>();
1189
- auto bind_data = make_uniq<QuantileBindData>(quantiles);
1190
- bind_data->quantiles = quantiles;
1191
- bind_data->order = reader.ReadRequiredList<idx_t>();
1192
- bind_data->desc = reader.ReadRequired<bool>();
1193
-
1194
- return std::move(bind_data);
1195
- }
1196
-
1197
- static void QuantileDecimalSerialize(FieldWriter &writer, const FunctionData *bind_data_p,
1198
- const AggregateFunction &function) {
1199
- throw NotImplementedException("FIXME: serializing quantiles with decimals is not supported right now");
1200
- }
1201
-
1202
1176
  unique_ptr<FunctionData> BindMedian(ClientContext &context, AggregateFunction &function,
1203
1177
  vector<unique_ptr<Expression>> &arguments) {
1204
1178
  return make_uniq<QuantileBindData>(Value::DECIMAL(int16_t(5), 2, 1));
@@ -1210,10 +1184,8 @@ unique_ptr<FunctionData> BindMedianDecimal(ClientContext &context, AggregateFunc
1210
1184
 
1211
1185
  function = GetDiscreteQuantileAggregateFunction(arguments[0]->return_type);
1212
1186
  function.name = "median";
1213
- function.serialize = QuantileDecimalSerialize;
1214
- function.deserialize = QuantileDeserialize;
1215
- function.format_serialize = QuantileBindData::FormatSerializeDecimal;
1216
- function.format_deserialize = QuantileBindData::FormatDeserialize;
1187
+ function.serialize = QuantileBindData::SerializeDecimal;
1188
+ function.deserialize = QuantileBindData::Deserialize;
1217
1189
  function.order_dependent = AggregateOrderDependent::NOT_ORDER_DEPENDENT;
1218
1190
  return bind_data;
1219
1191
  }
@@ -1268,10 +1240,8 @@ unique_ptr<FunctionData> BindDiscreteQuantileDecimal(ClientContext &context, Agg
1268
1240
  auto bind_data = BindQuantile(context, function, arguments);
1269
1241
  function = GetDiscreteQuantileAggregateFunction(arguments[0]->return_type);
1270
1242
  function.name = "quantile_disc";
1271
- function.serialize = QuantileDecimalSerialize;
1272
- function.deserialize = QuantileDeserialize;
1273
- function.format_serialize = QuantileBindData::FormatSerializeDecimal;
1274
- function.format_deserialize = QuantileBindData::FormatDeserialize;
1243
+ function.serialize = QuantileBindData::SerializeDecimal;
1244
+ function.deserialize = QuantileBindData::Deserialize;
1275
1245
  function.order_dependent = AggregateOrderDependent::NOT_ORDER_DEPENDENT;
1276
1246
  return bind_data;
1277
1247
  }
@@ -1281,10 +1251,8 @@ unique_ptr<FunctionData> BindDiscreteQuantileDecimalList(ClientContext &context,
1281
1251
  auto bind_data = BindQuantile(context, function, arguments);
1282
1252
  function = GetDiscreteQuantileListAggregateFunction(arguments[0]->return_type);
1283
1253
  function.name = "quantile_disc";
1284
- function.serialize = QuantileDecimalSerialize;
1285
- function.deserialize = QuantileDeserialize;
1286
- function.format_serialize = QuantileBindData::FormatSerializeDecimal;
1287
- function.format_deserialize = QuantileBindData::FormatDeserialize;
1254
+ function.serialize = QuantileBindData::SerializeDecimal;
1255
+ function.deserialize = QuantileBindData::Deserialize;
1288
1256
  function.order_dependent = AggregateOrderDependent::NOT_ORDER_DEPENDENT;
1289
1257
  return bind_data;
1290
1258
  }
@@ -1294,10 +1262,8 @@ unique_ptr<FunctionData> BindContinuousQuantileDecimal(ClientContext &context, A
1294
1262
  auto bind_data = BindQuantile(context, function, arguments);
1295
1263
  function = GetContinuousQuantileAggregateFunction(arguments[0]->return_type);
1296
1264
  function.name = "quantile_cont";
1297
- function.serialize = QuantileDecimalSerialize;
1298
- function.deserialize = QuantileDeserialize;
1299
- function.format_serialize = QuantileBindData::FormatSerializeDecimal;
1300
- function.format_deserialize = QuantileBindData::FormatDeserialize;
1265
+ function.serialize = QuantileBindData::SerializeDecimal;
1266
+ function.deserialize = QuantileBindData::Deserialize;
1301
1267
  function.order_dependent = AggregateOrderDependent::NOT_ORDER_DEPENDENT;
1302
1268
  return bind_data;
1303
1269
  }
@@ -1307,10 +1273,8 @@ unique_ptr<FunctionData> BindContinuousQuantileDecimalList(ClientContext &contex
1307
1273
  auto bind_data = BindQuantile(context, function, arguments);
1308
1274
  function = GetContinuousQuantileListAggregateFunction(arguments[0]->return_type);
1309
1275
  function.name = "quantile_cont";
1310
- function.serialize = QuantileDecimalSerialize;
1311
- function.deserialize = QuantileDeserialize;
1312
- function.format_serialize = QuantileBindData::FormatSerializeDecimal;
1313
- function.format_deserialize = QuantileBindData::FormatDeserialize;
1276
+ function.serialize = QuantileBindData::SerializeDecimal;
1277
+ function.deserialize = QuantileBindData::Deserialize;
1314
1278
  function.order_dependent = AggregateOrderDependent::NOT_ORDER_DEPENDENT;
1315
1279
  return bind_data;
1316
1280
  }
@@ -1329,20 +1293,16 @@ AggregateFunction GetMedianAggregate(const LogicalType &type) {
1329
1293
  auto fun = CanInterpolate(type) ? GetContinuousQuantileAggregateFunction(type)
1330
1294
  : GetDiscreteQuantileAggregateFunction(type);
1331
1295
  fun.bind = BindMedian;
1332
- fun.serialize = QuantileSerialize;
1333
- fun.deserialize = QuantileDeserialize;
1334
- fun.format_serialize = QuantileBindData::FormatSerialize;
1335
- fun.format_deserialize = QuantileBindData::FormatDeserialize;
1296
+ fun.serialize = QuantileBindData::Serialize;
1297
+ fun.deserialize = QuantileBindData::Deserialize;
1336
1298
  return fun;
1337
1299
  }
1338
1300
 
1339
1301
  AggregateFunction GetDiscreteQuantileAggregate(const LogicalType &type) {
1340
1302
  auto fun = GetDiscreteQuantileAggregateFunction(type);
1341
1303
  fun.bind = BindQuantile;
1342
- fun.serialize = QuantileSerialize;
1343
- fun.deserialize = QuantileDeserialize;
1344
- fun.format_serialize = QuantileBindData::FormatSerialize;
1345
- fun.format_deserialize = QuantileBindData::FormatDeserialize;
1304
+ fun.serialize = QuantileBindData::Serialize;
1305
+ fun.deserialize = QuantileBindData::Deserialize;
1346
1306
  // temporarily push an argument so we can bind the actual quantile
1347
1307
  fun.arguments.emplace_back(LogicalType::DOUBLE);
1348
1308
  fun.order_dependent = AggregateOrderDependent::NOT_ORDER_DEPENDENT;
@@ -1352,10 +1312,8 @@ AggregateFunction GetDiscreteQuantileAggregate(const LogicalType &type) {
1352
1312
  AggregateFunction GetDiscreteQuantileListAggregate(const LogicalType &type) {
1353
1313
  auto fun = GetDiscreteQuantileListAggregateFunction(type);
1354
1314
  fun.bind = BindQuantile;
1355
- fun.serialize = QuantileSerialize;
1356
- fun.deserialize = QuantileDeserialize;
1357
- fun.format_serialize = QuantileBindData::FormatSerialize;
1358
- fun.format_deserialize = QuantileBindData::FormatDeserialize;
1315
+ fun.serialize = QuantileBindData::Serialize;
1316
+ fun.deserialize = QuantileBindData::Deserialize;
1359
1317
  // temporarily push an argument so we can bind the actual quantile
1360
1318
  auto list_of_double = LogicalType::LIST(LogicalType::DOUBLE);
1361
1319
  fun.arguments.push_back(list_of_double);
@@ -1366,10 +1324,8 @@ AggregateFunction GetDiscreteQuantileListAggregate(const LogicalType &type) {
1366
1324
  AggregateFunction GetContinuousQuantileAggregate(const LogicalType &type) {
1367
1325
  auto fun = GetContinuousQuantileAggregateFunction(type);
1368
1326
  fun.bind = BindQuantile;
1369
- fun.serialize = QuantileSerialize;
1370
- fun.deserialize = QuantileDeserialize;
1371
- fun.format_serialize = QuantileBindData::FormatSerialize;
1372
- fun.format_deserialize = QuantileBindData::FormatDeserialize;
1327
+ fun.serialize = QuantileBindData::Serialize;
1328
+ fun.deserialize = QuantileBindData::Deserialize;
1373
1329
  // temporarily push an argument so we can bind the actual quantile
1374
1330
  fun.arguments.emplace_back(LogicalType::DOUBLE);
1375
1331
  fun.order_dependent = AggregateOrderDependent::NOT_ORDER_DEPENDENT;
@@ -1379,10 +1335,8 @@ AggregateFunction GetContinuousQuantileAggregate(const LogicalType &type) {
1379
1335
  AggregateFunction GetContinuousQuantileListAggregate(const LogicalType &type) {
1380
1336
  auto fun = GetContinuousQuantileListAggregateFunction(type);
1381
1337
  fun.bind = BindQuantile;
1382
- fun.serialize = QuantileSerialize;
1383
- fun.deserialize = QuantileDeserialize;
1384
- fun.format_serialize = QuantileBindData::FormatSerialize;
1385
- fun.format_deserialize = QuantileBindData::FormatDeserialize;
1338
+ fun.serialize = QuantileBindData::Serialize;
1339
+ fun.deserialize = QuantileBindData::Deserialize;
1386
1340
  // temporarily push an argument so we can bind the actual quantile
1387
1341
  auto list_of_double = LogicalType::LIST(LogicalType::DOUBLE);
1388
1342
  fun.arguments.push_back(list_of_double);
@@ -1394,10 +1348,8 @@ AggregateFunction GetQuantileDecimalAggregate(const vector<LogicalType> &argumen
1394
1348
  bind_aggregate_function_t bind) {
1395
1349
  AggregateFunction fun(arguments, return_type, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, bind);
1396
1350
  fun.bind = bind;
1397
- fun.serialize = QuantileSerialize;
1398
- fun.deserialize = QuantileDeserialize;
1399
- fun.format_serialize = QuantileBindData::FormatSerialize;
1400
- fun.format_deserialize = QuantileBindData::FormatDeserialize;
1351
+ fun.serialize = QuantileBindData::Serialize;
1352
+ fun.deserialize = QuantileBindData::Deserialize;
1401
1353
  fun.order_dependent = AggregateOrderDependent::NOT_ORDER_DEPENDENT;
1402
1354
  return fun;
1403
1355
  }