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
@@ -1,7 +1,7 @@
1
1
  //===----------------------------------------------------------------------===//
2
2
  // DuckDB
3
3
  //
4
- // duckdb/parser/parsed_data/vacuum_info.hpp
4
+ // duckdb/parser/parsed_data/load_info.hpp
5
5
  //
6
6
  //
7
7
  //===----------------------------------------------------------------------===//
@@ -13,10 +13,17 @@
13
13
 
14
14
  namespace duckdb {
15
15
 
16
- enum class LoadType { LOAD, INSTALL, FORCE_INSTALL };
16
+ enum class LoadType : uint8_t { LOAD, INSTALL, FORCE_INSTALL };
17
17
 
18
18
  struct LoadInfo : public ParseInfo {
19
- std::string filename;
19
+ public:
20
+ static constexpr const ParseInfoType TYPE = ParseInfoType::LOAD_INFO;
21
+
22
+ public:
23
+ LoadInfo() : ParseInfo(TYPE) {
24
+ }
25
+
26
+ string filename;
20
27
  LoadType load_type;
21
28
 
22
29
  public:
@@ -42,6 +49,9 @@ public:
42
49
  reader.Finalize();
43
50
  return std::move(load_info);
44
51
  }
52
+
53
+ void FormatSerialize(FormatSerializer &serializer) const override;
54
+ static unique_ptr<ParseInfo> FormatDeserialize(FormatDeserializer &deserializer);
45
55
  };
46
56
 
47
57
  } // namespace duckdb
@@ -12,10 +12,29 @@
12
12
 
13
13
  namespace duckdb {
14
14
 
15
+ enum class ParseInfoType : uint8_t {
16
+ ALTER_INFO,
17
+ ATTACH_INFO,
18
+ COPY_INFO,
19
+ CREATE_INFO,
20
+ DETACH_INFO,
21
+ DROP_INFO,
22
+ BOUND_EXPORT_DATA,
23
+ LOAD_INFO,
24
+ PRAGMA_INFO,
25
+ SHOW_SELECT_INFO,
26
+ TRANSACTION_INFO,
27
+ VACUUM_INFO
28
+ };
29
+
15
30
  struct ParseInfo {
31
+ explicit ParseInfo(ParseInfoType info_type) : info_type(info_type) {
32
+ }
16
33
  virtual ~ParseInfo() {
17
34
  }
18
35
 
36
+ ParseInfoType info_type;
37
+
19
38
  public:
20
39
  template <class TARGET>
21
40
  TARGET &Cast() {
@@ -28,6 +47,9 @@ public:
28
47
  D_ASSERT(dynamic_cast<const TARGET *>(this));
29
48
  return reinterpret_cast<const TARGET &>(*this);
30
49
  }
50
+
51
+ virtual void FormatSerialize(FormatSerializer &serializer) const;
52
+ static unique_ptr<ParseInfo> FormatDeserialize(FormatDeserializer &deserializer);
31
53
  };
32
54
 
33
55
  } // namespace duckdb
@@ -18,6 +18,13 @@ namespace duckdb {
18
18
  enum class PragmaType : uint8_t { PRAGMA_STATEMENT, PRAGMA_CALL };
19
19
 
20
20
  struct PragmaInfo : public ParseInfo {
21
+ public:
22
+ static constexpr const ParseInfoType TYPE = ParseInfoType::PRAGMA_INFO;
23
+
24
+ public:
25
+ PragmaInfo() : ParseInfo(TYPE) {
26
+ }
27
+
21
28
  //! Name of the PRAGMA statement
22
29
  string name;
23
30
  //! Parameter list (if any)
@@ -33,6 +40,9 @@ public:
33
40
  result->named_parameters = named_parameters;
34
41
  return result;
35
42
  }
43
+
44
+ void FormatSerialize(FormatSerializer &serializer) const override;
45
+ static unique_ptr<ParseInfo> FormatDeserialize(FormatDeserializer &deserializer);
36
46
  };
37
47
 
38
48
  } // namespace duckdb
@@ -14,6 +14,13 @@
14
14
  namespace duckdb {
15
15
 
16
16
  struct ShowSelectInfo : public ParseInfo {
17
+ public:
18
+ static constexpr const ParseInfoType TYPE = ParseInfoType::SHOW_SELECT_INFO;
19
+
20
+ public:
21
+ ShowSelectInfo() : ParseInfo(TYPE) {
22
+ }
23
+
17
24
  //! Types of projected columns
18
25
  vector<LogicalType> types;
19
26
  //! The QueryNode of select query
@@ -15,6 +15,10 @@ namespace duckdb {
15
15
  enum class TransactionType : uint8_t { INVALID, BEGIN_TRANSACTION, COMMIT, ROLLBACK };
16
16
 
17
17
  struct TransactionInfo : public ParseInfo {
18
+ public:
19
+ static constexpr const ParseInfoType TYPE = ParseInfoType::TRANSACTION_INFO;
20
+
21
+ public:
18
22
  explicit TransactionInfo(TransactionType type);
19
23
 
20
24
  //! The type of transaction statement
@@ -23,6 +27,12 @@ struct TransactionInfo : public ParseInfo {
23
27
  public:
24
28
  void Serialize(Serializer &serializer) const;
25
29
  static unique_ptr<ParseInfo> Deserialize(Deserializer &deserializer);
30
+
31
+ void FormatSerialize(FormatSerializer &serializer) const override;
32
+ static unique_ptr<ParseInfo> FormatDeserialize(FormatDeserializer &deserializer);
33
+
34
+ private:
35
+ TransactionInfo();
26
36
  };
27
37
 
28
38
  } // namespace duckdb
@@ -15,6 +15,8 @@
15
15
  #include "duckdb/common/optional_ptr.hpp"
16
16
 
17
17
  namespace duckdb {
18
+ class FormatSerializer;
19
+ class FormatDeserializer;
18
20
 
19
21
  struct VacuumOptions {
20
22
  VacuumOptions() : vacuum(false), analyze(false) {
@@ -22,9 +24,15 @@ struct VacuumOptions {
22
24
 
23
25
  bool vacuum;
24
26
  bool analyze;
27
+
28
+ void FormatSerialize(FormatSerializer &serializer) const;
29
+ static VacuumOptions FormatDeserialize(FormatDeserializer &deserializer);
25
30
  };
26
31
 
27
32
  struct VacuumInfo : public ParseInfo {
33
+ public:
34
+ static constexpr const ParseInfoType TYPE = ParseInfoType::VACUUM_INFO;
35
+
28
36
  public:
29
37
  explicit VacuumInfo(VacuumOptions options);
30
38
 
@@ -42,6 +50,8 @@ public:
42
50
 
43
51
  void Serialize(Serializer &serializer) const;
44
52
  static unique_ptr<ParseInfo> Deserialize(Deserializer &deserializer);
53
+ void FormatSerialize(FormatSerializer &serializer) const override;
54
+ static unique_ptr<ParseInfo> FormatDeserialize(FormatDeserializer &deserializer);
45
55
  };
46
56
 
47
57
  } // namespace duckdb
@@ -21,14 +21,6 @@ public:
21
21
  virtual ~BoundConstraint() {
22
22
  }
23
23
 
24
- void Serialize(Serializer &serializer) const {
25
- serializer.Write(type);
26
- }
27
-
28
- static unique_ptr<BoundConstraint> Deserialize(Deserializer &source) {
29
- return make_uniq<BoundConstraint>(source.Read<ConstraintType>());
30
- }
31
-
32
24
  ConstraintType type;
33
25
 
34
26
  public:
@@ -63,6 +63,9 @@ public:
63
63
 
64
64
  void Serialize(Serializer &serializer) const;
65
65
  static BoundOrderByNode Deserialize(Deserializer &source, PlanDeserializationState &state);
66
+
67
+ void FormatSerialize(FormatSerializer &serializer) const;
68
+ static BoundOrderByNode FormatDeserialize(FormatDeserializer &deserializer);
66
69
  };
67
70
 
68
71
  class BoundLimitModifier : public BoundResultModifier {
@@ -98,6 +101,9 @@ public:
98
101
 
99
102
  void Serialize(Serializer &serializer) const;
100
103
  static unique_ptr<BoundOrderModifier> Deserialize(Deserializer &source, PlanDeserializationState &state);
104
+
105
+ void FormatSerialize(FormatSerializer &serializer) const;
106
+ static unique_ptr<BoundOrderModifier> FormatDeserialize(FormatDeserializer &deserializer);
101
107
  };
102
108
 
103
109
  enum class DistinctType : uint8_t { DISTINCT = 0, DISTINCT_ON = 1 };
@@ -14,6 +14,8 @@
14
14
  #include <functional>
15
15
 
16
16
  namespace duckdb {
17
+ class FormatSerializer;
18
+ class FormatDeserializer;
17
19
 
18
20
  struct ColumnBinding {
19
21
  idx_t table_index;
@@ -36,6 +38,9 @@ struct ColumnBinding {
36
38
  bool operator!=(const ColumnBinding &rhs) const {
37
39
  return !(*this == rhs);
38
40
  }
41
+
42
+ void FormatSerialize(FormatSerializer &serializer) const;
43
+ static ColumnBinding FormatDeserialize(FormatDeserializer &deserializer);
39
44
  };
40
45
 
41
46
  } // namespace duckdb
@@ -35,6 +35,9 @@ public:
35
35
  void Serialize(FieldWriter &writer) const override;
36
36
  static unique_ptr<Expression> Deserialize(ExpressionDeserializationState &state, FieldReader &reader);
37
37
 
38
+ void FormatSerialize(FormatSerializer &serializer) const override;
39
+ static unique_ptr<Expression> FormatDeserialize(FormatDeserializer &deserializer);
40
+
38
41
  public:
39
42
  ExpressionType LowerComparisonType() {
40
43
  return lower_inclusive ? ExpressionType::COMPARE_GREATERTHANOREQUALTO : ExpressionType::COMPARE_GREATERTHAN;
@@ -42,5 +45,8 @@ public:
42
45
  ExpressionType UpperComparisonType() {
43
46
  return upper_inclusive ? ExpressionType::COMPARE_LESSTHANOREQUALTO : ExpressionType::COMPARE_LESSTHAN;
44
47
  }
48
+
49
+ private:
50
+ BoundBetweenExpression();
45
51
  };
46
52
  } // namespace duckdb
@@ -18,6 +18,9 @@ struct BoundCaseCheck {
18
18
 
19
19
  void Serialize(Serializer &serializer) const;
20
20
  static BoundCaseCheck Deserialize(Deserializer &source, PlanDeserializationState &state);
21
+
22
+ void FormatSerialize(FormatSerializer &serializer) const;
23
+ static BoundCaseCheck FormatDeserialize(FormatDeserializer &deserializer);
21
24
  };
22
25
 
23
26
  class BoundCaseExpression : public Expression {
@@ -41,5 +44,8 @@ public:
41
44
 
42
45
  void Serialize(FieldWriter &writer) const override;
43
46
  static unique_ptr<Expression> Deserialize(ExpressionDeserializationState &state, FieldReader &reader);
47
+
48
+ void FormatSerialize(FormatSerializer &serializer) const override;
49
+ static unique_ptr<Expression> FormatDeserialize(FormatDeserializer &deserializer);
44
50
  };
45
51
  } // namespace duckdb
@@ -52,5 +52,11 @@ public:
52
52
 
53
53
  void Serialize(FieldWriter &writer) const override;
54
54
  static unique_ptr<Expression> Deserialize(ExpressionDeserializationState &state, FieldReader &reader);
55
+
56
+ void FormatSerialize(FormatSerializer &serializer) const override;
57
+ static unique_ptr<Expression> FormatDeserialize(FormatDeserializer &deserializer);
58
+
59
+ private:
60
+ BoundCastExpression(ClientContext &context, unique_ptr<Expression> child, LogicalType target_type);
55
61
  };
56
62
  } // namespace duckdb
@@ -51,5 +51,8 @@ public:
51
51
 
52
52
  void Serialize(FieldWriter &writer) const override;
53
53
  static unique_ptr<Expression> Deserialize(ExpressionDeserializationState &state, FieldReader &reader);
54
+
55
+ void FormatSerialize(FormatSerializer &serializer) const override;
56
+ static unique_ptr<Expression> FormatDeserialize(FormatDeserializer &deserializer);
54
57
  };
55
58
  } // namespace duckdb
@@ -31,6 +31,9 @@ public:
31
31
  void Serialize(FieldWriter &writer) const override;
32
32
  static unique_ptr<Expression> Deserialize(ExpressionDeserializationState &state, FieldReader &reader);
33
33
 
34
+ void FormatSerialize(FormatSerializer &serializer) const override;
35
+ static unique_ptr<Expression> FormatDeserialize(FormatDeserializer &deserializer);
36
+
34
37
  public:
35
38
  static LogicalType BindComparison(LogicalType left_type, LogicalType right_type);
36
39
  };
@@ -33,5 +33,8 @@ public:
33
33
 
34
34
  void Serialize(FieldWriter &writer) const override;
35
35
  static unique_ptr<Expression> Deserialize(ExpressionDeserializationState &state, FieldReader &reader);
36
+
37
+ void FormatSerialize(FormatSerializer &serializer) const override;
38
+ static unique_ptr<Expression> FormatDeserialize(FormatDeserializer &deserializer);
36
39
  };
37
40
  } // namespace duckdb
@@ -32,5 +32,8 @@ public:
32
32
 
33
33
  void Serialize(FieldWriter &writer) const override;
34
34
  static unique_ptr<Expression> Deserialize(ExpressionDeserializationState &state, FieldReader &reader);
35
+
36
+ void FormatSerialize(FormatSerializer &serializer) const override;
37
+ static unique_ptr<Expression> FormatDeserialize(FormatDeserializer &deserializer);
35
38
  };
36
39
  } // namespace duckdb
@@ -39,5 +39,8 @@ public:
39
39
 
40
40
  void Serialize(FieldWriter &writer) const override;
41
41
  static unique_ptr<Expression> Deserialize(ExpressionDeserializationState &state, FieldReader &reader);
42
+
43
+ void FormatSerialize(FormatSerializer &serializer) const override;
44
+ static unique_ptr<Expression> FormatDeserialize(FormatDeserializer &deserializer);
42
45
  };
43
46
  } // namespace duckdb
@@ -33,6 +33,8 @@ public:
33
33
  unique_ptr<Expression> Copy() override;
34
34
 
35
35
  void Serialize(FieldWriter &writer) const override;
36
- static unique_ptr<Expression> Deserialize(ExpressionDeserializationState &state, FieldReader &reader);
36
+
37
+ void FormatSerialize(FormatSerializer &serializer) const override;
38
+ static unique_ptr<Expression> FormatDeserialize(FormatDeserializer &deserializer);
37
39
  };
38
40
  } // namespace duckdb
@@ -53,5 +53,8 @@ public:
53
53
 
54
54
  void Serialize(FieldWriter &writer) const override;
55
55
  static unique_ptr<Expression> Deserialize(ExpressionDeserializationState &state, FieldReader &reader);
56
+
57
+ void FormatSerialize(FormatSerializer &serializer) const override;
58
+ static unique_ptr<Expression> FormatDeserialize(FormatDeserializer &deserializer);
56
59
  };
57
60
  } // namespace duckdb
@@ -30,5 +30,8 @@ public:
30
30
 
31
31
  void Serialize(FieldWriter &writer) const override;
32
32
  static unique_ptr<Expression> Deserialize(ExpressionDeserializationState &state, FieldReader &reader);
33
+
34
+ void FormatSerialize(FormatSerializer &serializer) const override;
35
+ static unique_ptr<Expression> FormatDeserialize(FormatDeserializer &deserializer);
33
36
  };
34
37
  } // namespace duckdb
@@ -17,7 +17,7 @@ namespace duckdb {
17
17
  struct BoundParameterData {
18
18
  BoundParameterData() {
19
19
  }
20
- BoundParameterData(Value val) : value(std::move(val)), return_type(value.type()) {
20
+ explicit BoundParameterData(Value val) : value(std::move(val)), return_type(value.type()) {
21
21
  }
22
22
 
23
23
  Value value;
@@ -39,10 +39,13 @@ public:
39
39
  reader.Finalize();
40
40
  return result;
41
41
  }
42
+
43
+ void FormatSerialize(FormatSerializer &serializer) const;
44
+ static shared_ptr<BoundParameterData> FormatDeserialize(FormatDeserializer &deserializer);
42
45
  };
43
46
 
44
47
  struct BoundParameterMap {
45
- BoundParameterMap(vector<BoundParameterData> &parameter_data) : parameter_data(parameter_data) {
48
+ explicit BoundParameterMap(vector<BoundParameterData> &parameter_data) : parameter_data(parameter_data) {
46
49
  }
47
50
 
48
51
  bound_parameter_map_t parameters;
@@ -42,6 +42,13 @@ public:
42
42
 
43
43
  void Serialize(FieldWriter &writer) const override;
44
44
  static unique_ptr<Expression> Deserialize(ExpressionDeserializationState &state, FieldReader &reader);
45
+
46
+ void FormatSerialize(FormatSerializer &serializer) const override;
47
+ static unique_ptr<Expression> FormatDeserialize(FormatDeserializer &deserializer);
48
+
49
+ private:
50
+ BoundParameterExpression(bound_parameter_map_t &global_parameter_set, idx_t parameter_nr, LogicalType return_type,
51
+ shared_ptr<BoundParameterData> parameter_data);
45
52
  };
46
53
 
47
54
  } // namespace duckdb
@@ -41,5 +41,8 @@ public:
41
41
 
42
42
  void Serialize(FieldWriter &writer) const override;
43
43
  static unique_ptr<Expression> Deserialize(ExpressionDeserializationState &state, FieldReader &reader);
44
+
45
+ void FormatSerialize(FormatSerializer &serializer) const override;
46
+ static unique_ptr<Expression> FormatDeserialize(FormatDeserializer &deserializer);
44
47
  };
45
48
  } // namespace duckdb
@@ -33,5 +33,8 @@ public:
33
33
 
34
34
  void Serialize(FieldWriter &writer) const override;
35
35
  static unique_ptr<Expression> Deserialize(ExpressionDeserializationState &state, FieldReader &reader);
36
+
37
+ void FormatSerialize(FormatSerializer &serializer) const override;
38
+ static unique_ptr<Expression> FormatDeserialize(FormatDeserializer &deserializer);
36
39
  };
37
40
  } // namespace duckdb
@@ -9,6 +9,7 @@
9
9
  #include "duckdb/planner/expression/bound_default_expression.hpp"
10
10
  #include "duckdb/planner/expression/bound_function_expression.hpp"
11
11
  #include "duckdb/planner/expression/bound_lambda_expression.hpp"
12
+ #include "duckdb/planner/expression/bound_lambdaref_expression.hpp"
12
13
  #include "duckdb/planner/expression/bound_operator_expression.hpp"
13
14
  #include "duckdb/planner/expression/bound_parameter_expression.hpp"
14
15
  #include "duckdb/planner/expression/bound_reference_expression.hpp"
@@ -64,6 +64,9 @@ public:
64
64
  //! SerializationException]
65
65
  static unique_ptr<Expression> Deserialize(Deserializer &source, PlanDeserializationState &state);
66
66
 
67
+ virtual void FormatSerialize(FormatSerializer &serializer) const;
68
+ static unique_ptr<Expression> FormatDeserialize(FormatDeserializer &deserializer);
69
+
67
70
  protected:
68
71
  //! Copy base Expression properties from another expression to this one,
69
72
  //! used in Copy method
@@ -29,6 +29,9 @@ public:
29
29
  //! Deserializes a blob back into a JoinCondition
30
30
  static JoinCondition Deserialize(Deserializer &source, PlanDeserializationState &state);
31
31
 
32
+ void FormatSerialize(FormatSerializer &serializer) const;
33
+ static JoinCondition FormatDeserialize(FormatDeserializer &deserializer);
34
+
32
35
  public:
33
36
  unique_ptr<Expression> left;
34
37
  unique_ptr<Expression> right;
@@ -77,6 +77,9 @@ public:
77
77
 
78
78
  static unique_ptr<LogicalOperator> Deserialize(Deserializer &deserializer, PlanDeserializationState &state);
79
79
 
80
+ virtual void FormatSerialize(FormatSerializer &serializer) const;
81
+ static unique_ptr<LogicalOperator> FormatDeserialize(FormatDeserializer &deserializer);
82
+
80
83
  virtual unique_ptr<LogicalOperator> Copy(ClientContext &context) const;
81
84
 
82
85
  virtual bool RequireOptimizer() const {
@@ -45,6 +45,9 @@ public:
45
45
  vector<ColumnBinding> GetColumnBindings() override;
46
46
  void Serialize(FieldWriter &writer) const override;
47
47
  static unique_ptr<LogicalOperator> Deserialize(LogicalDeserializationState &state, FieldReader &reader);
48
+
49
+ void FormatSerialize(FormatSerializer &serializer) const override;
50
+ static unique_ptr<LogicalOperator> FormatDeserialize(FormatDeserializer &deserializer);
48
51
  idx_t EstimateCardinality(ClientContext &context) override;
49
52
  vector<idx_t> GetTableIndex() const override;
50
53
  string GetName() const override;
@@ -28,6 +28,9 @@ public:
28
28
  string ParamsToString() const override;
29
29
  void Serialize(FieldWriter &writer) const override;
30
30
  static unique_ptr<LogicalOperator> Deserialize(LogicalDeserializationState &state, FieldReader &reader);
31
+
32
+ void FormatSerialize(FormatSerializer &serializer) const override;
33
+ static unique_ptr<LogicalOperator> FormatDeserialize(FormatDeserializer &deserializer);
31
34
  };
32
35
 
33
36
  } // namespace duckdb
@@ -33,6 +33,10 @@ public:
33
33
 
34
34
  void Serialize(FieldWriter &writer) const override;
35
35
  static unique_ptr<LogicalOperator> Deserialize(LogicalDeserializationState &state, FieldReader &reader);
36
+
37
+ void FormatSerialize(FormatSerializer &serializer) const override;
38
+ static unique_ptr<LogicalOperator> FormatDeserialize(FormatDeserializer &deserializer);
39
+
36
40
  vector<idx_t> GetTableIndex() const override;
37
41
  string GetName() const override;
38
42
 
@@ -15,6 +15,7 @@
15
15
  #include "duckdb/planner/operator/logical_join.hpp"
16
16
 
17
17
  namespace duckdb {
18
+ class LogicalDelimJoin;
18
19
 
19
20
  //! LogicalComparisonJoin represents a join that involves comparisons between the LHS and RHS
20
21
  class LogicalComparisonJoin : public LogicalJoin {
@@ -27,8 +28,8 @@ public:
27
28
 
28
29
  //! The conditions of the join
29
30
  vector<JoinCondition> conditions;
30
- //! Used for duplicate-eliminated joins
31
- vector<LogicalType> delim_types;
31
+ //! Used for duplicate-eliminated MARK joins
32
+ vector<LogicalType> mark_types;
32
33
 
33
34
  public:
34
35
  string ParamsToString() const override;
@@ -37,6 +38,12 @@ public:
37
38
  static void Deserialize(LogicalComparisonJoin &comparison_join, LogicalDeserializationState &state,
38
39
  FieldReader &reader);
39
40
 
41
+ void FormatSerialize(FormatSerializer &serializer) const override;
42
+ static unique_ptr<LogicalOperator> FormatDeserialize(FormatDeserializer &deserializer);
43
+
44
+ //! Turn a delim join into a regular comparison join (after all required delim scans have been pruned)
45
+ static unique_ptr<LogicalOperator> FromDelimJoin(LogicalDelimJoin &join);
46
+
40
47
  public:
41
48
  static unique_ptr<LogicalOperator> CreateJoin(ClientContext &context, JoinType type, JoinRefType ref_type,
42
49
  unique_ptr<LogicalOperator> left_child,
@@ -20,9 +20,7 @@ public:
20
20
 
21
21
  public:
22
22
  LogicalCreate(LogicalOperatorType type, unique_ptr<CreateInfo> info,
23
- optional_ptr<SchemaCatalogEntry> schema = nullptr)
24
- : LogicalOperator(type), schema(schema), info(std::move(info)) {
25
- }
23
+ optional_ptr<SchemaCatalogEntry> schema = nullptr);
26
24
 
27
25
  optional_ptr<SchemaCatalogEntry> schema;
28
26
  unique_ptr<CreateInfo> info;
@@ -30,11 +28,16 @@ public:
30
28
  public:
31
29
  void Serialize(FieldWriter &writer) const override;
32
30
  static unique_ptr<LogicalOperator> Deserialize(LogicalDeserializationState &state, FieldReader &reader);
31
+
32
+ void FormatSerialize(FormatSerializer &serializer) const override;
33
+ static unique_ptr<LogicalOperator> FormatDeserialize(FormatDeserializer &deserializer);
34
+
33
35
  idx_t EstimateCardinality(ClientContext &context) override;
34
36
 
35
37
  protected:
36
- void ResolveTypes() override {
37
- types.emplace_back(LogicalType::BIGINT);
38
- }
38
+ void ResolveTypes() override;
39
+
40
+ private:
41
+ LogicalCreate(LogicalOperatorType type, ClientContext &context, unique_ptr<CreateInfo> info);
39
42
  };
40
43
  } // namespace duckdb
@@ -21,19 +21,7 @@ public:
21
21
  public:
22
22
  LogicalCreateIndex(unique_ptr<FunctionData> bind_data_p, unique_ptr<CreateIndexInfo> info_p,
23
23
  vector<unique_ptr<Expression>> expressions_p, TableCatalogEntry &table_p,
24
- TableFunction function_p)
25
- : LogicalOperator(LogicalOperatorType::LOGICAL_CREATE_INDEX), bind_data(std::move(bind_data_p)),
26
- info(std::move(info_p)), table(table_p), function(std::move(function_p)) {
27
-
28
- for (auto &expr : expressions_p) {
29
- this->unbound_expressions.push_back(expr->Copy());
30
- }
31
- this->expressions = std::move(expressions_p);
32
-
33
- if (info->column_ids.empty()) {
34
- throw BinderException("CREATE INDEX does not refer to any columns in the base table!");
35
- }
36
- }
24
+ TableFunction function_p);
37
25
 
38
26
  //! The bind data of the function
39
27
  unique_ptr<FunctionData> bind_data;
@@ -53,8 +41,6 @@ public:
53
41
  static unique_ptr<LogicalOperator> Deserialize(LogicalDeserializationState &state, FieldReader &reader);
54
42
 
55
43
  protected:
56
- void ResolveTypes() override {
57
- types.emplace_back(LogicalType::BIGINT);
58
- }
44
+ void ResolveTypes() override;
59
45
  };
60
46
  } // namespace duckdb
@@ -18,9 +18,7 @@ public:
18
18
  static constexpr const LogicalOperatorType TYPE = LogicalOperatorType::LOGICAL_CREATE_TABLE;
19
19
 
20
20
  public:
21
- LogicalCreateTable(SchemaCatalogEntry &schema, unique_ptr<BoundCreateTableInfo> info)
22
- : LogicalOperator(LogicalOperatorType::LOGICAL_CREATE_TABLE), schema(schema), info(std::move(info)) {
23
- }
21
+ LogicalCreateTable(SchemaCatalogEntry &schema, unique_ptr<BoundCreateTableInfo> info);
24
22
 
25
23
  //! Schema to insert to
26
24
  SchemaCatalogEntry &schema;
@@ -30,11 +28,17 @@ public:
30
28
  public:
31
29
  void Serialize(FieldWriter &writer) const override;
32
30
  static unique_ptr<LogicalOperator> Deserialize(LogicalDeserializationState &state, FieldReader &reader);
31
+
32
+ void FormatSerialize(FormatSerializer &serializer) const override;
33
+ static unique_ptr<LogicalOperator> FormatDeserialize(FormatDeserializer &deserializer);
34
+
33
35
  idx_t EstimateCardinality(ClientContext &context) override;
34
36
 
35
37
  protected:
36
- void ResolveTypes() override {
37
- types.emplace_back(LogicalType::BIGINT);
38
- }
38
+ void ResolveTypes() override;
39
+
40
+ private:
41
+ LogicalCreateTable(ClientContext &context, const string &catalog, const string &schema,
42
+ unique_ptr<CreateInfo> info);
39
43
  };
40
44
  } // namespace duckdb
@@ -27,5 +27,8 @@ public:
27
27
 
28
28
  void Serialize(FieldWriter &writer) const override;
29
29
  static unique_ptr<LogicalOperator> Deserialize(LogicalDeserializationState &state, FieldReader &reader);
30
+
31
+ void FormatSerialize(FormatSerializer &serializer) const override;
32
+ static unique_ptr<LogicalOperator> FormatDeserialize(FormatDeserializer &deserializer);
30
33
  };
31
34
  } // namespace duckdb
@@ -45,6 +45,8 @@ public:
45
45
  }
46
46
  void Serialize(FieldWriter &writer) const override;
47
47
  static unique_ptr<LogicalOperator> Deserialize(LogicalDeserializationState &state, FieldReader &reader);
48
+ void FormatSerialize(FormatSerializer &serializer) const override;
49
+ static unique_ptr<LogicalOperator> FormatDeserialize(FormatDeserializer &deserializer);
48
50
  vector<idx_t> GetTableIndex() const override;
49
51
  string GetName() const override;
50
52