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
@@ -143,22 +143,24 @@ SinkResultType PhysicalIEJoin::Sink(ExecutionContext &context, DataChunk &chunk,
143
143
  return SinkResultType::NEED_MORE_INPUT;
144
144
  }
145
145
 
146
- void PhysicalIEJoin::Combine(ExecutionContext &context, GlobalSinkState &gstate_p, LocalSinkState &lstate_p) const {
147
- auto &gstate = gstate_p.Cast<IEJoinGlobalState>();
148
- auto &lstate = lstate_p.Cast<IEJoinLocalState>();
146
+ SinkCombineResultType PhysicalIEJoin::Combine(ExecutionContext &context, OperatorSinkCombineInput &input) const {
147
+ auto &gstate = input.global_state.Cast<IEJoinGlobalState>();
148
+ auto &lstate = input.local_state.Cast<IEJoinLocalState>();
149
149
  gstate.tables[gstate.child]->Combine(lstate.table);
150
150
  auto &client_profiler = QueryProfiler::Get(context.client);
151
151
 
152
152
  context.thread.profiler.Flush(*this, lstate.table.executor, gstate.child ? "rhs_executor" : "lhs_executor", 1);
153
153
  client_profiler.Flush(context.thread.profiler);
154
+
155
+ return SinkCombineResultType::FINISHED;
154
156
  }
155
157
 
156
158
  //===--------------------------------------------------------------------===//
157
159
  // Finalize
158
160
  //===--------------------------------------------------------------------===//
159
161
  SinkFinalizeType PhysicalIEJoin::Finalize(Pipeline &pipeline, Event &event, ClientContext &context,
160
- GlobalSinkState &gstate_p) const {
161
- auto &gstate = gstate_p.Cast<IEJoinGlobalState>();
162
+ OperatorSinkFinalizeInput &input) const {
163
+ auto &gstate = input.global_state.Cast<IEJoinGlobalState>();
162
164
  auto &table = *gstate.tables[gstate.child];
163
165
  auto &global_sort_state = table.global_sort_state;
164
166
 
@@ -191,17 +191,20 @@ SinkResultType PhysicalNestedLoopJoin::Sink(ExecutionContext &context, DataChunk
191
191
  return SinkResultType::NEED_MORE_INPUT;
192
192
  }
193
193
 
194
- void PhysicalNestedLoopJoin::Combine(ExecutionContext &context, GlobalSinkState &gstate, LocalSinkState &lstate) const {
195
- auto &state = lstate.Cast<NestedLoopJoinLocalState>();
194
+ SinkCombineResultType PhysicalNestedLoopJoin::Combine(ExecutionContext &context,
195
+ OperatorSinkCombineInput &input) const {
196
+ auto &state = input.local_state.Cast<NestedLoopJoinLocalState>();
196
197
  auto &client_profiler = QueryProfiler::Get(context.client);
197
198
 
198
199
  context.thread.profiler.Flush(*this, state.rhs_executor, "rhs_executor", 1);
199
200
  client_profiler.Flush(context.thread.profiler);
201
+
202
+ return SinkCombineResultType::FINISHED;
200
203
  }
201
204
 
202
205
  SinkFinalizeType PhysicalNestedLoopJoin::Finalize(Pipeline &pipeline, Event &event, ClientContext &context,
203
- GlobalSinkState &gstate_p) const {
204
- auto &gstate = gstate_p.Cast<NestedLoopJoinGlobalState>();
206
+ OperatorSinkFinalizeInput &input) const {
207
+ auto &gstate = input.global_state.Cast<NestedLoopJoinGlobalState>();
205
208
  gstate.right_outer.Initialize(gstate.right_payload_data.Count());
206
209
  if (gstate.right_payload_data.Count() == 0 && EmptyResultIfRHSIsEmpty()) {
207
210
  return SinkFinalizeType::NO_OUTPUT_POSSIBLE;
@@ -118,23 +118,25 @@ SinkResultType PhysicalPiecewiseMergeJoin::Sink(ExecutionContext &context, DataC
118
118
  return SinkResultType::NEED_MORE_INPUT;
119
119
  }
120
120
 
121
- void PhysicalPiecewiseMergeJoin::Combine(ExecutionContext &context, GlobalSinkState &gstate_p,
122
- LocalSinkState &lstate_p) const {
123
- auto &gstate = gstate_p.Cast<MergeJoinGlobalState>();
124
- auto &lstate = lstate_p.Cast<MergeJoinLocalState>();
121
+ SinkCombineResultType PhysicalPiecewiseMergeJoin::Combine(ExecutionContext &context,
122
+ OperatorSinkCombineInput &input) const {
123
+ auto &gstate = input.global_state.Cast<MergeJoinGlobalState>();
124
+ auto &lstate = input.local_state.Cast<MergeJoinLocalState>();
125
125
  gstate.table->Combine(lstate.table);
126
126
  auto &client_profiler = QueryProfiler::Get(context.client);
127
127
 
128
128
  context.thread.profiler.Flush(*this, lstate.table.executor, "rhs_executor", 1);
129
129
  client_profiler.Flush(context.thread.profiler);
130
+
131
+ return SinkCombineResultType::FINISHED;
130
132
  }
131
133
 
132
134
  //===--------------------------------------------------------------------===//
133
135
  // Finalize
134
136
  //===--------------------------------------------------------------------===//
135
137
  SinkFinalizeType PhysicalPiecewiseMergeJoin::Finalize(Pipeline &pipeline, Event &event, ClientContext &context,
136
- GlobalSinkState &gstate_p) const {
137
- auto &gstate = gstate_p.Cast<MergeJoinGlobalState>();
138
+ OperatorSinkFinalizeInput &input) const {
139
+ auto &gstate = input.global_state.Cast<MergeJoinGlobalState>();
138
140
  auto &global_sort_state = gstate.table->global_sort_state;
139
141
 
140
142
  if (IsRightOuterJoin(join_type)) {
@@ -101,10 +101,12 @@ SinkResultType PhysicalOrder::Sink(ExecutionContext &context, DataChunk &chunk,
101
101
  return SinkResultType::NEED_MORE_INPUT;
102
102
  }
103
103
 
104
- void PhysicalOrder::Combine(ExecutionContext &context, GlobalSinkState &gstate_p, LocalSinkState &lstate_p) const {
105
- auto &gstate = gstate_p.Cast<OrderGlobalSinkState>();
106
- auto &lstate = lstate_p.Cast<OrderLocalSinkState>();
104
+ SinkCombineResultType PhysicalOrder::Combine(ExecutionContext &context, OperatorSinkCombineInput &input) const {
105
+ auto &gstate = input.global_state.Cast<OrderGlobalSinkState>();
106
+ auto &lstate = input.local_state.Cast<OrderLocalSinkState>();
107
107
  gstate.global_sort_state.AddLocalState(lstate.local_sort_state);
108
+
109
+ return SinkCombineResultType::FINISHED;
108
110
  }
109
111
 
110
112
  class PhysicalOrderMergeTask : public ExecutorTask {
@@ -163,8 +165,8 @@ public:
163
165
  };
164
166
 
165
167
  SinkFinalizeType PhysicalOrder::Finalize(Pipeline &pipeline, Event &event, ClientContext &context,
166
- GlobalSinkState &gstate_p) const {
167
- auto &state = gstate_p.Cast<OrderGlobalSinkState>();
168
+ OperatorSinkFinalizeInput &input) const {
169
+ auto &state = input.global_state.Cast<OrderGlobalSinkState>();
168
170
  auto &global_sort_state = state.global_sort_state;
169
171
 
170
172
  if (global_sort_state.sorted_blocks.empty()) {
@@ -446,21 +446,23 @@ SinkResultType PhysicalTopN::Sink(ExecutionContext &context, DataChunk &chunk, O
446
446
  //===--------------------------------------------------------------------===//
447
447
  // Combine
448
448
  //===--------------------------------------------------------------------===//
449
- void PhysicalTopN::Combine(ExecutionContext &context, GlobalSinkState &state, LocalSinkState &lstate_p) const {
450
- auto &gstate = state.Cast<TopNGlobalState>();
451
- auto &lstate = lstate_p.Cast<TopNLocalState>();
449
+ SinkCombineResultType PhysicalTopN::Combine(ExecutionContext &context, OperatorSinkCombineInput &input) const {
450
+ auto &gstate = input.global_state.Cast<TopNGlobalState>();
451
+ auto &lstate = input.local_state.Cast<TopNLocalState>();
452
452
 
453
453
  // scan the local top N and append it to the global heap
454
454
  lock_guard<mutex> glock(gstate.lock);
455
455
  gstate.heap.Combine(lstate.heap);
456
+
457
+ return SinkCombineResultType::FINISHED;
456
458
  }
457
459
 
458
460
  //===--------------------------------------------------------------------===//
459
461
  // Finalize
460
462
  //===--------------------------------------------------------------------===//
461
463
  SinkFinalizeType PhysicalTopN::Finalize(Pipeline &pipeline, Event &event, ClientContext &context,
462
- GlobalSinkState &gstate_p) const {
463
- auto &gstate = gstate_p.Cast<TopNGlobalState>();
464
+ OperatorSinkFinalizeInput &input) const {
465
+ auto &gstate = input.global_state.Cast<TopNGlobalState>();
464
466
  // global finalize: compute the final top N
465
467
  gstate.heap.Finalize();
466
468
  return SinkFinalizeType::READY;
@@ -89,11 +89,13 @@ SinkResultType PhysicalBatchCopyToFile::Sink(ExecutionContext &context, DataChun
89
89
  return SinkResultType::NEED_MORE_INPUT;
90
90
  }
91
91
 
92
- void PhysicalBatchCopyToFile::Combine(ExecutionContext &context, GlobalSinkState &gstate_p,
93
- LocalSinkState &lstate) const {
94
- auto &state = lstate.Cast<BatchCopyToLocalState>();
95
- auto &gstate = gstate_p.Cast<BatchCopyToGlobalState>();
92
+ SinkCombineResultType PhysicalBatchCopyToFile::Combine(ExecutionContext &context,
93
+ OperatorSinkCombineInput &input) const {
94
+ auto &state = input.local_state.Cast<BatchCopyToLocalState>();
95
+ auto &gstate = input.global_state.Cast<BatchCopyToGlobalState>();
96
96
  gstate.rows_copied += state.rows_copied;
97
+
98
+ return SinkCombineResultType::FINISHED;
97
99
  }
98
100
 
99
101
  //===--------------------------------------------------------------------===//
@@ -114,8 +116,8 @@ SinkFinalizeType PhysicalBatchCopyToFile::FinalFlush(ClientContext &context, Glo
114
116
  }
115
117
 
116
118
  SinkFinalizeType PhysicalBatchCopyToFile::Finalize(Pipeline &pipeline, Event &event, ClientContext &context,
117
- GlobalSinkState &gstate_p) const {
118
- FinalFlush(context, gstate_p);
119
+ OperatorSinkFinalizeInput &input) const {
120
+ FinalFlush(context, input.global_state);
119
121
  return SinkFinalizeType::READY;
120
122
  }
121
123
 
@@ -344,16 +344,15 @@ SinkResultType PhysicalBatchInsert::Sink(ExecutionContext &context, DataChunk &c
344
344
  return SinkResultType::NEED_MORE_INPUT;
345
345
  }
346
346
 
347
- void PhysicalBatchInsert::Combine(ExecutionContext &context, GlobalSinkState &gstate_p,
348
- LocalSinkState &lstate_p) const {
349
- auto &gstate = gstate_p.Cast<BatchInsertGlobalState>();
350
- auto &lstate = lstate_p.Cast<BatchInsertLocalState>();
347
+ SinkCombineResultType PhysicalBatchInsert::Combine(ExecutionContext &context, OperatorSinkCombineInput &input) const {
348
+ auto &gstate = input.global_state.Cast<BatchInsertGlobalState>();
349
+ auto &lstate = input.local_state.Cast<BatchInsertLocalState>();
351
350
  auto &client_profiler = QueryProfiler::Get(context.client);
352
351
  context.thread.profiler.Flush(*this, lstate.default_executor, "default_executor", 1);
353
352
  client_profiler.Flush(context.thread.profiler);
354
353
 
355
354
  if (!lstate.current_collection) {
356
- return;
355
+ return SinkCombineResultType::FINISHED;
357
356
  }
358
357
 
359
358
  if (lstate.current_collection->GetTotalRows() > 0) {
@@ -366,11 +365,13 @@ void PhysicalBatchInsert::Combine(ExecutionContext &context, GlobalSinkState &gs
366
365
  lock_guard<mutex> l(gstate.lock);
367
366
  gstate.table.GetStorage().FinalizeOptimisticWriter(context.client, *lstate.writer);
368
367
  }
368
+
369
+ return SinkCombineResultType::FINISHED;
369
370
  }
370
371
 
371
372
  SinkFinalizeType PhysicalBatchInsert::Finalize(Pipeline &pipeline, Event &event, ClientContext &context,
372
- GlobalSinkState &gstate_p) const {
373
- auto &gstate = gstate_p.Cast<BatchInsertGlobalState>();
373
+ OperatorSinkFinalizeInput &input) const {
374
+ auto &gstate = input.global_state.Cast<BatchInsertGlobalState>();
374
375
 
375
376
  // in the finalize, do a final pass over all of the collections we created and try to merge smaller collections
376
377
  // together
@@ -97,9 +97,9 @@ static string CreateDirRecursive(const vector<idx_t> &cols, const vector<string>
97
97
  return path;
98
98
  }
99
99
 
100
- void PhysicalCopyToFile::Combine(ExecutionContext &context, GlobalSinkState &gstate, LocalSinkState &lstate) const {
101
- auto &g = gstate.Cast<CopyToFunctionGlobalState>();
102
- auto &l = lstate.Cast<CopyToFunctionLocalState>();
100
+ SinkCombineResultType PhysicalCopyToFile::Combine(ExecutionContext &context, OperatorSinkCombineInput &input) const {
101
+ auto &g = input.global_state.Cast<CopyToFunctionGlobalState>();
102
+ auto &l = input.local_state.Cast<CopyToFunctionLocalState>();
103
103
 
104
104
  if (partition_output) {
105
105
  auto &fs = FileSystem::GetFileSystem(context.client);
@@ -130,7 +130,7 @@ void PhysicalCopyToFile::Combine(ExecutionContext &context, GlobalSinkState &gst
130
130
  function.copy_to_finalize(context.client, *bind_data, *fun_data_global);
131
131
  }
132
132
 
133
- return;
133
+ return SinkCombineResultType::FINISHED;
134
134
  }
135
135
 
136
136
  if (function.copy_to_combine) {
@@ -141,11 +141,13 @@ void PhysicalCopyToFile::Combine(ExecutionContext &context, GlobalSinkState &gst
141
141
  function.copy_to_finalize(context.client, *bind_data, *l.global_state);
142
142
  }
143
143
  }
144
+
145
+ return SinkCombineResultType::FINISHED;
144
146
  }
145
147
 
146
148
  SinkFinalizeType PhysicalCopyToFile::Finalize(Pipeline &pipeline, Event &event, ClientContext &context,
147
- GlobalSinkState &gstate_p) const {
148
- auto &gstate = gstate_p.Cast<CopyToFunctionGlobalState>();
149
+ OperatorSinkFinalizeInput &input) const {
150
+ auto &gstate = input.global_state.Cast<CopyToFunctionGlobalState>();
149
151
  if (per_thread_output || partition_output) {
150
152
  // already happened in combine
151
153
  return SinkFinalizeType::READY;
@@ -136,10 +136,10 @@ SinkResultType PhysicalFixedBatchCopy::Sink(ExecutionContext &context, DataChunk
136
136
  return SinkResultType::NEED_MORE_INPUT;
137
137
  }
138
138
 
139
- void PhysicalFixedBatchCopy::Combine(ExecutionContext &context, GlobalSinkState &gstate_p,
140
- LocalSinkState &lstate) const {
141
- auto &state = lstate.Cast<FixedBatchCopyLocalState>();
142
- auto &gstate = gstate_p.Cast<FixedBatchCopyGlobalState>();
139
+ SinkCombineResultType PhysicalFixedBatchCopy::Combine(ExecutionContext &context,
140
+ OperatorSinkCombineInput &input) const {
141
+ auto &state = input.local_state.Cast<FixedBatchCopyLocalState>();
142
+ auto &gstate = input.global_state.Cast<FixedBatchCopyGlobalState>();
143
143
  gstate.rows_copied += state.rows_copied;
144
144
  if (!gstate.any_finished) {
145
145
  // signal that this thread is finished processing batches and that we should move on to Finalize
@@ -147,6 +147,8 @@ void PhysicalFixedBatchCopy::Combine(ExecutionContext &context, GlobalSinkState
147
147
  gstate.any_finished = true;
148
148
  }
149
149
  ExecuteTasks(context.client, gstate);
150
+
151
+ return SinkCombineResultType::FINISHED;
150
152
  }
151
153
 
152
154
  //===--------------------------------------------------------------------===//
@@ -225,16 +227,16 @@ SinkFinalizeType PhysicalFixedBatchCopy::FinalFlush(ClientContext &context, Glob
225
227
  }
226
228
 
227
229
  SinkFinalizeType PhysicalFixedBatchCopy::Finalize(Pipeline &pipeline, Event &event, ClientContext &context,
228
- GlobalSinkState &gstate_p) const {
229
- auto &gstate = gstate_p.Cast<FixedBatchCopyGlobalState>();
230
+ OperatorSinkFinalizeInput &input) const {
231
+ auto &gstate = input.global_state.Cast<FixedBatchCopyGlobalState>();
230
232
  idx_t min_batch_index = idx_t(NumericLimits<int64_t>::Maximum());
231
233
  // repartition any remaining batches
232
- RepartitionBatches(context, gstate_p, min_batch_index, true);
234
+ RepartitionBatches(context, input.global_state, min_batch_index, true);
233
235
  // check if we have multiple tasks to execute
234
236
  if (gstate.TaskCount() <= 1) {
235
237
  // we don't - just execute the remaining task and finish flushing to disk
236
- ExecuteTasks(context, gstate_p);
237
- FinalFlush(context, gstate_p);
238
+ ExecuteTasks(context, input.global_state);
239
+ FinalFlush(context, input.global_state);
238
240
  return SinkFinalizeType::READY;
239
241
  }
240
242
  // we have multiple tasks remaining - launch an event to execute the tasks in parallel
@@ -463,19 +463,17 @@ SinkResultType PhysicalInsert::Sink(ExecutionContext &context, DataChunk &chunk,
463
463
  return SinkResultType::NEED_MORE_INPUT;
464
464
  }
465
465
 
466
- void PhysicalInsert::Combine(ExecutionContext &context, GlobalSinkState &gstate_p, LocalSinkState &lstate_p) const {
467
- auto &gstate = gstate_p.Cast<InsertGlobalState>();
468
- auto &lstate = lstate_p.Cast<InsertLocalState>();
466
+ SinkCombineResultType PhysicalInsert::Combine(ExecutionContext &context, OperatorSinkCombineInput &input) const {
467
+ auto &gstate = input.global_state.Cast<InsertGlobalState>();
468
+ auto &lstate = input.local_state.Cast<InsertLocalState>();
469
469
  auto &client_profiler = QueryProfiler::Get(context.client);
470
470
  context.thread.profiler.Flush(*this, lstate.default_executor, "default_executor", 1);
471
471
  client_profiler.Flush(context.thread.profiler);
472
472
 
473
- if (!parallel) {
474
- return;
475
- }
476
- if (!lstate.local_collection) {
477
- return;
473
+ if (!parallel || !lstate.local_collection) {
474
+ return SinkCombineResultType::FINISHED;
478
475
  }
476
+
479
477
  // parallel append: finalize the append
480
478
  TransactionData tdata(0, 0);
481
479
  lstate.local_collection->FinalizeAppend(tdata, lstate.local_append_state);
@@ -500,11 +498,13 @@ void PhysicalInsert::Combine(ExecutionContext &context, GlobalSinkState &gstate_
500
498
  gstate.table.GetStorage().FinalizeOptimisticWriter(context.client, *lstate.writer);
501
499
  gstate.table.GetStorage().LocalMerge(context.client, *lstate.local_collection);
502
500
  }
501
+
502
+ return SinkCombineResultType::FINISHED;
503
503
  }
504
504
 
505
505
  SinkFinalizeType PhysicalInsert::Finalize(Pipeline &pipeline, Event &event, ClientContext &context,
506
- GlobalSinkState &state) const {
507
- auto &gstate = state.Cast<InsertGlobalState>();
506
+ OperatorSinkFinalizeInput &input) const {
507
+ auto &gstate = input.global_state.Cast<InsertGlobalState>();
508
508
  if (!parallel && gstate.initialized) {
509
509
  auto &table = gstate.table;
510
510
  auto &storage = table.GetStorage();
@@ -140,11 +140,13 @@ unique_ptr<LocalSinkState> PhysicalUpdate::GetLocalSinkState(ExecutionContext &c
140
140
  return make_uniq<UpdateLocalState>(context.client, expressions, table.GetTypes(), bound_defaults);
141
141
  }
142
142
 
143
- void PhysicalUpdate::Combine(ExecutionContext &context, GlobalSinkState &gstate, LocalSinkState &lstate) const {
144
- auto &state = lstate.Cast<UpdateLocalState>();
143
+ SinkCombineResultType PhysicalUpdate::Combine(ExecutionContext &context, OperatorSinkCombineInput &input) const {
144
+ auto &state = input.local_state.Cast<UpdateLocalState>();
145
145
  auto &client_profiler = QueryProfiler::Get(context.client);
146
146
  context.thread.profiler.Flush(*this, state.default_executor, "default_executor", 1);
147
147
  client_profiler.Flush(context.thread.profiler);
148
+
149
+ return SinkCombineResultType::FINISHED;
148
150
  }
149
151
 
150
152
  //===--------------------------------------------------------------------===//
@@ -123,11 +123,10 @@ SinkResultType PhysicalCreateIndex::Sink(ExecutionContext &context, DataChunk &c
123
123
  return SinkResultType::NEED_MORE_INPUT;
124
124
  }
125
125
 
126
- void PhysicalCreateIndex::Combine(ExecutionContext &context, GlobalSinkState &gstate_p,
127
- LocalSinkState &lstate_p) const {
126
+ SinkCombineResultType PhysicalCreateIndex::Combine(ExecutionContext &context, OperatorSinkCombineInput &input) const {
128
127
 
129
- auto &gstate = gstate_p.Cast<CreateIndexGlobalSinkState>();
130
- auto &lstate = lstate_p.Cast<CreateIndexLocalSinkState>();
128
+ auto &gstate = input.global_state.Cast<CreateIndexGlobalSinkState>();
129
+ auto &lstate = input.local_state.Cast<CreateIndexLocalSinkState>();
131
130
 
132
131
  // merge the local index into the global index
133
132
  if (!gstate.global_index->MergeIndexes(*lstate.local_index)) {
@@ -136,14 +135,16 @@ void PhysicalCreateIndex::Combine(ExecutionContext &context, GlobalSinkState &gs
136
135
 
137
136
  // vacuum excess memory
138
137
  gstate.global_index->Vacuum();
138
+
139
+ return SinkCombineResultType::FINISHED;
139
140
  }
140
141
 
141
142
  SinkFinalizeType PhysicalCreateIndex::Finalize(Pipeline &pipeline, Event &event, ClientContext &context,
142
- GlobalSinkState &gstate_p) const {
143
+ OperatorSinkFinalizeInput &input) const {
143
144
 
144
145
  // here, we just set the resulting global index as the newly created index of the table
145
146
 
146
- auto &state = gstate_p.Cast<CreateIndexGlobalSinkState>();
147
+ auto &state = input.global_state.Cast<CreateIndexGlobalSinkState>();
147
148
  D_ASSERT(!state.global_index->VerifyAndToString(true).empty());
148
149
 
149
150
  auto &storage = table.GetStorage();
@@ -97,11 +97,12 @@ SinkResultType PhysicalOperator::Sink(ExecutionContext &context, DataChunk &chun
97
97
 
98
98
  // LCOV_EXCL_STOP
99
99
 
100
- void PhysicalOperator::Combine(ExecutionContext &context, GlobalSinkState &gstate, LocalSinkState &lstate) const {
100
+ SinkCombineResultType PhysicalOperator::Combine(ExecutionContext &context, OperatorSinkCombineInput &input) const {
101
+ return SinkCombineResultType::FINISHED;
101
102
  }
102
103
 
103
104
  SinkFinalizeType PhysicalOperator::Finalize(Pipeline &pipeline, Event &event, ClientContext &context,
104
- GlobalSinkState &gstate) const {
105
+ OperatorSinkFinalizeInput &input) const {
105
106
  return SinkFinalizeType::READY;
106
107
  }
107
108
 
@@ -305,7 +305,7 @@ unique_ptr<PhysicalOperator> PhysicalPlanGenerator::CreatePlan(LogicalComparison
305
305
  CheckForPerfectJoinOpt(op, perfect_join_stats);
306
306
  plan = make_uniq<PhysicalHashJoin>(op, std::move(left), std::move(right), std::move(op.conditions),
307
307
  op.join_type, op.left_projection_map, op.right_projection_map,
308
- std::move(op.delim_types), op.estimated_cardinality, perfect_join_stats);
308
+ std::move(op.mark_types), op.estimated_cardinality, perfect_join_stats);
309
309
 
310
310
  } else {
311
311
  static constexpr const idx_t NESTED_LOOP_JOIN_THRESHOLD = 5;
@@ -1,8 +1,8 @@
1
1
  #ifndef DUCKDB_VERSION
2
- #define DUCKDB_VERSION "0.8.2-dev1862"
2
+ #define DUCKDB_VERSION "0.8.2-dev2044"
3
3
  #endif
4
4
  #ifndef DUCKDB_SOURCE_ID
5
- #define DUCKDB_SOURCE_ID "9b0a6350ab"
5
+ #define DUCKDB_SOURCE_ID "762396f87b"
6
6
  #endif
7
7
  #include "duckdb/function/table/system_functions.hpp"
8
8
  #include "duckdb/main/database.hpp"
@@ -33,9 +33,8 @@ public:
33
33
  vector<unique_ptr<ParsedExpression>> parsed_expressions;
34
34
 
35
35
  public:
36
+ unique_ptr<CreateInfo> GetInfo() const override;
36
37
  string ToSQL() const override;
37
- void Serialize(Serializer &serializer) const;
38
- static unique_ptr<CreateIndexInfo> Deserialize(Deserializer &source, ClientContext &context);
39
38
 
40
39
  virtual string GetSchemaName() const = 0;
41
40
  virtual string GetTableName() const = 0;
@@ -24,10 +24,7 @@ public:
24
24
  unique_ptr<MacroFunction> function;
25
25
 
26
26
  public:
27
- virtual unique_ptr<CreateMacroInfo> GetInfoForSerialization() const;
28
- //! Serialize the meta information
29
- virtual void Serialize(Serializer &serializer) const;
30
- static unique_ptr<CreateMacroInfo> Deserialize(Deserializer &main_source, ClientContext &context);
27
+ unique_ptr<CreateInfo> GetInfo() const override;
31
28
 
32
29
  string ToSQL() const override {
33
30
  return function->ToSQL(schema.name, name);
@@ -49,17 +49,14 @@ public:
49
49
  SchemaCatalogEntry(Catalog &catalog, string name, bool is_internal);
50
50
 
51
51
  public:
52
+ unique_ptr<CreateInfo> GetInfo() const override;
53
+
52
54
  //! Scan the specified catalog set, invoking the callback method for every entry
53
55
  virtual void Scan(ClientContext &context, CatalogType type,
54
56
  const std::function<void(CatalogEntry &)> &callback) = 0;
55
57
  //! Scan the specified catalog set, invoking the callback method for every committed entry
56
58
  virtual void Scan(CatalogType type, const std::function<void(CatalogEntry &)> &callback) = 0;
57
59
 
58
- //! Serialize the meta information of the SchemaCatalogEntry a serializer
59
- virtual void Serialize(Serializer &serializer) const;
60
- //! Deserializes to a CreateSchemaInfo
61
- static unique_ptr<CreateSchemaInfo> Deserialize(Deserializer &source);
62
-
63
60
  string ToSQL() const override;
64
61
 
65
62
  //! Creates an index with the given name in the schema
@@ -57,13 +57,8 @@ public:
57
57
  bool cycle;
58
58
 
59
59
  public:
60
- //! Serialize the meta information of the SequenceCatalogEntry a serializer
61
- virtual void Serialize(Serializer &serializer) const;
62
- //! Deserializes to a CreateTableInfo
63
- static unique_ptr<CreateSequenceInfo> Deserialize(Deserializer &source);
60
+ unique_ptr<CreateInfo> GetInfo() const override;
64
61
 
65
62
  string ToSQL() const override;
66
-
67
- CatalogEntry *AlterOwnership(ClientContext &context, AlterInfo *info);
68
63
  };
69
64
  } // namespace duckdb
@@ -55,6 +55,8 @@ public:
55
55
  DUCKDB_API TableCatalogEntry(Catalog &catalog, SchemaCatalogEntry &schema, CreateTableInfo &info);
56
56
 
57
57
  public:
58
+ DUCKDB_API unique_ptr<CreateInfo> GetInfo() const override;
59
+
58
60
  DUCKDB_API bool HasGeneratedColumns() const;
59
61
 
60
62
  //! Returns whether or not a column with the given name exists
@@ -83,11 +85,6 @@ public:
83
85
  //! Get statistics of a column (physical or virtual) within the table
84
86
  virtual unique_ptr<BaseStatistics> GetStatistics(ClientContext &context, column_t column_id) = 0;
85
87
 
86
- //! Serialize the meta information of the TableCatalogEntry a serializer
87
- void Serialize(Serializer &serializer) const;
88
- //! Deserializes to a CreateTableInfo
89
- static unique_ptr<CreateTableInfo> Deserialize(Deserializer &source, ClientContext &context);
90
-
91
88
  //! Returns the column index of the specified column name.
92
89
  //! If the column does not exist:
93
90
  //! If if_column_exists is true, returns DConstants::INVALID_INDEX
@@ -113,12 +110,6 @@ public:
113
110
  ClientContext &context);
114
111
 
115
112
  protected:
116
- // This is used to serialize the entry by #Serialize(Serializer& ). It is virtual to allow
117
- // Custom catalog implementations to override the default implementation. We can not make
118
- // The Serialize method itself virtual as the logic is tightly coupled to the static
119
- // Deserialize method.
120
- virtual CreateTableInfo GetTableInfoForSerialization() const;
121
-
122
113
  //! A list of columns that are part of this table
123
114
  ColumnList columns;
124
115
  //! A list of constraints that are part of this table
@@ -38,12 +38,9 @@ public:
38
38
  vector<LogicalType> types;
39
39
 
40
40
  public:
41
- unique_ptr<CatalogEntry> AlterEntry(ClientContext &context, AlterInfo &info) override;
41
+ unique_ptr<CreateInfo> GetInfo() const override;
42
42
 
43
- //! Serialize the meta information of the ViewCatalogEntry a serializer
44
- virtual void Serialize(Serializer &serializer) const;
45
- //! Deserializes to a CreateTableInfo
46
- static unique_ptr<CreateViewInfo> Deserialize(Deserializer &source, ClientContext &context);
43
+ unique_ptr<CatalogEntry> AlterEntry(ClientContext &context, AlterInfo &info) override;
47
44
 
48
45
  unique_ptr<CatalogEntry> Copy(ClientContext &context) const override;
49
46
 
@@ -21,6 +21,10 @@ class Catalog;
21
21
  class CatalogSet;
22
22
  class ClientContext;
23
23
  class SchemaCatalogEntry;
24
+ class FormatSerializer;
25
+ class FormatDeserializer;
26
+
27
+ struct CreateInfo;
24
28
 
25
29
  //! Abstract base class of an entry in the catalog
26
30
  class CatalogEntry {
@@ -56,6 +60,8 @@ public:
56
60
 
57
61
  virtual unique_ptr<CatalogEntry> Copy(ClientContext &context) const;
58
62
 
63
+ virtual unique_ptr<CreateInfo> GetInfo() const;
64
+
59
65
  //! Sets the CatalogEntry as the new root entry (i.e. the newest entry)
60
66
  // this is called on a rollback to an AlterEntry
61
67
  virtual void SetAsRoot();
@@ -68,6 +74,14 @@ public:
68
74
 
69
75
  virtual void Verify(Catalog &catalog);
70
76
 
77
+ //! Serialize the meta information of the CatalogEntry a serializer
78
+ void Serialize(Serializer &serializer) const;
79
+ //! Deserializes to a CreateInfo
80
+ static unique_ptr<CreateInfo> Deserialize(Deserializer &source);
81
+
82
+ void FormatSerialize(FormatSerializer &serializer) const;
83
+ static unique_ptr<CreateInfo> FormatDeserialize(FormatDeserializer &deserializer);
84
+
71
85
  public:
72
86
  template <class TARGET>
73
87
  TARGET &Cast() {