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
@@ -41,18 +41,4 @@ string IsNotNullFilter::ToString(const string &column_name) {
41
41
  return column_name + " IS NOT NULL";
42
42
  }
43
43
 
44
- void IsNotNullFilter::Serialize(FieldWriter &writer) const {
45
- }
46
-
47
- unique_ptr<TableFilter> IsNotNullFilter::Deserialize(FieldReader &source) {
48
- return make_uniq<IsNotNullFilter>();
49
- }
50
-
51
- void IsNullFilter::Serialize(FieldWriter &writer) const {
52
- }
53
-
54
- unique_ptr<TableFilter> IsNullFilter::Deserialize(FieldReader &source) {
55
- return make_uniq<IsNullFilter>();
56
- }
57
-
58
44
  } // namespace duckdb
@@ -5,7 +5,6 @@
5
5
  #include "duckdb/planner/expression/bound_conjunction_expression.hpp"
6
6
  #include "duckdb/planner/expression/bound_subquery_expression.hpp"
7
7
  #include "duckdb/planner/expression_iterator.hpp"
8
- #include "duckdb/common/field_writer.hpp"
9
8
 
10
9
  namespace duckdb {
11
10
 
@@ -30,29 +29,6 @@ unique_ptr<Expression> JoinCondition::CreateExpression(vector<JoinCondition> con
30
29
  return result;
31
30
  }
32
31
 
33
- //! Serializes a JoinCondition to a stand-alone binary blob
34
- void JoinCondition::Serialize(Serializer &serializer) const {
35
- FieldWriter writer(serializer);
36
- writer.WriteOptional(left);
37
- writer.WriteOptional(right);
38
- writer.WriteField<ExpressionType>(comparison);
39
- writer.Finalize();
40
- }
41
-
42
- //! Deserializes a blob back into a JoinCondition
43
- JoinCondition JoinCondition::Deserialize(Deserializer &source, PlanDeserializationState &state) {
44
- auto result = JoinCondition();
45
-
46
- FieldReader reader(source);
47
- auto left = reader.ReadOptional<Expression>(nullptr, state);
48
- auto right = reader.ReadOptional<Expression>(nullptr, state);
49
- result.left = std::move(left);
50
- result.right = std::move(right);
51
- result.comparison = reader.ReadRequired<ExpressionType>();
52
- reader.Finalize();
53
- return result;
54
- }
55
-
56
32
  JoinSide JoinSide::CombineJoinSide(JoinSide left, JoinSide right) {
57
33
  if (left == JoinSide::NONE) {
58
34
  return right;
@@ -1,21 +1,16 @@
1
1
  #include "duckdb/planner/logical_operator.hpp"
2
2
 
3
- #include "duckdb/common/field_writer.hpp"
4
3
  #include "duckdb/common/printer.hpp"
5
- #include "duckdb/common/serializer/buffered_deserializer.hpp"
6
4
  #include "duckdb/common/string_util.hpp"
7
5
  #include "duckdb/common/tree_renderer.hpp"
8
6
  #include "duckdb/parser/parser.hpp"
9
7
  #include "duckdb/planner/operator/list.hpp"
10
- #include "duckdb/planner/operator/logical_extension_operator.hpp"
11
- #include "duckdb/planner/operator/logical_dependent_join.hpp"
12
8
  #include "duckdb/common/serializer/binary_serializer.hpp"
13
9
  #include "duckdb/common/serializer/binary_deserializer.hpp"
10
+ #include "duckdb/common/serializer/memory_stream.hpp"
14
11
 
15
12
  namespace duckdb {
16
13
 
17
- const uint64_t PLAN_SERIALIZATION_VERSION = 1;
18
-
19
14
  LogicalOperator::LogicalOperator(LogicalOperatorType type)
20
15
  : type(type), estimated_cardinality(0), has_estimated_cardinality(false) {
21
16
  }
@@ -129,30 +124,20 @@ void LogicalOperator::Verify(ClientContext &context) {
129
124
  if (expressions[expr_idx]->HasParameter()) {
130
125
  continue;
131
126
  }
132
- BufferedSerializer serializer;
127
+ MemoryStream stream;
133
128
  // We are serializing a query plan
134
129
  try {
135
- expressions[expr_idx]->Serialize(serializer);
130
+ BinarySerializer::Serialize(*expressions[expr_idx], stream);
136
131
  } catch (NotImplementedException &ex) {
137
132
  // ignore for now (FIXME)
138
133
  continue;
139
134
  }
135
+ // Rewind the stream
136
+ stream.Rewind();
140
137
 
141
- auto data = serializer.GetData();
142
- auto deserializer = BufferedContextDeserializer(context, data.data.get(), data.size);
143
-
144
- PlanDeserializationState state(context);
145
- auto deserialized_expression = Expression::Deserialize(deserializer, state);
138
+ bound_parameter_map_t parameters;
139
+ auto deserialized_expression = BinaryDeserializer::Deserialize<Expression>(stream, context, parameters);
146
140
 
147
- // format (de)serialization of expressions
148
- try {
149
- auto blob = BinarySerializer::Serialize(*expressions[expr_idx], true);
150
- bound_parameter_map_t parameters;
151
- auto result = BinaryDeserializer::Deserialize<Expression>(context, parameters, blob.data(), blob.size());
152
- result->Hash();
153
- } catch (SerializationException &ex) {
154
- // pass
155
- }
156
141
  // FIXME: expressions might not be equal yet because of statistics propagation
157
142
  continue;
158
143
  D_ASSERT(Expression::Equals(expressions[expr_idx], deserialized_expression));
@@ -188,210 +173,25 @@ void LogicalOperator::Print() {
188
173
  Printer::Print(ToString());
189
174
  }
190
175
 
191
- void LogicalOperator::Serialize(Serializer &serializer) const {
192
- FieldWriter writer(serializer);
193
- writer.WriteField<LogicalOperatorType>(type);
194
- writer.WriteSerializableList(children);
195
-
196
- Serialize(writer);
197
- writer.Finalize();
198
- }
199
-
200
- unique_ptr<LogicalOperator> LogicalOperator::Deserialize(Deserializer &deserializer, PlanDeserializationState &gstate) {
201
- unique_ptr<LogicalOperator> result;
202
-
203
- FieldReader reader(deserializer);
204
- auto type = reader.ReadRequired<LogicalOperatorType>();
205
- auto children = reader.ReadRequiredSerializableList<LogicalOperator>(gstate);
206
-
207
- LogicalDeserializationState state(gstate, type, children);
208
- switch (type) {
209
- case LogicalOperatorType::LOGICAL_PROJECTION:
210
- result = LogicalProjection::Deserialize(state, reader);
211
- break;
212
- case LogicalOperatorType::LOGICAL_FILTER:
213
- result = LogicalFilter::Deserialize(state, reader);
214
- break;
215
- case LogicalOperatorType::LOGICAL_AGGREGATE_AND_GROUP_BY:
216
- result = LogicalAggregate::Deserialize(state, reader);
217
- break;
218
- case LogicalOperatorType::LOGICAL_WINDOW:
219
- result = LogicalWindow::Deserialize(state, reader);
220
- break;
221
- case LogicalOperatorType::LOGICAL_UNNEST:
222
- result = LogicalUnnest::Deserialize(state, reader);
223
- break;
224
- case LogicalOperatorType::LOGICAL_LIMIT:
225
- result = LogicalLimit::Deserialize(state, reader);
226
- break;
227
- case LogicalOperatorType::LOGICAL_ORDER_BY:
228
- result = LogicalOrder::Deserialize(state, reader);
229
- break;
230
- case LogicalOperatorType::LOGICAL_TOP_N:
231
- result = LogicalTopN::Deserialize(state, reader);
232
- break;
233
- case LogicalOperatorType::LOGICAL_COPY_TO_FILE:
234
- result = LogicalCopyToFile::Deserialize(state, reader);
235
- break;
236
- case LogicalOperatorType::LOGICAL_DISTINCT:
237
- result = LogicalDistinct::Deserialize(state, reader);
238
- break;
239
- case LogicalOperatorType::LOGICAL_SAMPLE:
240
- result = LogicalSample::Deserialize(state, reader);
241
- break;
242
- case LogicalOperatorType::LOGICAL_LIMIT_PERCENT:
243
- result = LogicalLimitPercent::Deserialize(state, reader);
244
- break;
245
- case LogicalOperatorType::LOGICAL_GET:
246
- result = LogicalGet::Deserialize(state, reader);
247
- break;
248
- case LogicalOperatorType::LOGICAL_CHUNK_GET:
249
- result = LogicalColumnDataGet::Deserialize(state, reader);
250
- break;
251
- case LogicalOperatorType::LOGICAL_DELIM_GET:
252
- result = LogicalDelimGet::Deserialize(state, reader);
253
- break;
254
- case LogicalOperatorType::LOGICAL_EXPRESSION_GET:
255
- result = LogicalExpressionGet::Deserialize(state, reader);
256
- break;
257
- case LogicalOperatorType::LOGICAL_DUMMY_SCAN:
258
- result = LogicalDummyScan::Deserialize(state, reader);
259
- break;
260
- case LogicalOperatorType::LOGICAL_EMPTY_RESULT:
261
- result = LogicalEmptyResult::Deserialize(state, reader);
262
- break;
263
- case LogicalOperatorType::LOGICAL_CTE_REF:
264
- result = LogicalCTERef::Deserialize(state, reader);
265
- break;
266
- case LogicalOperatorType::LOGICAL_JOIN:
267
- throw InternalException("LogicalJoin deserialize not supported");
268
- case LogicalOperatorType::LOGICAL_ASOF_JOIN:
269
- case LogicalOperatorType::LOGICAL_DELIM_JOIN:
270
- case LogicalOperatorType::LOGICAL_COMPARISON_JOIN:
271
- result = LogicalComparisonJoin::Deserialize(state, reader);
272
- break;
273
- case LogicalOperatorType::LOGICAL_ANY_JOIN:
274
- result = LogicalAnyJoin::Deserialize(state, reader);
275
- break;
276
- case LogicalOperatorType::LOGICAL_CROSS_PRODUCT:
277
- result = LogicalCrossProduct::Deserialize(state, reader);
278
- break;
279
- case LogicalOperatorType::LOGICAL_POSITIONAL_JOIN:
280
- result = LogicalPositionalJoin::Deserialize(state, reader);
281
- break;
282
- case LogicalOperatorType::LOGICAL_UNION:
283
- result = LogicalSetOperation::Deserialize(state, reader);
284
- break;
285
- case LogicalOperatorType::LOGICAL_EXCEPT:
286
- result = LogicalSetOperation::Deserialize(state, reader);
287
- break;
288
- case LogicalOperatorType::LOGICAL_INTERSECT:
289
- result = LogicalSetOperation::Deserialize(state, reader);
290
- break;
291
- case LogicalOperatorType::LOGICAL_RECURSIVE_CTE:
292
- result = LogicalRecursiveCTE::Deserialize(state, reader);
293
- break;
294
- case LogicalOperatorType::LOGICAL_MATERIALIZED_CTE:
295
- result = LogicalMaterializedCTE::Deserialize(state, reader);
296
- break;
297
- case LogicalOperatorType::LOGICAL_INSERT:
298
- result = LogicalInsert::Deserialize(state, reader);
299
- break;
300
- case LogicalOperatorType::LOGICAL_DELETE:
301
- result = LogicalDelete::Deserialize(state, reader);
302
- break;
303
- case LogicalOperatorType::LOGICAL_UPDATE:
304
- result = LogicalUpdate::Deserialize(state, reader);
305
- break;
306
- case LogicalOperatorType::LOGICAL_CREATE_TABLE:
307
- result = LogicalCreateTable::Deserialize(state, reader);
308
- break;
309
- case LogicalOperatorType::LOGICAL_CREATE_INDEX:
310
- result = LogicalCreateIndex::Deserialize(state, reader);
311
- break;
312
- case LogicalOperatorType::LOGICAL_CREATE_SEQUENCE:
313
- result = LogicalCreate::Deserialize(state, reader);
314
- break;
315
- case LogicalOperatorType::LOGICAL_CREATE_VIEW:
316
- result = LogicalCreate::Deserialize(state, reader);
317
- break;
318
- case LogicalOperatorType::LOGICAL_CREATE_SCHEMA:
319
- result = LogicalCreate::Deserialize(state, reader);
320
- break;
321
- case LogicalOperatorType::LOGICAL_CREATE_MACRO:
322
- result = LogicalCreate::Deserialize(state, reader);
323
- break;
324
- case LogicalOperatorType::LOGICAL_PRAGMA:
325
- result = LogicalPragma::Deserialize(state, reader);
326
- break;
327
- case LogicalOperatorType::LOGICAL_CREATE_TYPE:
328
- result = LogicalCreate::Deserialize(state, reader);
329
- break;
330
- case LogicalOperatorType::LOGICAL_EXPLAIN:
331
- result = LogicalExplain::Deserialize(state, reader);
332
- break;
333
- case LogicalOperatorType::LOGICAL_SHOW:
334
- result = LogicalShow::Deserialize(state, reader);
335
- break;
336
- case LogicalOperatorType::LOGICAL_PREPARE:
337
- result = LogicalPrepare::Deserialize(state, reader);
338
- break;
339
- case LogicalOperatorType::LOGICAL_EXECUTE:
340
- result = LogicalExecute::Deserialize(state, reader);
341
- break;
342
- case LogicalOperatorType::LOGICAL_EXPORT:
343
- result = LogicalExport::Deserialize(state, reader);
344
- break;
345
- case LogicalOperatorType::LOGICAL_SET:
346
- result = LogicalSet::Deserialize(state, reader);
347
- break;
348
- case LogicalOperatorType::LOGICAL_RESET:
349
- result = LogicalReset::Deserialize(state, reader);
350
- break;
351
- case LogicalOperatorType::LOGICAL_ALTER:
352
- case LogicalOperatorType::LOGICAL_VACUUM:
353
- case LogicalOperatorType::LOGICAL_LOAD:
354
- case LogicalOperatorType::LOGICAL_ATTACH:
355
- case LogicalOperatorType::LOGICAL_TRANSACTION:
356
- case LogicalOperatorType::LOGICAL_DROP:
357
- case LogicalOperatorType::LOGICAL_DETACH:
358
- result = LogicalSimple::Deserialize(state, reader);
359
- break;
360
- case LogicalOperatorType::LOGICAL_EXTENSION_OPERATOR:
361
- result = LogicalExtensionOperator::Deserialize(state, reader);
362
- break;
363
- case LogicalOperatorType::LOGICAL_PIVOT:
364
- result = LogicalPivot::Deserialize(state, reader);
365
- break;
366
- case LogicalOperatorType::LOGICAL_DEPENDENT_JOIN:
367
- case LogicalOperatorType::LOGICAL_INVALID:
368
- /* no default here to trigger a warning if we forget to implement deserialize for a new operator */
369
- throw SerializationException("Invalid type for operator deserialization");
370
- }
371
-
372
- reader.Finalize();
373
- result->children = std::move(children);
374
-
375
- return result;
376
- }
377
-
378
176
  vector<idx_t> LogicalOperator::GetTableIndex() const {
379
177
  return vector<idx_t> {};
380
178
  }
381
179
 
382
180
  unique_ptr<LogicalOperator> LogicalOperator::Copy(ClientContext &context) const {
383
- BufferedSerializer logical_op_serializer;
181
+ MemoryStream stream;
182
+ BinarySerializer serializer(stream);
384
183
  try {
385
- this->Serialize(logical_op_serializer);
184
+ serializer.Begin();
185
+ this->Serialize(serializer);
186
+ serializer.End();
386
187
  } catch (NotImplementedException &ex) {
387
188
  throw NotImplementedException("Logical Operator Copy requires the logical operator and all of its children to "
388
189
  "be serializable: " +
389
190
  std::string(ex.what()));
390
191
  }
391
- auto data = logical_op_serializer.GetData();
392
- auto logical_op_deserializer = BufferedContextDeserializer(context, data.data.get(), data.size);
393
- PlanDeserializationState state(context);
394
- auto op_copy = LogicalOperator::Deserialize(logical_op_deserializer, state);
192
+ stream.Rewind();
193
+ bound_parameter_map_t parameters;
194
+ auto op_copy = BinaryDeserializer::Deserialize<LogicalOperator>(stream, context, parameters);
395
195
  return op_copy;
396
196
  }
397
197
 
@@ -1,6 +1,5 @@
1
1
  #include "duckdb/planner/operator/logical_aggregate.hpp"
2
2
 
3
- #include "duckdb/common/field_writer.hpp"
4
3
  #include "duckdb/common/string_util.hpp"
5
4
  #include "duckdb/main/config.hpp"
6
5
 
@@ -58,51 +57,6 @@ string LogicalAggregate::ParamsToString() const {
58
57
  return result;
59
58
  }
60
59
 
61
- void LogicalAggregate::Serialize(FieldWriter &writer) const {
62
- writer.WriteSerializableList(expressions);
63
-
64
- writer.WriteField(group_index);
65
- writer.WriteField(aggregate_index);
66
- writer.WriteField(groupings_index);
67
- writer.WriteSerializableList(groups);
68
- writer.WriteField<idx_t>(grouping_sets.size());
69
- for (auto &entry : grouping_sets) {
70
- writer.WriteList<idx_t>(entry);
71
- }
72
- writer.WriteField<idx_t>(grouping_functions.size());
73
- for (auto &entry : grouping_functions) {
74
- writer.WriteList<idx_t>(entry);
75
- }
76
-
77
- // TODO statistics
78
- }
79
-
80
- unique_ptr<LogicalOperator> LogicalAggregate::Deserialize(LogicalDeserializationState &state, FieldReader &reader) {
81
- auto expressions = reader.ReadRequiredSerializableList<Expression>(state.gstate);
82
-
83
- auto group_index = reader.ReadRequired<idx_t>();
84
- auto aggregate_index = reader.ReadRequired<idx_t>();
85
- auto groupings_index = reader.ReadRequired<idx_t>();
86
- auto groups = reader.ReadRequiredSerializableList<Expression>(state.gstate);
87
- auto grouping_sets_size = reader.ReadRequired<idx_t>();
88
- vector<GroupingSet> grouping_sets;
89
- for (idx_t i = 0; i < grouping_sets_size; i++) {
90
- grouping_sets.push_back(reader.ReadRequiredSet<idx_t>());
91
- }
92
- vector<unsafe_vector<idx_t>> grouping_functions;
93
- auto grouping_functions_size = reader.ReadRequired<idx_t>();
94
- for (idx_t i = 0; i < grouping_functions_size; i++) {
95
- grouping_functions.push_back(reader.ReadRequiredList<idx_t>());
96
- }
97
- auto result = make_uniq<LogicalAggregate>(group_index, aggregate_index, std::move(expressions));
98
- result->groupings_index = groupings_index;
99
- result->groups = std::move(groups);
100
- result->grouping_functions = std::move(grouping_functions);
101
- result->grouping_sets = std::move(grouping_sets);
102
-
103
- return std::move(result);
104
- }
105
-
106
60
  idx_t LogicalAggregate::EstimateCardinality(ClientContext &context) {
107
61
  if (groups.empty()) {
108
62
  // ungrouped aggregate
@@ -1,5 +1,4 @@
1
1
  #include "duckdb/planner/operator/logical_any_join.hpp"
2
- #include "duckdb/common/field_writer.hpp"
3
2
 
4
3
  namespace duckdb {
5
4
 
@@ -10,17 +9,4 @@ string LogicalAnyJoin::ParamsToString() const {
10
9
  return condition->ToString();
11
10
  }
12
11
 
13
- void LogicalAnyJoin::Serialize(FieldWriter &writer) const {
14
- writer.WriteField(join_type);
15
- writer.WriteOptional(condition);
16
- }
17
-
18
- unique_ptr<LogicalOperator> LogicalAnyJoin::Deserialize(LogicalDeserializationState &state, FieldReader &reader) {
19
- auto join_type = reader.ReadRequired<JoinType>();
20
- auto condition = reader.ReadOptional<Expression>(nullptr, state.gstate);
21
- auto result = make_uniq<LogicalAnyJoin>(join_type);
22
- result->condition = std::move(condition);
23
- return std::move(result);
24
- }
25
-
26
12
  } // namespace duckdb
@@ -1,6 +1,5 @@
1
1
  #include "duckdb/planner/operator/logical_column_data_get.hpp"
2
2
 
3
- #include "duckdb/common/field_writer.hpp"
4
3
  #include "duckdb/common/types/data_chunk.hpp"
5
4
  #include "duckdb/main/config.hpp"
6
5
 
@@ -18,28 +17,6 @@ vector<ColumnBinding> LogicalColumnDataGet::GetColumnBindings() {
18
17
  return GenerateColumnBindings(table_index, chunk_types.size());
19
18
  }
20
19
 
21
- void LogicalColumnDataGet::Serialize(FieldWriter &writer) const {
22
- writer.WriteField(table_index);
23
- writer.WriteRegularSerializableList(chunk_types);
24
- writer.WriteField(collection->ChunkCount());
25
- for (auto &chunk : collection->Chunks()) {
26
- chunk.Serialize(writer.GetSerializer());
27
- }
28
- }
29
-
30
- unique_ptr<LogicalOperator> LogicalColumnDataGet::Deserialize(LogicalDeserializationState &state, FieldReader &reader) {
31
- auto table_index = reader.ReadRequired<idx_t>();
32
- auto chunk_types = reader.ReadRequiredSerializableList<LogicalType, LogicalType>();
33
- auto chunk_count = reader.ReadRequired<idx_t>();
34
- auto collection = make_uniq<ColumnDataCollection>(state.gstate.context, chunk_types);
35
- for (idx_t i = 0; i < chunk_count; i++) {
36
- DataChunk chunk;
37
- chunk.Deserialize(reader.GetSource());
38
- collection->Append(chunk);
39
- }
40
- return make_uniq<LogicalColumnDataGet>(table_index, std::move(chunk_types), std::move(collection));
41
- }
42
-
43
20
  vector<idx_t> LogicalColumnDataGet::GetTableIndex() const {
44
21
  return vector<idx_t> {table_index};
45
22
  }
@@ -1,4 +1,3 @@
1
- #include "duckdb/common/field_writer.hpp"
2
1
  #include "duckdb/common/string_util.hpp"
3
2
  #include "duckdb/planner/operator/logical_comparison_join.hpp"
4
3
  #include "duckdb/planner/expression/bound_comparison_expression.hpp"
@@ -21,26 +20,4 @@ string LogicalComparisonJoin::ParamsToString() const {
21
20
  return result;
22
21
  }
23
22
 
24
- void LogicalComparisonJoin::Serialize(FieldWriter &writer) const {
25
- LogicalJoin::Serialize(writer);
26
- writer.WriteRegularSerializableList(mark_types);
27
- writer.WriteRegularSerializableList(conditions);
28
- writer.WriteSerializableList(duplicate_eliminated_columns);
29
- }
30
-
31
- void LogicalComparisonJoin::Deserialize(LogicalComparisonJoin &comparison_join, LogicalDeserializationState &state,
32
- FieldReader &reader) {
33
- LogicalJoin::Deserialize(comparison_join, state, reader);
34
- comparison_join.mark_types = reader.ReadRequiredSerializableList<LogicalType, LogicalType>();
35
- comparison_join.conditions = reader.ReadRequiredSerializableList<JoinCondition, JoinCondition>(state.gstate);
36
- comparison_join.duplicate_eliminated_columns = reader.ReadRequiredSerializableList<Expression>(state.gstate);
37
- }
38
-
39
- unique_ptr<LogicalOperator> LogicalComparisonJoin::Deserialize(LogicalDeserializationState &state,
40
- FieldReader &reader) {
41
- auto result = make_uniq<LogicalComparisonJoin>(JoinType::INVALID, state.type);
42
- LogicalComparisonJoin::Deserialize(*result, state, reader);
43
- return std::move(result);
44
- }
45
-
46
23
  } // namespace duckdb
@@ -1,69 +1,15 @@
1
1
  #include "duckdb/planner/operator/logical_copy_to_file.hpp"
2
2
 
3
3
  #include "duckdb/catalog/catalog_entry/copy_function_catalog_entry.hpp"
4
- #include "duckdb/common/field_writer.hpp"
5
4
  #include "duckdb/function/copy_function.hpp"
6
5
 
7
6
  namespace duckdb {
8
7
 
9
- // Warning: some fields here were added while this code appears untested
10
- // -> copy test in test/api/test_plan_serialization.cpp was commented out as WIP
11
- void LogicalCopyToFile::Serialize(FieldWriter &writer) const {
12
- writer.WriteString(file_path);
13
- writer.WriteField(use_tmp_file);
14
- writer.WriteField(overwrite_or_ignore);
15
- writer.WriteField(per_thread_output);
16
- writer.WriteList<idx_t>(partition_columns);
17
-
18
- D_ASSERT(!function.name.empty());
19
- writer.WriteString(function.name);
20
-
21
- writer.WriteField(bind_data != nullptr);
22
- if (bind_data && !function.serialize) {
23
- throw InvalidInputException("Can't serialize copy function %s", function.name);
24
- }
25
-
26
- function.serialize(writer, *bind_data, function);
27
- }
28
-
29
- unique_ptr<LogicalOperator> LogicalCopyToFile::Deserialize(LogicalDeserializationState &state, FieldReader &reader) {
30
- auto file_path = reader.ReadRequired<string>();
31
- auto use_tmp_file = reader.ReadRequired<bool>();
32
- auto overwrite_or_ignore = reader.ReadRequired<bool>();
33
- auto per_thread_output = reader.ReadRequired<bool>();
34
- auto partition_columns = reader.ReadRequiredList<idx_t>();
35
-
36
- auto copy_func_name = reader.ReadRequired<string>();
37
-
38
- auto has_bind_data = reader.ReadRequired<bool>();
39
-
40
- auto &context = state.gstate.context;
41
- auto &copy_func_catalog_entry =
42
- Catalog::GetEntry<CopyFunctionCatalogEntry>(context, INVALID_CATALOG, DEFAULT_SCHEMA, copy_func_name);
43
- auto &copy_func = copy_func_catalog_entry.function;
44
-
45
- unique_ptr<FunctionData> bind_data;
46
- if (has_bind_data) {
47
- if (!copy_func.deserialize) {
48
- throw SerializationException("Have bind info but no deserialization function for %s", copy_func.name);
49
- }
50
- bind_data = copy_func.deserialize(context, reader, copy_func);
51
- }
52
-
53
- auto result = make_uniq<LogicalCopyToFile>(copy_func, std::move(bind_data));
54
- result->file_path = file_path;
55
- result->use_tmp_file = use_tmp_file;
56
- result->overwrite_or_ignore = overwrite_or_ignore;
57
- result->per_thread_output = per_thread_output;
58
- result->partition_columns = std::move(partition_columns);
59
- return std::move(result);
60
- }
61
-
62
- void LogicalCopyToFile::FormatSerialize(FormatSerializer &serializer) const {
8
+ void LogicalCopyToFile::Serialize(Serializer &serializer) const {
63
9
  throw SerializationException("LogicalCopyToFile not implemented yet");
64
10
  }
65
11
 
66
- unique_ptr<LogicalOperator> LogicalCopyToFile::FormatDeserialize(FormatDeserializer &deserializer) {
12
+ unique_ptr<LogicalOperator> LogicalCopyToFile::Deserialize(Deserializer &deserializer) {
67
13
  throw SerializationException("LogicalCopyToFile not implemented yet");
68
14
  }
69
15
 
@@ -12,18 +12,6 @@ LogicalCreate::LogicalCreate(LogicalOperatorType type, ClientContext &context, u
12
12
  this->schema = Catalog::GetSchema(context, info->catalog, info->schema, OnEntryNotFound::RETURN_NULL);
13
13
  }
14
14
 
15
- void LogicalCreate::Serialize(FieldWriter &writer) const {
16
- info->Serialize(writer.GetSerializer());
17
- }
18
-
19
- unique_ptr<LogicalOperator> LogicalCreate::Deserialize(LogicalDeserializationState &state, FieldReader &reader) {
20
- auto &context = state.gstate.context;
21
- auto info = CreateInfo::Deserialize(reader.GetSource());
22
-
23
- auto schema_catalog_entry = Catalog::GetSchema(context, info->catalog, info->schema, OnEntryNotFound::RETURN_NULL);
24
- return make_uniq<LogicalCreate>(state.type, std::move(info), schema_catalog_entry);
25
- }
26
-
27
15
  idx_t LogicalCreate::EstimateCardinality(ClientContext &context) {
28
16
  return 1;
29
17
  }
@@ -30,31 +30,6 @@ LogicalCreateIndex::LogicalCreateIndex(ClientContext &context, unique_ptr<Create
30
30
  this->expressions = std::move(expressions_p);
31
31
  }
32
32
 
33
- void LogicalCreateIndex::Serialize(FieldWriter &writer) const {
34
- writer.WriteOptional(info);
35
- writer.WriteString(table.catalog.GetName());
36
- writer.WriteString(table.schema.name);
37
- writer.WriteString(table.name);
38
- writer.WriteSerializableList(unbound_expressions);
39
- }
40
-
41
- unique_ptr<LogicalOperator> LogicalCreateIndex::Deserialize(LogicalDeserializationState &state, FieldReader &reader) {
42
- auto &context = state.gstate.context;
43
-
44
- auto info = reader.ReadOptional<CreateInfo>(nullptr);
45
- auto catalog = reader.ReadRequired<string>();
46
- auto schema = reader.ReadRequired<string>();
47
- auto table_name = reader.ReadRequired<string>();
48
- auto unbound_expressions = reader.ReadRequiredSerializableList<Expression>(state.gstate);
49
- if (info->type != CatalogType::INDEX_ENTRY) {
50
- throw InternalException("Unexpected type: '%s', expected '%s'", CatalogTypeToString(info->type),
51
- CatalogTypeToString(CatalogType::INDEX_ENTRY));
52
- }
53
- auto index_info = unique_ptr_cast<CreateInfo, CreateIndexInfo>(std::move(info));
54
- auto &table = Catalog::GetEntry<TableCatalogEntry>(context, catalog, schema, table_name);
55
- return make_uniq<LogicalCreateIndex>(std::move(index_info), std::move(unbound_expressions), table);
56
- }
57
-
58
33
  void LogicalCreateIndex::ResolveTypes() {
59
34
  types.emplace_back(LogicalType::BIGINT);
60
35
  }
@@ -14,16 +14,6 @@ LogicalCreateTable::LogicalCreateTable(ClientContext &context, const string &cat
14
14
  info = binder->BindCreateTableInfo(unique_ptr_cast<CreateInfo, CreateTableInfo>(std::move(unbound_info)));
15
15
  }
16
16
 
17
- void LogicalCreateTable::Serialize(FieldWriter &writer) const {
18
- writer.WriteSerializable(*info);
19
- }
20
-
21
- unique_ptr<LogicalOperator> LogicalCreateTable::Deserialize(LogicalDeserializationState &state, FieldReader &reader) {
22
- auto info = reader.ReadRequiredSerializable<BoundCreateTableInfo>(state.gstate);
23
- auto &schema = info->schema;
24
- return make_uniq<LogicalCreateTable>(schema, std::move(info));
25
- }
26
-
27
17
  idx_t LogicalCreateTable::EstimateCardinality(ClientContext &context) {
28
18
  return 1;
29
19
  }
@@ -17,13 +17,4 @@ unique_ptr<LogicalOperator> LogicalCrossProduct::Create(unique_ptr<LogicalOperat
17
17
  return make_uniq<LogicalCrossProduct>(std::move(left), std::move(right));
18
18
  }
19
19
 
20
- void LogicalCrossProduct::Serialize(FieldWriter &writer) const {
21
- }
22
-
23
- unique_ptr<LogicalOperator> LogicalCrossProduct::Deserialize(LogicalDeserializationState &state, FieldReader &reader) {
24
- // TODO(stephwang): review if unique_ptr<LogicalOperator> plan is needed
25
- auto result = unique_ptr<LogicalCrossProduct>(new LogicalCrossProduct());
26
- return std::move(result);
27
- }
28
-
29
20
  } // namespace duckdb
@@ -1,27 +1,9 @@
1
1
  #include "duckdb/planner/operator/logical_cteref.hpp"
2
2
 
3
- #include "duckdb/common/field_writer.hpp"
4
3
  #include "duckdb/main/config.hpp"
5
4
 
6
5
  namespace duckdb {
7
6
 
8
- void LogicalCTERef::Serialize(FieldWriter &writer) const {
9
- writer.WriteField(table_index);
10
- writer.WriteField(cte_index);
11
- writer.WriteRegularSerializableList(chunk_types);
12
- writer.WriteList<string>(bound_columns);
13
- writer.WriteField(materialized_cte);
14
- }
15
-
16
- unique_ptr<LogicalOperator> LogicalCTERef::Deserialize(LogicalDeserializationState &state, FieldReader &reader) {
17
- auto table_index = reader.ReadRequired<idx_t>();
18
- auto cte_index = reader.ReadRequired<idx_t>();
19
- auto chunk_types = reader.ReadRequiredSerializableList<LogicalType, LogicalType>();
20
- auto bound_columns = reader.ReadRequiredList<string>();
21
- auto materialized_cte = reader.ReadField<CTEMaterialize>(CTEMaterialize::CTE_MATERIALIZE_DEFAULT);
22
- return make_uniq<LogicalCTERef>(table_index, cte_index, chunk_types, bound_columns, materialized_cte);
23
- }
24
-
25
7
  vector<idx_t> LogicalCTERef::GetTableIndex() const {
26
8
  return vector<idx_t> {table_index};
27
9
  }