duckdb 0.8.2-dev1862.0 → 0.8.2-dev2044.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 (283) hide show
  1. package/binding.gyp +9 -9
  2. package/package.json +1 -1
  3. package/src/duckdb/src/catalog/catalog.cpp +1 -1
  4. package/src/duckdb/src/catalog/catalog_entry/index_catalog_entry.cpp +17 -41
  5. package/src/duckdb/src/catalog/catalog_entry/macro_catalog_entry.cpp +2 -10
  6. package/src/duckdb/src/catalog/catalog_entry/schema_catalog_entry.cpp +4 -14
  7. package/src/duckdb/src/catalog/catalog_entry/sequence_catalog_entry.cpp +11 -28
  8. package/src/duckdb/src/catalog/catalog_entry/table_catalog_entry.cpp +11 -38
  9. package/src/duckdb/src/catalog/catalog_entry/view_catalog_entry.cpp +11 -27
  10. package/src/duckdb/src/catalog/catalog_entry.cpp +25 -1
  11. package/src/duckdb/src/common/enum_util.cpp +187 -0
  12. package/src/duckdb/src/common/extra_type_info.cpp +1 -2
  13. package/src/duckdb/src/common/serializer/binary_deserializer.cpp +3 -0
  14. package/src/duckdb/src/common/serializer/binary_serializer.cpp +4 -4
  15. package/src/duckdb/src/common/types/column/column_data_collection.cpp +43 -0
  16. package/src/duckdb/src/common/types/hugeint.cpp +40 -0
  17. package/src/duckdb/src/common/types/vector.cpp +1 -1
  18. package/src/duckdb/src/common/types.cpp +0 -12
  19. package/src/duckdb/src/core_functions/function_list.cpp +1 -0
  20. package/src/duckdb/src/core_functions/scalar/string/to_base.cpp +66 -0
  21. package/src/duckdb/src/execution/operator/aggregate/physical_hash_aggregate.cpp +14 -11
  22. package/src/duckdb/src/execution/operator/aggregate/physical_perfecthash_aggregate.cpp +6 -4
  23. package/src/duckdb/src/execution/operator/aggregate/physical_ungrouped_aggregate.cpp +14 -12
  24. package/src/duckdb/src/execution/operator/aggregate/physical_window.cpp +6 -4
  25. package/src/duckdb/src/execution/operator/helper/physical_batch_collector.cpp +8 -6
  26. package/src/duckdb/src/execution/operator/helper/physical_explain_analyze.cpp +2 -2
  27. package/src/duckdb/src/execution/operator/helper/physical_limit.cpp +5 -3
  28. package/src/duckdb/src/execution/operator/helper/physical_materialized_collector.cpp +7 -5
  29. package/src/duckdb/src/execution/operator/helper/physical_vacuum.cpp +7 -5
  30. package/src/duckdb/src/execution/operator/join/physical_asof_join.cpp +5 -4
  31. package/src/duckdb/src/execution/operator/join/physical_blockwise_nl_join.cpp +2 -2
  32. package/src/duckdb/src/execution/operator/join/physical_delim_join.cpp +13 -6
  33. package/src/duckdb/src/execution/operator/join/physical_hash_join.cpp +7 -5
  34. package/src/duckdb/src/execution/operator/join/physical_iejoin.cpp +7 -5
  35. package/src/duckdb/src/execution/operator/join/physical_nested_loop_join.cpp +7 -4
  36. package/src/duckdb/src/execution/operator/join/physical_piecewise_merge_join.cpp +8 -6
  37. package/src/duckdb/src/execution/operator/order/physical_order.cpp +7 -5
  38. package/src/duckdb/src/execution/operator/order/physical_top_n.cpp +7 -5
  39. package/src/duckdb/src/execution/operator/persistent/physical_batch_copy_to_file.cpp +8 -6
  40. package/src/duckdb/src/execution/operator/persistent/physical_batch_insert.cpp +8 -7
  41. package/src/duckdb/src/execution/operator/persistent/physical_copy_to_file.cpp +8 -6
  42. package/src/duckdb/src/execution/operator/persistent/physical_fixed_batch_copy.cpp +11 -9
  43. package/src/duckdb/src/execution/operator/persistent/physical_insert.cpp +10 -10
  44. package/src/duckdb/src/execution/operator/persistent/physical_update.cpp +4 -2
  45. package/src/duckdb/src/execution/operator/schema/physical_create_index.cpp +7 -6
  46. package/src/duckdb/src/execution/physical_operator.cpp +3 -2
  47. package/src/duckdb/src/execution/physical_plan/plan_comparison_join.cpp +1 -1
  48. package/src/duckdb/src/function/table/version/pragma_version.cpp +2 -2
  49. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/index_catalog_entry.hpp +1 -2
  50. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/macro_catalog_entry.hpp +1 -4
  51. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/schema_catalog_entry.hpp +2 -5
  52. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/sequence_catalog_entry.hpp +1 -6
  53. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/table_catalog_entry.hpp +2 -11
  54. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/view_catalog_entry.hpp +2 -5
  55. package/src/duckdb/src/include/duckdb/catalog/catalog_entry.hpp +14 -0
  56. package/src/duckdb/src/include/duckdb/common/bitpacking.hpp +70 -55
  57. package/src/duckdb/src/include/duckdb/common/constants.hpp +2 -0
  58. package/src/duckdb/src/include/duckdb/common/enum_util.hpp +40 -0
  59. package/src/duckdb/src/include/duckdb/common/enums/index_type.hpp +1 -1
  60. package/src/duckdb/src/include/duckdb/common/enums/operator_result_type.hpp +5 -1
  61. package/src/duckdb/src/include/duckdb/common/hugeint.hpp +15 -0
  62. package/src/duckdb/src/include/duckdb/common/index_vector.hpp +12 -0
  63. package/src/duckdb/src/include/duckdb/common/limits.hpp +52 -149
  64. package/src/duckdb/src/include/duckdb/common/numeric_utils.hpp +48 -0
  65. package/src/duckdb/src/include/duckdb/common/serializer/binary_deserializer.hpp +28 -4
  66. package/src/duckdb/src/include/duckdb/common/serializer/binary_serializer.hpp +12 -5
  67. package/src/duckdb/src/include/duckdb/common/serializer/deserialization_data.hpp +110 -0
  68. package/src/duckdb/src/include/duckdb/common/serializer/format_deserializer.hpp +46 -1
  69. package/src/duckdb/src/include/duckdb/common/serializer/format_serializer.hpp +23 -21
  70. package/src/duckdb/src/include/duckdb/common/serializer/serialization_traits.hpp +12 -4
  71. package/src/duckdb/src/include/duckdb/common/types/column/column_data_collection.hpp +3 -0
  72. package/src/duckdb/src/include/duckdb/core_functions/aggregate/distributive_functions.hpp +1 -1
  73. package/src/duckdb/src/include/duckdb/core_functions/scalar/operators_functions.hpp +1 -1
  74. package/src/duckdb/src/include/duckdb/core_functions/scalar/string_functions.hpp +9 -0
  75. package/src/duckdb/src/include/duckdb/execution/operator/aggregate/physical_hash_aggregate.hpp +3 -3
  76. package/src/duckdb/src/include/duckdb/execution/operator/aggregate/physical_perfecthash_aggregate.hpp +1 -1
  77. package/src/duckdb/src/include/duckdb/execution/operator/aggregate/physical_ungrouped_aggregate.hpp +3 -3
  78. package/src/duckdb/src/include/duckdb/execution/operator/aggregate/physical_window.hpp +2 -2
  79. package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_batch_collector.hpp +2 -2
  80. package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_explain_analyze.hpp +1 -1
  81. package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_limit.hpp +1 -1
  82. package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_materialized_collector.hpp +1 -1
  83. package/src/duckdb/src/include/duckdb/execution/operator/helper/physical_vacuum.hpp +2 -2
  84. package/src/duckdb/src/include/duckdb/execution/operator/join/physical_asof_join.hpp +2 -2
  85. package/src/duckdb/src/include/duckdb/execution/operator/join/physical_blockwise_nl_join.hpp +1 -1
  86. package/src/duckdb/src/include/duckdb/execution/operator/join/physical_delim_join.hpp +2 -2
  87. package/src/duckdb/src/include/duckdb/execution/operator/join/physical_hash_join.hpp +2 -2
  88. package/src/duckdb/src/include/duckdb/execution/operator/join/physical_iejoin.hpp +2 -2
  89. package/src/duckdb/src/include/duckdb/execution/operator/join/physical_nested_loop_join.hpp +2 -2
  90. package/src/duckdb/src/include/duckdb/execution/operator/join/physical_piecewise_merge_join.hpp +2 -2
  91. package/src/duckdb/src/include/duckdb/execution/operator/order/physical_order.hpp +2 -2
  92. package/src/duckdb/src/include/duckdb/execution/operator/order/physical_top_n.hpp +2 -2
  93. package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_batch_copy_to_file.hpp +2 -2
  94. package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_batch_insert.hpp +2 -2
  95. package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_copy_to_file.hpp +2 -2
  96. package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_fixed_batch_copy.hpp +2 -2
  97. package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_insert.hpp +2 -2
  98. package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_update.hpp +1 -1
  99. package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_create_index.hpp +2 -2
  100. package/src/duckdb/src/include/duckdb/execution/physical_operator.hpp +3 -3
  101. package/src/duckdb/src/include/duckdb/execution/physical_operator_states.hpp +11 -0
  102. package/src/duckdb/src/include/duckdb/function/macro_function.hpp +3 -0
  103. package/src/duckdb/src/include/duckdb/function/scalar_macro_function.hpp +3 -0
  104. package/src/duckdb/src/include/duckdb/function/table_macro_function.hpp +3 -0
  105. package/src/duckdb/src/include/duckdb/main/extension_entries.hpp +3 -0
  106. package/src/duckdb/src/include/duckdb/parallel/pipeline.hpp +0 -3
  107. package/src/duckdb/src/include/duckdb/parallel/pipeline_executor.hpp +3 -2
  108. package/src/duckdb/src/include/duckdb/parser/column_definition.hpp +6 -5
  109. package/src/duckdb/src/include/duckdb/parser/column_list.hpp +4 -0
  110. package/src/duckdb/src/include/duckdb/parser/constraint.hpp +5 -0
  111. package/src/duckdb/src/include/duckdb/parser/constraints/check_constraint.hpp +3 -0
  112. package/src/duckdb/src/include/duckdb/parser/constraints/foreign_key_constraint.hpp +6 -0
  113. package/src/duckdb/src/include/duckdb/parser/constraints/not_null_constraint.hpp +3 -0
  114. package/src/duckdb/src/include/duckdb/parser/constraints/unique_constraint.hpp +6 -0
  115. package/src/duckdb/src/include/duckdb/parser/expression/between_expression.hpp +1 -1
  116. package/src/duckdb/src/include/duckdb/parser/expression/case_expression.hpp +1 -1
  117. package/src/duckdb/src/include/duckdb/parser/expression/cast_expression.hpp +1 -1
  118. package/src/duckdb/src/include/duckdb/parser/expression/collate_expression.hpp +1 -1
  119. package/src/duckdb/src/include/duckdb/parser/expression/columnref_expression.hpp +1 -1
  120. package/src/duckdb/src/include/duckdb/parser/expression/comparison_expression.hpp +1 -1
  121. package/src/duckdb/src/include/duckdb/parser/expression/conjunction_expression.hpp +1 -1
  122. package/src/duckdb/src/include/duckdb/parser/expression/constant_expression.hpp +1 -1
  123. package/src/duckdb/src/include/duckdb/parser/expression/default_expression.hpp +1 -1
  124. package/src/duckdb/src/include/duckdb/parser/expression/function_expression.hpp +1 -1
  125. package/src/duckdb/src/include/duckdb/parser/expression/lambda_expression.hpp +1 -1
  126. package/src/duckdb/src/include/duckdb/parser/expression/operator_expression.hpp +1 -1
  127. package/src/duckdb/src/include/duckdb/parser/expression/parameter_expression.hpp +1 -1
  128. package/src/duckdb/src/include/duckdb/parser/expression/positional_reference_expression.hpp +1 -1
  129. package/src/duckdb/src/include/duckdb/parser/expression/star_expression.hpp +1 -1
  130. package/src/duckdb/src/include/duckdb/parser/expression/subquery_expression.hpp +1 -1
  131. package/src/duckdb/src/include/duckdb/parser/expression/window_expression.hpp +1 -1
  132. package/src/duckdb/src/include/duckdb/parser/parsed_data/alter_info.hpp +12 -1
  133. package/src/duckdb/src/include/duckdb/parser/parsed_data/alter_table_info.hpp +66 -2
  134. package/src/duckdb/src/include/duckdb/parser/parsed_data/attach_info.hpp +8 -1
  135. package/src/duckdb/src/include/duckdb/parser/parsed_data/copy_info.hpp +8 -1
  136. package/src/duckdb/src/include/duckdb/parser/parsed_data/create_index_info.hpp +4 -1
  137. package/src/duckdb/src/include/duckdb/parser/parsed_data/create_info.hpp +9 -2
  138. package/src/duckdb/src/include/duckdb/parser/parsed_data/create_macro_info.hpp +3 -0
  139. package/src/duckdb/src/include/duckdb/parser/parsed_data/create_schema_info.hpp +3 -0
  140. package/src/duckdb/src/include/duckdb/parser/parsed_data/create_sequence_info.hpp +3 -0
  141. package/src/duckdb/src/include/duckdb/parser/parsed_data/create_table_info.hpp +3 -0
  142. package/src/duckdb/src/include/duckdb/parser/parsed_data/create_type_info.hpp +3 -0
  143. package/src/duckdb/src/include/duckdb/parser/parsed_data/create_view_info.hpp +3 -0
  144. package/src/duckdb/src/include/duckdb/parser/parsed_data/detach_info.hpp +7 -0
  145. package/src/duckdb/src/include/duckdb/parser/parsed_data/drop_info.hpp +7 -0
  146. package/src/duckdb/src/include/duckdb/parser/parsed_data/exported_table_data.hpp +7 -0
  147. package/src/duckdb/src/include/duckdb/parser/parsed_data/load_info.hpp +13 -3
  148. package/src/duckdb/src/include/duckdb/parser/parsed_data/parse_info.hpp +22 -0
  149. package/src/duckdb/src/include/duckdb/parser/parsed_data/pragma_info.hpp +10 -0
  150. package/src/duckdb/src/include/duckdb/parser/parsed_data/show_select_info.hpp +7 -0
  151. package/src/duckdb/src/include/duckdb/parser/parsed_data/transaction_info.hpp +10 -0
  152. package/src/duckdb/src/include/duckdb/parser/parsed_data/vacuum_info.hpp +10 -0
  153. package/src/duckdb/src/include/duckdb/planner/bound_constraint.hpp +0 -8
  154. package/src/duckdb/src/include/duckdb/planner/bound_result_modifier.hpp +6 -0
  155. package/src/duckdb/src/include/duckdb/planner/column_binding.hpp +5 -0
  156. package/src/duckdb/src/include/duckdb/planner/expression/bound_between_expression.hpp +6 -0
  157. package/src/duckdb/src/include/duckdb/planner/expression/bound_case_expression.hpp +6 -0
  158. package/src/duckdb/src/include/duckdb/planner/expression/bound_cast_expression.hpp +6 -0
  159. package/src/duckdb/src/include/duckdb/planner/expression/bound_columnref_expression.hpp +3 -0
  160. package/src/duckdb/src/include/duckdb/planner/expression/bound_comparison_expression.hpp +3 -0
  161. package/src/duckdb/src/include/duckdb/planner/expression/bound_conjunction_expression.hpp +3 -0
  162. package/src/duckdb/src/include/duckdb/planner/expression/bound_constant_expression.hpp +3 -0
  163. package/src/duckdb/src/include/duckdb/planner/expression/bound_default_expression.hpp +3 -0
  164. package/src/duckdb/src/include/duckdb/planner/expression/bound_lambda_expression.hpp +3 -1
  165. package/src/duckdb/src/include/duckdb/planner/expression/bound_lambdaref_expression.hpp +3 -0
  166. package/src/duckdb/src/include/duckdb/planner/expression/bound_operator_expression.hpp +3 -0
  167. package/src/duckdb/src/include/duckdb/planner/expression/bound_parameter_data.hpp +5 -2
  168. package/src/duckdb/src/include/duckdb/planner/expression/bound_parameter_expression.hpp +7 -0
  169. package/src/duckdb/src/include/duckdb/planner/expression/bound_reference_expression.hpp +3 -0
  170. package/src/duckdb/src/include/duckdb/planner/expression/bound_unnest_expression.hpp +3 -0
  171. package/src/duckdb/src/include/duckdb/planner/expression/list.hpp +1 -0
  172. package/src/duckdb/src/include/duckdb/planner/expression.hpp +3 -0
  173. package/src/duckdb/src/include/duckdb/planner/joinside.hpp +3 -0
  174. package/src/duckdb/src/include/duckdb/planner/logical_operator.hpp +3 -0
  175. package/src/duckdb/src/include/duckdb/planner/operator/logical_aggregate.hpp +3 -0
  176. package/src/duckdb/src/include/duckdb/planner/operator/logical_any_join.hpp +3 -0
  177. package/src/duckdb/src/include/duckdb/planner/operator/logical_column_data_get.hpp +4 -0
  178. package/src/duckdb/src/include/duckdb/planner/operator/logical_comparison_join.hpp +9 -2
  179. package/src/duckdb/src/include/duckdb/planner/operator/logical_create.hpp +9 -6
  180. package/src/duckdb/src/include/duckdb/planner/operator/logical_create_index.hpp +2 -16
  181. package/src/duckdb/src/include/duckdb/planner/operator/logical_create_table.hpp +10 -6
  182. package/src/duckdb/src/include/duckdb/planner/operator/logical_cross_product.hpp +3 -0
  183. package/src/duckdb/src/include/duckdb/planner/operator/logical_cteref.hpp +2 -0
  184. package/src/duckdb/src/include/duckdb/planner/operator/logical_delete.hpp +7 -0
  185. package/src/duckdb/src/include/duckdb/planner/operator/logical_delim_get.hpp +3 -0
  186. package/src/duckdb/src/include/duckdb/planner/operator/logical_distinct.hpp +6 -10
  187. package/src/duckdb/src/include/duckdb/planner/operator/logical_dummy_scan.hpp +2 -0
  188. package/src/duckdb/src/include/duckdb/planner/operator/logical_empty_result.hpp +2 -0
  189. package/src/duckdb/src/include/duckdb/planner/operator/logical_explain.hpp +4 -0
  190. package/src/duckdb/src/include/duckdb/planner/operator/logical_expression_get.hpp +3 -0
  191. package/src/duckdb/src/include/duckdb/planner/operator/logical_filter.hpp +3 -0
  192. package/src/duckdb/src/include/duckdb/planner/operator/logical_insert.hpp +6 -0
  193. package/src/duckdb/src/include/duckdb/planner/operator/logical_limit.hpp +3 -0
  194. package/src/duckdb/src/include/duckdb/planner/operator/logical_limit_percent.hpp +3 -0
  195. package/src/duckdb/src/include/duckdb/planner/operator/logical_materialized_cte.hpp +5 -2
  196. package/src/duckdb/src/include/duckdb/planner/operator/logical_order.hpp +7 -35
  197. package/src/duckdb/src/include/duckdb/planner/operator/logical_pivot.hpp +6 -0
  198. package/src/duckdb/src/include/duckdb/planner/operator/logical_positional_join.hpp +3 -0
  199. package/src/duckdb/src/include/duckdb/planner/operator/logical_projection.hpp +3 -0
  200. package/src/duckdb/src/include/duckdb/planner/operator/logical_recursive_cte.hpp +5 -3
  201. package/src/duckdb/src/include/duckdb/planner/operator/logical_reset.hpp +4 -0
  202. package/src/duckdb/src/include/duckdb/planner/operator/logical_sample.hpp +6 -0
  203. package/src/duckdb/src/include/duckdb/planner/operator/logical_set.hpp +4 -0
  204. package/src/duckdb/src/include/duckdb/planner/operator/logical_set_operation.hpp +4 -0
  205. package/src/duckdb/src/include/duckdb/planner/operator/logical_show.hpp +3 -0
  206. package/src/duckdb/src/include/duckdb/planner/operator/logical_simple.hpp +3 -0
  207. package/src/duckdb/src/include/duckdb/planner/operator/logical_top_n.hpp +4 -0
  208. package/src/duckdb/src/include/duckdb/planner/operator/logical_unnest.hpp +2 -0
  209. package/src/duckdb/src/include/duckdb/planner/operator/logical_update.hpp +6 -0
  210. package/src/duckdb/src/include/duckdb/planner/operator/logical_window.hpp +3 -0
  211. package/src/duckdb/src/include/duckdb/planner/tableref/bound_pivotref.hpp +3 -0
  212. package/src/duckdb/src/main/relation/join_relation.cpp +1 -1
  213. package/src/duckdb/src/optimizer/deliminator.cpp +5 -3
  214. package/src/duckdb/src/parallel/pipeline.cpp +0 -17
  215. package/src/duckdb/src/parallel/pipeline_executor.cpp +26 -7
  216. package/src/duckdb/src/parallel/pipeline_finish_event.cpp +55 -1
  217. package/src/duckdb/src/parser/column_definition.cpp +20 -32
  218. package/src/duckdb/src/parser/column_list.cpp +8 -0
  219. package/src/duckdb/src/parser/constraints/foreign_key_constraint.cpp +3 -0
  220. package/src/duckdb/src/parser/constraints/unique_constraint.cpp +3 -0
  221. package/src/duckdb/src/parser/expression/case_expression.cpp +0 -12
  222. package/src/duckdb/src/parser/parsed_data/alter_info.cpp +5 -2
  223. package/src/duckdb/src/parser/parsed_data/alter_table_info.cpp +38 -0
  224. package/src/duckdb/src/parser/parsed_data/create_index_info.cpp +3 -1
  225. package/src/duckdb/src/parser/parsed_data/create_sequence_info.cpp +2 -0
  226. package/src/duckdb/src/parser/parsed_data/detach_info.cpp +1 -1
  227. package/src/duckdb/src/parser/parsed_data/drop_info.cpp +1 -1
  228. package/src/duckdb/src/parser/parsed_data/sample_options.cpp +0 -18
  229. package/src/duckdb/src/parser/parsed_data/transaction_info.cpp +4 -1
  230. package/src/duckdb/src/parser/parsed_data/vacuum_info.cpp +1 -1
  231. package/src/duckdb/src/parser/query_node.cpp +0 -10
  232. package/src/duckdb/src/parser/result_modifier.cpp +0 -13
  233. package/src/duckdb/src/parser/statement/select_statement.cpp +0 -10
  234. package/src/duckdb/src/parser/tableref/pivotref.cpp +0 -16
  235. package/src/duckdb/src/parser/transform/statement/transform_create_index.cpp +5 -4
  236. package/src/duckdb/src/planner/binder/query_node/plan_subquery.cpp +1 -1
  237. package/src/duckdb/src/planner/binder/statement/bind_create.cpp +6 -1
  238. package/src/duckdb/src/planner/binder/tableref/bind_basetableref.cpp +13 -3
  239. package/src/duckdb/src/planner/expression/bound_between_expression.cpp +4 -0
  240. package/src/duckdb/src/planner/expression/bound_cast_expression.cpp +13 -6
  241. package/src/duckdb/src/planner/expression/bound_parameter_expression.cpp +20 -12
  242. package/src/duckdb/src/planner/logical_operator.cpp +13 -1
  243. package/src/duckdb/src/planner/operator/logical_comparison_join.cpp +16 -2
  244. package/src/duckdb/src/planner/operator/logical_create.cpp +14 -0
  245. package/src/duckdb/src/planner/operator/logical_create_index.cpp +20 -0
  246. package/src/duckdb/src/planner/operator/logical_create_table.cpp +16 -0
  247. package/src/duckdb/src/planner/operator/logical_delete.cpp +9 -2
  248. package/src/duckdb/src/planner/operator/logical_delim_join.cpp +2 -4
  249. package/src/duckdb/src/planner/operator/logical_distinct.cpp +13 -0
  250. package/src/duckdb/src/planner/operator/logical_explain.cpp +1 -1
  251. package/src/duckdb/src/planner/operator/logical_insert.cpp +8 -2
  252. package/src/duckdb/src/planner/operator/logical_materialized_cte.cpp +3 -2
  253. package/src/duckdb/src/planner/operator/logical_order.cpp +39 -0
  254. package/src/duckdb/src/planner/operator/logical_pivot.cpp +3 -0
  255. package/src/duckdb/src/planner/operator/logical_recursive_cte.cpp +5 -5
  256. package/src/duckdb/src/planner/operator/logical_sample.cpp +3 -0
  257. package/src/duckdb/src/planner/operator/logical_update.cpp +8 -2
  258. package/src/duckdb/src/planner/parsed_data/bound_create_table_info.cpp +4 -2
  259. package/src/duckdb/src/planner/planner.cpp +11 -0
  260. package/src/duckdb/src/storage/checkpoint_manager.cpp +23 -23
  261. package/src/duckdb/src/storage/compression/bitpacking.cpp +87 -63
  262. package/src/duckdb/src/storage/compression/bitpacking_hugeint.cpp +295 -0
  263. package/src/duckdb/src/storage/serialization/serialize_constraint.cpp +98 -0
  264. package/src/duckdb/src/storage/serialization/serialize_create_info.cpp +188 -0
  265. package/src/duckdb/src/storage/serialization/serialize_expression.cpp +274 -0
  266. package/src/duckdb/src/storage/serialization/serialize_logical_operator.cpp +729 -0
  267. package/src/duckdb/src/storage/serialization/serialize_macro_function.cpp +62 -0
  268. package/src/duckdb/src/storage/serialization/serialize_nodes.cpp +242 -0
  269. package/src/duckdb/src/storage/serialization/serialize_parse_info.cpp +419 -0
  270. package/src/duckdb/src/storage/serialization/serialize_parsed_expression.cpp +40 -38
  271. package/src/duckdb/src/storage/serialization/serialize_query_node.cpp +36 -36
  272. package/src/duckdb/src/storage/serialization/serialize_result_modifier.cpp +25 -14
  273. package/src/duckdb/src/storage/serialization/serialize_statement.cpp +22 -0
  274. package/src/duckdb/src/storage/serialization/serialize_tableref.cpp +47 -47
  275. package/src/duckdb/src/storage/serialization/serialize_types.cpp +25 -25
  276. package/src/duckdb/src/storage/storage_info.cpp +3 -2
  277. package/src/duckdb/src/storage/wal_replay.cpp +20 -19
  278. package/src/duckdb/ub_extension_icu_third_party_icu_i18n.cpp +6 -6
  279. package/src/duckdb/ub_src_core_functions_scalar_string.cpp +2 -0
  280. package/src/duckdb/ub_src_parser.cpp +0 -2
  281. package/src/duckdb/ub_src_storage_compression.cpp +2 -0
  282. package/src/duckdb/ub_src_storage_serialization.cpp +16 -0
  283. package/src/duckdb/src/parser/common_table_expression_info.cpp +0 -21
@@ -0,0 +1,295 @@
1
+ #include "duckdb/common/bitpacking.hpp"
2
+
3
+ namespace duckdb {
4
+
5
+ //===--------------------------------------------------------------------===//
6
+ // Unpacking
7
+ //===--------------------------------------------------------------------===//
8
+
9
+ static void UnpackSingle(const uint32_t *__restrict &in, hugeint_t *__restrict out, uint16_t delta, uint16_t shr) {
10
+ if (delta + shr < 32) {
11
+ *out = ((static_cast<hugeint_t>(in[0])) >> shr) % (hugeint_t(1) << delta);
12
+ }
13
+
14
+ else if (delta + shr >= 32 && delta + shr < 64) {
15
+ *out = static_cast<hugeint_t>(in[0]) >> shr;
16
+ ++in;
17
+
18
+ if (delta + shr > 32) {
19
+ const uint16_t NEXT_SHR = shr + delta - 32;
20
+ *out |= static_cast<hugeint_t>((*in) % (1U << NEXT_SHR)) << (32 - shr);
21
+ }
22
+ }
23
+
24
+ else if (delta + shr >= 64 && delta + shr < 96) {
25
+ *out = static_cast<hugeint_t>(in[0]) >> shr;
26
+ *out |= static_cast<hugeint_t>(in[1]) << (32 - shr);
27
+ in += 2;
28
+
29
+ if (delta + shr > 64) {
30
+ const uint16_t NEXT_SHR = delta + shr - 64;
31
+ *out |= static_cast<hugeint_t>((*in) % (1U << NEXT_SHR)) << (64 - shr);
32
+ }
33
+ }
34
+
35
+ else if (delta + shr >= 96 && delta + shr < 128) {
36
+ *out = static_cast<hugeint_t>(in[0]) >> shr;
37
+ *out |= static_cast<hugeint_t>(in[1]) << (32 - shr);
38
+ *out |= static_cast<hugeint_t>(in[2]) << (64 - shr);
39
+ in += 3;
40
+
41
+ if (delta + shr > 96) {
42
+ const uint16_t NEXT_SHR = delta + shr - 96;
43
+ *out |= static_cast<hugeint_t>((*in) % (1U << NEXT_SHR)) << (96 - shr);
44
+ }
45
+ }
46
+
47
+ else if (delta + shr >= 128) {
48
+ *out = static_cast<hugeint_t>(in[0]) >> shr;
49
+ *out |= static_cast<hugeint_t>(in[1]) << (32 - shr);
50
+ *out |= static_cast<hugeint_t>(in[2]) << (64 - shr);
51
+ *out |= static_cast<hugeint_t>(in[3]) << (96 - shr);
52
+ in += 4;
53
+
54
+ if (delta + shr > 128) {
55
+ const uint16_t NEXT_SHR = delta + shr - 128;
56
+ *out |= static_cast<hugeint_t>((*in) % (1U << NEXT_SHR)) << (128 - shr);
57
+ }
58
+ }
59
+ }
60
+
61
+ static void UnpackLast(const uint32_t *__restrict &in, hugeint_t *__restrict out, uint16_t delta) {
62
+ const uint8_t LAST_IDX = 31;
63
+ const uint16_t SHIFT = (delta * 31) % 32;
64
+ out[LAST_IDX] = in[0] >> SHIFT;
65
+ if (delta > 32) {
66
+ out[LAST_IDX] |= static_cast<hugeint_t>(in[1]) << (32 - SHIFT);
67
+ }
68
+ if (delta > 64) {
69
+ out[LAST_IDX] |= static_cast<hugeint_t>(in[2]) << (64 - SHIFT);
70
+ }
71
+ if (delta > 96) {
72
+ out[LAST_IDX] |= static_cast<hugeint_t>(in[3]) << (96 - SHIFT);
73
+ }
74
+ }
75
+
76
+ // Unpacks for specific deltas
77
+ static void UnpackDelta0(const uint32_t *__restrict in, hugeint_t *__restrict out) {
78
+ for (uint8_t i = 0; i < 32; ++i) {
79
+ out[i] = 0;
80
+ }
81
+ }
82
+
83
+ static void UnpackDelta32(const uint32_t *__restrict in, hugeint_t *__restrict out) {
84
+ for (uint8_t k = 0; k < 32; ++k) {
85
+ out[k] = static_cast<hugeint_t>(in[k]);
86
+ }
87
+ }
88
+
89
+ static void UnpackDelta64(const uint32_t *__restrict in, hugeint_t *__restrict out) {
90
+ for (uint8_t i = 0; i < 32; ++i) {
91
+ const uint8_t OFFSET = i * 2;
92
+ out[i] = in[OFFSET];
93
+ out[i] |= static_cast<hugeint_t>(in[OFFSET + 1]) << 32;
94
+ }
95
+ }
96
+
97
+ static void UnpackDelta96(const uint32_t *__restrict in, hugeint_t *__restrict out) {
98
+ for (uint8_t i = 0; i < 32; ++i) {
99
+ const uint8_t OFFSET = i * 3;
100
+ out[i] = in[OFFSET];
101
+ out[i] |= static_cast<hugeint_t>(in[OFFSET + 1]) << 32;
102
+ out[i] |= static_cast<hugeint_t>(in[OFFSET + 2]) << 64;
103
+ }
104
+ }
105
+
106
+ static void UnpackDelta128(const uint32_t *__restrict in, hugeint_t *__restrict out) {
107
+ for (uint8_t i = 0; i < 32; ++i) {
108
+ const uint8_t OFFSET = i * 4;
109
+ out[i] = in[OFFSET];
110
+ out[i] |= static_cast<hugeint_t>(in[OFFSET + 1]) << 32;
111
+ out[i] |= static_cast<hugeint_t>(in[OFFSET + 2]) << 64;
112
+ out[i] |= static_cast<hugeint_t>(in[OFFSET + 3]) << 96;
113
+ }
114
+ }
115
+
116
+ //===--------------------------------------------------------------------===//
117
+ // Packing
118
+ //===--------------------------------------------------------------------===//
119
+
120
+ static void PackSingle(const hugeint_t in, uint32_t *__restrict &out, uint16_t delta, uint16_t shl, hugeint_t mask) {
121
+ if (delta + shl < 32) {
122
+
123
+ if (shl == 0) {
124
+ out[0] = static_cast<uint32_t>(in & mask);
125
+ } else {
126
+ out[0] |= static_cast<uint32_t>((in & mask) << shl);
127
+ }
128
+
129
+ } else if (delta + shl >= 32 && delta + shl < 64) {
130
+
131
+ if (shl == 0) {
132
+ out[0] = static_cast<uint32_t>(in & mask);
133
+ } else {
134
+ out[0] |= static_cast<uint32_t>((in & mask) << shl);
135
+ }
136
+ ++out;
137
+
138
+ if (delta + shl > 32) {
139
+ *out = static_cast<uint32_t>((in & mask) >> (32 - shl));
140
+ }
141
+ }
142
+
143
+ else if (delta + shl >= 64 && delta + shl < 96) {
144
+
145
+ if (shl == 0) {
146
+ out[0] = static_cast<uint32_t>(in & mask);
147
+ } else {
148
+ out[0] |= static_cast<uint32_t>(in << shl);
149
+ }
150
+
151
+ out[1] = static_cast<uint32_t>((in & mask) >> (32 - shl));
152
+ out += 2;
153
+
154
+ if (delta + shl > 64) {
155
+ *out = static_cast<uint32_t>((in & mask) >> (64 - shl));
156
+ }
157
+ }
158
+
159
+ else if (delta + shl >= 96 && delta + shl < 128) {
160
+ if (shl == 0) {
161
+ out[0] = static_cast<uint32_t>(in & mask);
162
+ } else {
163
+ out[0] |= static_cast<uint32_t>(in << shl);
164
+ }
165
+
166
+ out[1] = static_cast<uint32_t>((in & mask) >> (32 - shl));
167
+ out[2] = static_cast<uint32_t>((in & mask) >> (64 - shl));
168
+ out += 3;
169
+
170
+ if (delta + shl > 96) {
171
+ *out = static_cast<uint32_t>((in & mask) >> (96 - shl));
172
+ }
173
+ }
174
+
175
+ else if (delta + shl >= 128) {
176
+ // shl == 0 won't ever happen here considering a delta of 128 calls PackDelta128
177
+ out[0] |= static_cast<uint32_t>(in << shl);
178
+ out[1] = static_cast<uint32_t>((in & mask) >> (32 - shl));
179
+ out[2] = static_cast<uint32_t>((in & mask) >> (64 - shl));
180
+ out[3] = static_cast<uint32_t>((in & mask) >> (96 - shl));
181
+ out += 4;
182
+
183
+ if (delta + shl > 128) {
184
+ *out = static_cast<uint32_t>((in & mask) >> (128 - shl));
185
+ }
186
+ }
187
+ }
188
+
189
+ static void PackLast(const hugeint_t *__restrict in, uint32_t *__restrict out, uint16_t delta) {
190
+ const uint8_t LAST_IDX = 31;
191
+ const uint16_t SHIFT = (delta * 31) % 32;
192
+ out[0] |= static_cast<uint32_t>(in[LAST_IDX] << SHIFT);
193
+ if (delta > 32) {
194
+ out[1] = static_cast<uint32_t>(in[LAST_IDX] >> (32 - SHIFT));
195
+ }
196
+ if (delta > 64) {
197
+ out[2] = static_cast<uint32_t>(in[LAST_IDX] >> (64 - SHIFT));
198
+ }
199
+ if (delta > 96) {
200
+ out[3] = static_cast<uint32_t>(in[LAST_IDX] >> (96 - SHIFT));
201
+ }
202
+ }
203
+
204
+ // Packs for specific deltas
205
+ static void PackDelta32(const hugeint_t *__restrict in, uint32_t *__restrict out) {
206
+ for (uint8_t i = 0; i < 32; ++i) {
207
+ out[i] = static_cast<uint32_t>(in[i]);
208
+ }
209
+ }
210
+
211
+ static void PackDelta64(const hugeint_t *__restrict in, uint32_t *__restrict out) {
212
+ for (uint8_t i = 0; i < 32; ++i) {
213
+ const uint8_t OFFSET = 2 * i;
214
+ out[OFFSET] = static_cast<uint32_t>(in[i]);
215
+ out[OFFSET + 1] = static_cast<uint32_t>(in[i] >> 32);
216
+ }
217
+ }
218
+
219
+ static void PackDelta96(const hugeint_t *__restrict in, uint32_t *__restrict out) {
220
+ for (uint8_t i = 0; i < 32; ++i) {
221
+ const uint8_t OFFSET = 3 * i;
222
+ out[OFFSET] = static_cast<uint32_t>(in[i]);
223
+ out[OFFSET + 1] = static_cast<uint32_t>(in[i] >> 32);
224
+ out[OFFSET + 2] = static_cast<uint32_t>(in[i] >> 64);
225
+ }
226
+ }
227
+
228
+ static void PackDelta128(const hugeint_t *__restrict in, uint32_t *__restrict out) {
229
+ for (uint8_t i = 0; i < 32; ++i) {
230
+ const uint8_t OFFSET = 4 * i;
231
+ out[OFFSET] = static_cast<uint32_t>(in[i]);
232
+ out[OFFSET + 1] = static_cast<uint32_t>(in[i] >> 32);
233
+ out[OFFSET + 2] = static_cast<uint32_t>(in[i] >> 64);
234
+ out[OFFSET + 3] = static_cast<uint32_t>(in[i] >> 96);
235
+ }
236
+ }
237
+
238
+ //===--------------------------------------------------------------------===//
239
+ // HugeIntPacker
240
+ //===--------------------------------------------------------------------===//
241
+
242
+ void HugeIntPacker::Pack(const hugeint_t *__restrict in, uint32_t *__restrict out, bitpacking_width_t width) {
243
+ D_ASSERT(width <= 128);
244
+ switch (width) {
245
+ case 0:
246
+ break;
247
+ case 32:
248
+ PackDelta32(in, out);
249
+ break;
250
+ case 64:
251
+ PackDelta64(in, out);
252
+ break;
253
+ case 96:
254
+ PackDelta96(in, out);
255
+ break;
256
+ case 128:
257
+ PackDelta128(in, out);
258
+ break;
259
+ default:
260
+ for (idx_t oindex = 0; oindex < BitpackingPrimitives::BITPACKING_ALGORITHM_GROUP_SIZE - 1; ++oindex) {
261
+ PackSingle(in[oindex], out, width, (width * oindex) % BitpackingPrimitives::BITPACKING_ALGORITHM_GROUP_SIZE,
262
+ (hugeint_t(1) << width) - 1);
263
+ }
264
+ PackLast(in, out, width);
265
+ }
266
+ }
267
+
268
+ void HugeIntPacker::Unpack(const uint32_t *__restrict in, hugeint_t *__restrict out, bitpacking_width_t width) {
269
+ D_ASSERT(width <= 128);
270
+ switch (width) {
271
+ case 0:
272
+ UnpackDelta0(in, out);
273
+ break;
274
+ case 32:
275
+ UnpackDelta32(in, out);
276
+ break;
277
+ case 64:
278
+ UnpackDelta64(in, out);
279
+ break;
280
+ case 96:
281
+ UnpackDelta96(in, out);
282
+ break;
283
+ case 128:
284
+ UnpackDelta128(in, out);
285
+ break;
286
+ default:
287
+ for (idx_t oindex = 0; oindex < BitpackingPrimitives::BITPACKING_ALGORITHM_GROUP_SIZE - 1; ++oindex) {
288
+ UnpackSingle(in, out + oindex, width,
289
+ (width * oindex) % BitpackingPrimitives::BITPACKING_ALGORITHM_GROUP_SIZE);
290
+ }
291
+ UnpackLast(in, out, width);
292
+ }
293
+ }
294
+
295
+ } // namespace duckdb
@@ -0,0 +1,98 @@
1
+ //===----------------------------------------------------------------------===//
2
+ // This file is automatically generated by scripts/generate_serialization.py
3
+ // Do not edit this file manually, your changes will be overwritten
4
+ //===----------------------------------------------------------------------===//
5
+
6
+ #include "duckdb/common/serializer/format_serializer.hpp"
7
+ #include "duckdb/common/serializer/format_deserializer.hpp"
8
+ #include "duckdb/parser/constraints/list.hpp"
9
+
10
+ namespace duckdb {
11
+
12
+ void Constraint::FormatSerialize(FormatSerializer &serializer) const {
13
+ serializer.WriteProperty("type", type);
14
+ }
15
+
16
+ unique_ptr<Constraint> Constraint::FormatDeserialize(FormatDeserializer &deserializer) {
17
+ auto type = deserializer.ReadProperty<ConstraintType>("type");
18
+ unique_ptr<Constraint> result;
19
+ switch (type) {
20
+ case ConstraintType::CHECK:
21
+ result = CheckConstraint::FormatDeserialize(deserializer);
22
+ break;
23
+ case ConstraintType::FOREIGN_KEY:
24
+ result = ForeignKeyConstraint::FormatDeserialize(deserializer);
25
+ break;
26
+ case ConstraintType::NOT_NULL:
27
+ result = NotNullConstraint::FormatDeserialize(deserializer);
28
+ break;
29
+ case ConstraintType::UNIQUE:
30
+ result = UniqueConstraint::FormatDeserialize(deserializer);
31
+ break;
32
+ default:
33
+ throw SerializationException("Unsupported type for deserialization of Constraint!");
34
+ }
35
+ return result;
36
+ }
37
+
38
+ void CheckConstraint::FormatSerialize(FormatSerializer &serializer) const {
39
+ Constraint::FormatSerialize(serializer);
40
+ serializer.WriteProperty("expression", *expression);
41
+ }
42
+
43
+ unique_ptr<Constraint> CheckConstraint::FormatDeserialize(FormatDeserializer &deserializer) {
44
+ auto expression = deserializer.ReadProperty<unique_ptr<ParsedExpression>>("expression");
45
+ auto result = duckdb::unique_ptr<CheckConstraint>(new CheckConstraint(std::move(expression)));
46
+ return std::move(result);
47
+ }
48
+
49
+ void ForeignKeyConstraint::FormatSerialize(FormatSerializer &serializer) const {
50
+ Constraint::FormatSerialize(serializer);
51
+ serializer.WriteProperty("pk_columns", pk_columns);
52
+ serializer.WriteProperty("fk_columns", fk_columns);
53
+ serializer.WriteProperty("type", info.type);
54
+ serializer.WriteProperty("schema", info.schema);
55
+ serializer.WriteProperty("table", info.table);
56
+ serializer.WriteProperty("pk_keys", info.pk_keys);
57
+ serializer.WriteProperty("fk_keys", info.fk_keys);
58
+ }
59
+
60
+ unique_ptr<Constraint> ForeignKeyConstraint::FormatDeserialize(FormatDeserializer &deserializer) {
61
+ auto result = duckdb::unique_ptr<ForeignKeyConstraint>(new ForeignKeyConstraint());
62
+ deserializer.ReadProperty("pk_columns", result->pk_columns);
63
+ deserializer.ReadProperty("fk_columns", result->fk_columns);
64
+ deserializer.ReadProperty("type", result->info.type);
65
+ deserializer.ReadProperty("schema", result->info.schema);
66
+ deserializer.ReadProperty("table", result->info.table);
67
+ deserializer.ReadProperty("pk_keys", result->info.pk_keys);
68
+ deserializer.ReadProperty("fk_keys", result->info.fk_keys);
69
+ return std::move(result);
70
+ }
71
+
72
+ void NotNullConstraint::FormatSerialize(FormatSerializer &serializer) const {
73
+ Constraint::FormatSerialize(serializer);
74
+ serializer.WriteProperty("index", index);
75
+ }
76
+
77
+ unique_ptr<Constraint> NotNullConstraint::FormatDeserialize(FormatDeserializer &deserializer) {
78
+ auto index = deserializer.ReadProperty<LogicalIndex>("index");
79
+ auto result = duckdb::unique_ptr<NotNullConstraint>(new NotNullConstraint(index));
80
+ return std::move(result);
81
+ }
82
+
83
+ void UniqueConstraint::FormatSerialize(FormatSerializer &serializer) const {
84
+ Constraint::FormatSerialize(serializer);
85
+ serializer.WriteProperty("is_primary_key", is_primary_key);
86
+ serializer.WriteProperty("index", index);
87
+ serializer.WriteProperty("columns", columns);
88
+ }
89
+
90
+ unique_ptr<Constraint> UniqueConstraint::FormatDeserialize(FormatDeserializer &deserializer) {
91
+ auto result = duckdb::unique_ptr<UniqueConstraint>(new UniqueConstraint());
92
+ deserializer.ReadProperty("is_primary_key", result->is_primary_key);
93
+ deserializer.ReadProperty("index", result->index);
94
+ deserializer.ReadProperty("columns", result->columns);
95
+ return std::move(result);
96
+ }
97
+
98
+ } // namespace duckdb
@@ -0,0 +1,188 @@
1
+ //===----------------------------------------------------------------------===//
2
+ // This file is automatically generated by scripts/generate_serialization.py
3
+ // Do not edit this file manually, your changes will be overwritten
4
+ //===----------------------------------------------------------------------===//
5
+
6
+ #include "duckdb/common/serializer/format_serializer.hpp"
7
+ #include "duckdb/common/serializer/format_deserializer.hpp"
8
+ #include "duckdb/parser/parsed_data/create_info.hpp"
9
+ #include "duckdb/parser/parsed_data/create_index_info.hpp"
10
+ #include "duckdb/parser/parsed_data/create_table_info.hpp"
11
+ #include "duckdb/parser/parsed_data/create_schema_info.hpp"
12
+ #include "duckdb/parser/parsed_data/create_view_info.hpp"
13
+ #include "duckdb/parser/parsed_data/create_type_info.hpp"
14
+ #include "duckdb/parser/parsed_data/create_macro_info.hpp"
15
+ #include "duckdb/parser/parsed_data/create_sequence_info.hpp"
16
+
17
+ namespace duckdb {
18
+
19
+ void CreateInfo::FormatSerialize(FormatSerializer &serializer) const {
20
+ serializer.WriteProperty("type", type);
21
+ serializer.WriteProperty("catalog", catalog);
22
+ serializer.WriteProperty("schema", schema);
23
+ serializer.WriteProperty("temporary", temporary);
24
+ serializer.WriteProperty("internal", internal);
25
+ serializer.WriteProperty("on_conflict", on_conflict);
26
+ serializer.WriteProperty("sql", sql);
27
+ }
28
+
29
+ unique_ptr<CreateInfo> CreateInfo::FormatDeserialize(FormatDeserializer &deserializer) {
30
+ auto type = deserializer.ReadProperty<CatalogType>("type");
31
+ auto catalog = deserializer.ReadProperty<string>("catalog");
32
+ auto schema = deserializer.ReadProperty<string>("schema");
33
+ auto temporary = deserializer.ReadProperty<bool>("temporary");
34
+ auto internal = deserializer.ReadProperty<bool>("internal");
35
+ auto on_conflict = deserializer.ReadProperty<OnCreateConflict>("on_conflict");
36
+ auto sql = deserializer.ReadProperty<string>("sql");
37
+ unique_ptr<CreateInfo> result;
38
+ switch (type) {
39
+ case CatalogType::INDEX_ENTRY:
40
+ result = CreateIndexInfo::FormatDeserialize(deserializer);
41
+ break;
42
+ case CatalogType::MACRO_ENTRY:
43
+ result = CreateMacroInfo::FormatDeserialize(deserializer);
44
+ break;
45
+ case CatalogType::SCHEMA_ENTRY:
46
+ result = CreateSchemaInfo::FormatDeserialize(deserializer);
47
+ break;
48
+ case CatalogType::SEQUENCE_ENTRY:
49
+ result = CreateSequenceInfo::FormatDeserialize(deserializer);
50
+ break;
51
+ case CatalogType::TABLE_ENTRY:
52
+ result = CreateTableInfo::FormatDeserialize(deserializer);
53
+ break;
54
+ case CatalogType::TABLE_MACRO_ENTRY:
55
+ result = CreateMacroInfo::FormatDeserialize(deserializer);
56
+ break;
57
+ case CatalogType::TYPE_ENTRY:
58
+ result = CreateTypeInfo::FormatDeserialize(deserializer);
59
+ break;
60
+ case CatalogType::VIEW_ENTRY:
61
+ result = CreateViewInfo::FormatDeserialize(deserializer);
62
+ break;
63
+ default:
64
+ throw SerializationException("Unsupported type for deserialization of CreateInfo!");
65
+ }
66
+ result->catalog = std::move(catalog);
67
+ result->schema = std::move(schema);
68
+ result->temporary = temporary;
69
+ result->internal = internal;
70
+ result->on_conflict = on_conflict;
71
+ result->sql = std::move(sql);
72
+ return result;
73
+ }
74
+
75
+ void CreateIndexInfo::FormatSerialize(FormatSerializer &serializer) const {
76
+ CreateInfo::FormatSerialize(serializer);
77
+ serializer.WriteProperty("name", index_name);
78
+ serializer.WriteProperty("index_type", index_type);
79
+ serializer.WriteProperty("constraint_type", constraint_type);
80
+ serializer.WriteProperty("parsed_expressions", parsed_expressions);
81
+ serializer.WriteProperty("names", names);
82
+ serializer.WriteProperty("column_ids", column_ids);
83
+ }
84
+
85
+ unique_ptr<CreateInfo> CreateIndexInfo::FormatDeserialize(FormatDeserializer &deserializer) {
86
+ auto result = duckdb::unique_ptr<CreateIndexInfo>(new CreateIndexInfo());
87
+ deserializer.ReadProperty("name", result->index_name);
88
+ deserializer.ReadProperty("index_type", result->index_type);
89
+ deserializer.ReadProperty("constraint_type", result->constraint_type);
90
+ deserializer.ReadProperty("parsed_expressions", result->parsed_expressions);
91
+ deserializer.ReadProperty("names", result->names);
92
+ deserializer.ReadProperty("column_ids", result->column_ids);
93
+ return std::move(result);
94
+ }
95
+
96
+ void CreateMacroInfo::FormatSerialize(FormatSerializer &serializer) const {
97
+ CreateInfo::FormatSerialize(serializer);
98
+ serializer.WriteProperty("name", name);
99
+ serializer.WriteProperty("function", *function);
100
+ }
101
+
102
+ unique_ptr<CreateInfo> CreateMacroInfo::FormatDeserialize(FormatDeserializer &deserializer) {
103
+ auto result = duckdb::unique_ptr<CreateMacroInfo>(new CreateMacroInfo());
104
+ deserializer.ReadProperty("name", result->name);
105
+ deserializer.ReadProperty("function", result->function);
106
+ return std::move(result);
107
+ }
108
+
109
+ void CreateSchemaInfo::FormatSerialize(FormatSerializer &serializer) const {
110
+ CreateInfo::FormatSerialize(serializer);
111
+ }
112
+
113
+ unique_ptr<CreateInfo> CreateSchemaInfo::FormatDeserialize(FormatDeserializer &deserializer) {
114
+ auto result = duckdb::unique_ptr<CreateSchemaInfo>(new CreateSchemaInfo());
115
+ return std::move(result);
116
+ }
117
+
118
+ void CreateSequenceInfo::FormatSerialize(FormatSerializer &serializer) const {
119
+ CreateInfo::FormatSerialize(serializer);
120
+ serializer.WriteProperty("name", name);
121
+ serializer.WriteProperty("usage_count", usage_count);
122
+ serializer.WriteProperty("increment", increment);
123
+ serializer.WriteProperty("min_value", min_value);
124
+ serializer.WriteProperty("max_value", max_value);
125
+ serializer.WriteProperty("start_value", start_value);
126
+ serializer.WriteProperty("cycle", cycle);
127
+ }
128
+
129
+ unique_ptr<CreateInfo> CreateSequenceInfo::FormatDeserialize(FormatDeserializer &deserializer) {
130
+ auto result = duckdb::unique_ptr<CreateSequenceInfo>(new CreateSequenceInfo());
131
+ deserializer.ReadProperty("name", result->name);
132
+ deserializer.ReadProperty("usage_count", result->usage_count);
133
+ deserializer.ReadProperty("increment", result->increment);
134
+ deserializer.ReadProperty("min_value", result->min_value);
135
+ deserializer.ReadProperty("max_value", result->max_value);
136
+ deserializer.ReadProperty("start_value", result->start_value);
137
+ deserializer.ReadProperty("cycle", result->cycle);
138
+ return std::move(result);
139
+ }
140
+
141
+ void CreateTableInfo::FormatSerialize(FormatSerializer &serializer) const {
142
+ CreateInfo::FormatSerialize(serializer);
143
+ serializer.WriteProperty("table", table);
144
+ serializer.WriteProperty("columns", columns);
145
+ serializer.WriteProperty("constraints", constraints);
146
+ serializer.WriteOptionalProperty("query", query);
147
+ }
148
+
149
+ unique_ptr<CreateInfo> CreateTableInfo::FormatDeserialize(FormatDeserializer &deserializer) {
150
+ auto result = duckdb::unique_ptr<CreateTableInfo>(new CreateTableInfo());
151
+ deserializer.ReadProperty("table", result->table);
152
+ deserializer.ReadProperty("columns", result->columns);
153
+ deserializer.ReadProperty("constraints", result->constraints);
154
+ deserializer.ReadOptionalProperty("query", result->query);
155
+ return std::move(result);
156
+ }
157
+
158
+ void CreateTypeInfo::FormatSerialize(FormatSerializer &serializer) const {
159
+ CreateInfo::FormatSerialize(serializer);
160
+ serializer.WriteProperty("name", name);
161
+ serializer.WriteProperty("type", type);
162
+ }
163
+
164
+ unique_ptr<CreateInfo> CreateTypeInfo::FormatDeserialize(FormatDeserializer &deserializer) {
165
+ auto result = duckdb::unique_ptr<CreateTypeInfo>(new CreateTypeInfo());
166
+ deserializer.ReadProperty("name", result->name);
167
+ deserializer.ReadProperty("type", result->type);
168
+ return std::move(result);
169
+ }
170
+
171
+ void CreateViewInfo::FormatSerialize(FormatSerializer &serializer) const {
172
+ CreateInfo::FormatSerialize(serializer);
173
+ serializer.WriteProperty("view_name", view_name);
174
+ serializer.WriteProperty("aliases", aliases);
175
+ serializer.WriteProperty("types", types);
176
+ serializer.WriteOptionalProperty("query", query);
177
+ }
178
+
179
+ unique_ptr<CreateInfo> CreateViewInfo::FormatDeserialize(FormatDeserializer &deserializer) {
180
+ auto result = duckdb::unique_ptr<CreateViewInfo>(new CreateViewInfo());
181
+ deserializer.ReadProperty("view_name", result->view_name);
182
+ deserializer.ReadProperty("aliases", result->aliases);
183
+ deserializer.ReadProperty("types", result->types);
184
+ deserializer.ReadOptionalProperty("query", result->query);
185
+ return std::move(result);
186
+ }
187
+
188
+ } // namespace duckdb