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
@@ -8,8 +8,11 @@
8
8
 
9
9
  #pragma once
10
10
 
11
+ #include "duckdb/common/hugeint.hpp"
11
12
  #include "duckdb/common/types.hpp"
12
13
 
14
+ #include <type_traits>
15
+
13
16
  // Undef annoying windows macro
14
17
  #undef max
15
18
 
@@ -21,75 +24,16 @@ template <class T>
21
24
  struct NumericLimits {
22
25
  static constexpr T Minimum() {
23
26
  return std::numeric_limits<T>::lowest();
24
- };
27
+ }
25
28
  static constexpr T Maximum() {
26
29
  return std::numeric_limits<T>::max();
27
- };
28
- DUCKDB_API static bool IsSigned();
29
- DUCKDB_API static idx_t Digits();
30
- };
31
-
32
- template <>
33
- struct NumericLimits<int8_t> {
34
- static constexpr int8_t Minimum() {
35
- return std::numeric_limits<int8_t>::lowest();
36
- };
37
- static constexpr int8_t Maximum() {
38
- return std::numeric_limits<int8_t>::max();
39
- };
40
- static bool IsSigned() {
41
- return true;
42
- }
43
- static idx_t Digits() {
44
- return 3;
45
- }
46
- };
47
- template <>
48
- struct NumericLimits<int16_t> {
49
- static constexpr int16_t Minimum() {
50
- return std::numeric_limits<int16_t>::lowest();
51
- };
52
- static constexpr int16_t Maximum() {
53
- return std::numeric_limits<int16_t>::max();
54
- };
55
- static bool IsSigned() {
56
- return true;
57
- }
58
- static idx_t Digits() {
59
- return 5;
60
- }
61
- };
62
- template <>
63
- struct NumericLimits<int32_t> {
64
- static constexpr int32_t Minimum() {
65
- return std::numeric_limits<int32_t>::lowest();
66
- };
67
- static constexpr int32_t Maximum() {
68
- return std::numeric_limits<int32_t>::max();
69
- };
70
- static bool IsSigned() {
71
- return true;
72
30
  }
73
- static idx_t Digits() {
74
- return 10;
31
+ DUCKDB_API static constexpr bool IsSigned() {
32
+ return std::is_signed<T>::value;
75
33
  }
34
+ DUCKDB_API static constexpr idx_t Digits();
76
35
  };
77
36
 
78
- template <>
79
- struct NumericLimits<int64_t> {
80
- static constexpr int64_t Minimum() {
81
- return std::numeric_limits<int64_t>::lowest();
82
- };
83
- static constexpr int64_t Maximum() {
84
- return std::numeric_limits<int64_t>::max();
85
- };
86
- static bool IsSigned() {
87
- return true;
88
- }
89
- static idx_t Digits() {
90
- return 19;
91
- }
92
- };
93
37
  template <>
94
38
  struct NumericLimits<hugeint_t> {
95
39
  static constexpr hugeint_t Minimum() {
@@ -98,104 +42,63 @@ struct NumericLimits<hugeint_t> {
98
42
  static constexpr hugeint_t Maximum() {
99
43
  return {std::numeric_limits<int64_t>::max(), std::numeric_limits<uint64_t>::max()};
100
44
  };
101
- static bool IsSigned() {
45
+ static constexpr bool IsSigned() {
102
46
  return true;
103
47
  }
104
- static idx_t Digits() {
48
+
49
+ static constexpr idx_t Digits() {
105
50
  return 39;
106
51
  }
107
52
  };
108
53
 
109
54
  template <>
110
- struct NumericLimits<uint8_t> {
111
- static constexpr uint8_t Minimum() {
112
- return std::numeric_limits<uint8_t>::lowest();
113
- };
114
- static constexpr uint8_t Maximum() {
115
- return std::numeric_limits<uint8_t>::max();
116
- };
117
- static bool IsSigned() {
118
- return false;
119
- }
120
- static idx_t Digits() {
121
- return 3;
122
- }
123
- };
55
+ constexpr idx_t NumericLimits<int8_t>::Digits() {
56
+ return 3;
57
+ }
124
58
 
125
59
  template <>
126
- struct NumericLimits<uint16_t> {
127
- static constexpr uint16_t Minimum() {
128
- return std::numeric_limits<uint16_t>::lowest();
129
- };
130
- static constexpr uint16_t Maximum() {
131
- return std::numeric_limits<uint16_t>::max();
132
- };
133
- static bool IsSigned() {
134
- return false;
135
- }
136
- static idx_t Digits() {
137
- return 5;
138
- }
139
- };
60
+ constexpr idx_t NumericLimits<int16_t>::Digits() {
61
+ return 5;
62
+ }
63
+
140
64
  template <>
141
- struct NumericLimits<uint32_t> {
142
- static constexpr uint32_t Minimum() {
143
- return std::numeric_limits<uint32_t>::lowest();
144
- };
145
- static constexpr uint32_t Maximum() {
146
- return std::numeric_limits<uint32_t>::max();
147
- };
148
- static bool IsSigned() {
149
- return false;
150
- }
151
- static idx_t Digits() {
152
- return 10;
153
- }
154
- };
65
+ constexpr idx_t NumericLimits<int32_t>::Digits() {
66
+ return 10;
67
+ }
68
+
155
69
  template <>
156
- struct NumericLimits<uint64_t> {
157
- static constexpr uint64_t Minimum() {
158
- return std::numeric_limits<uint64_t>::lowest();
159
- };
160
- static constexpr uint64_t Maximum() {
161
- return std::numeric_limits<uint64_t>::max();
162
- };
163
- static bool IsSigned() {
164
- return false;
165
- }
166
- static idx_t Digits() {
167
- return 20;
168
- }
169
- };
70
+ constexpr idx_t NumericLimits<int64_t>::Digits() {
71
+ return 19;
72
+ }
73
+
170
74
  template <>
171
- struct NumericLimits<float> {
172
- static constexpr float Minimum() {
173
- return std::numeric_limits<float>::lowest();
174
- };
175
- static constexpr float Maximum() {
176
- return std::numeric_limits<float>::max();
177
- };
178
- static bool IsSigned() {
179
- return true;
180
- }
181
- static idx_t Digits() {
182
- return 127;
183
- }
184
- };
75
+ constexpr idx_t NumericLimits<uint8_t>::Digits() {
76
+ return 3;
77
+ }
78
+
185
79
  template <>
186
- struct NumericLimits<double> {
187
- static constexpr double Minimum() {
188
- return std::numeric_limits<double>::lowest();
189
- };
190
- static constexpr double Maximum() {
191
- return std::numeric_limits<double>::max();
192
- };
193
- static bool IsSigned() {
194
- return true;
195
- }
196
- static idx_t Digits() {
197
- return 250;
198
- }
199
- };
80
+ constexpr idx_t NumericLimits<uint16_t>::Digits() {
81
+ return 5;
82
+ }
83
+
84
+ template <>
85
+ constexpr idx_t NumericLimits<uint32_t>::Digits() {
86
+ return 10;
87
+ }
88
+
89
+ template <>
90
+ constexpr idx_t NumericLimits<uint64_t>::Digits() {
91
+ return 20;
92
+ }
93
+
94
+ template <>
95
+ constexpr idx_t NumericLimits<float>::Digits() {
96
+ return 127;
97
+ }
98
+
99
+ template <>
100
+ constexpr idx_t NumericLimits<double>::Digits() {
101
+ return 250;
102
+ }
200
103
 
201
104
  } // namespace duckdb
@@ -0,0 +1,48 @@
1
+ //===----------------------------------------------------------------------===//
2
+ // DuckDB
3
+ //
4
+ // duckdb/common/numeric_utils.hpp
5
+ //
6
+ //
7
+ //===----------------------------------------------------------------------===//
8
+
9
+ #pragma once
10
+
11
+ #include <type_traits>
12
+ #include "duckdb/common/hugeint.hpp"
13
+
14
+ namespace duckdb {
15
+
16
+ template <class T>
17
+ struct MakeSigned {
18
+ using type = typename std::make_signed<T>::type;
19
+ };
20
+
21
+ template <>
22
+ struct MakeSigned<hugeint_t> {
23
+ using type = hugeint_t;
24
+ };
25
+
26
+ template <class T>
27
+ struct MakeUnsigned {
28
+ using type = typename std::make_unsigned<T>::type;
29
+ };
30
+
31
+ // hugeint_t does not actually have an unsigned variant (yet), but this is required to make compression work
32
+ // if an unsigned variant gets implemented this (probably) can be changed without breaking anything
33
+ template <>
34
+ struct MakeUnsigned<hugeint_t> {
35
+ using type = hugeint_t;
36
+ };
37
+
38
+ template <class T>
39
+ struct IsIntegral {
40
+ static constexpr bool value = std::is_integral<T>::value;
41
+ };
42
+
43
+ template <>
44
+ struct IsIntegral<hugeint_t> {
45
+ static constexpr bool value = true;
46
+ };
47
+
48
+ } // namespace duckdb
@@ -1,17 +1,41 @@
1
+ //===----------------------------------------------------------------------===//
2
+ // DuckDB
3
+ //
4
+ // duckdb/common/serializer/binary_deserializer.hpp
5
+ //
6
+ //
7
+ //===----------------------------------------------------------------------===//
8
+
1
9
  #pragma once
10
+
2
11
  #include "duckdb/common/serializer/format_deserializer.hpp"
3
12
 
4
13
  namespace duckdb {
14
+ class ClientContext;
5
15
 
6
16
  class BinaryDeserializer : public FormatDeserializer {
7
17
  public:
18
+ template <class T>
19
+ unique_ptr<T> Deserialize() {
20
+ OnObjectBegin();
21
+ auto result = T::FormatDeserialize(*this);
22
+ OnObjectEnd();
23
+ return result;
24
+ }
25
+
8
26
  template <class T>
9
27
  static unique_ptr<T> Deserialize(data_ptr_t ptr, idx_t length) {
10
28
  BinaryDeserializer deserializer(ptr, length);
11
- deserializer.OnObjectBegin();
12
- auto result = T::FormatDeserialize(deserializer);
13
- deserializer.OnObjectEnd();
14
- return result;
29
+ return deserializer.template Deserialize<T>();
30
+ }
31
+
32
+ template <class T>
33
+ static unique_ptr<T> Deserialize(ClientContext &context, bound_parameter_map_t &parameters, data_ptr_t ptr,
34
+ idx_t length) {
35
+ BinaryDeserializer deserializer(ptr, length);
36
+ deserializer.Set<ClientContext &>(context);
37
+ deserializer.Set<bound_parameter_map_t &>(parameters);
38
+ return deserializer.template Deserialize<T>();
15
39
  }
16
40
 
17
41
  private:
@@ -1,3 +1,11 @@
1
+ //===----------------------------------------------------------------------===//
2
+ // DuckDB
3
+ //
4
+ // duckdb/common/serializer/binary_serializer.hpp
5
+ //
6
+ //
7
+ //===----------------------------------------------------------------------===//
8
+
1
9
  #pragma once
2
10
 
3
11
  #include "duckdb/common/serializer/format_serializer.hpp"
@@ -5,7 +13,6 @@
5
13
  namespace duckdb {
6
14
 
7
15
  struct BinarySerializer : public FormatSerializer {
8
-
9
16
  private:
10
17
  struct State {
11
18
  // how many fields are present in the object
@@ -24,14 +31,14 @@ private:
24
31
  template <class T>
25
32
  void Write(T element) {
26
33
  static_assert(std::is_trivially_destructible<T>(), "Write element must be trivially destructible");
27
- WriteData(const_data_ptr_cast(&element), sizeof(T));
34
+ WriteDataInternal(const_data_ptr_cast(&element), sizeof(T));
28
35
  }
29
- void WriteData(const_data_ptr_t buffer, idx_t write_size) {
36
+ void WriteDataInternal(const_data_ptr_t buffer, idx_t write_size) {
30
37
  data.insert(data.end(), buffer, buffer + write_size);
31
38
  stack.back().size += write_size;
32
39
  }
33
- void WriteData(const char *ptr, idx_t write_size) {
34
- WriteData(const_data_ptr_cast(ptr), write_size);
40
+ void WriteDataInternal(const char *ptr, idx_t write_size) {
41
+ WriteDataInternal(const_data_ptr_cast(ptr), write_size);
35
42
  }
36
43
 
37
44
  explicit BinarySerializer() {
@@ -0,0 +1,110 @@
1
+ //===----------------------------------------------------------------------===//
2
+ // DuckDB
3
+ //
4
+ // duckdb/common/serializer/deserialization_data.hpp
5
+ //
6
+ //
7
+ //===----------------------------------------------------------------------===//
8
+
9
+ #pragma once
10
+
11
+ #include "duckdb/common/common.hpp"
12
+ #include "duckdb/common/stack.hpp"
13
+ #include "duckdb/planner/bound_parameter_map.hpp"
14
+
15
+ namespace duckdb {
16
+ class ClientContext;
17
+ class Catalog;
18
+ enum class ExpressionType : uint8_t;
19
+
20
+ struct DeserializationData {
21
+ stack<reference<ClientContext>> contexts;
22
+ stack<idx_t> enums;
23
+ stack<reference<bound_parameter_map_t>> parameter_data;
24
+
25
+ template <class T>
26
+ void Set(T entry) = delete;
27
+
28
+ template <class T>
29
+ T Get() = delete;
30
+
31
+ template <class T>
32
+ void Unset() = delete;
33
+
34
+ template <class T>
35
+ inline void AssertNotEmpty(const stack<T> &e) {
36
+ if (e.empty()) {
37
+ throw InternalException("DeserializationData - unexpected empty stack");
38
+ }
39
+ }
40
+ };
41
+
42
+ template <>
43
+ inline void DeserializationData::Set(ExpressionType type) {
44
+ enums.push(idx_t(type));
45
+ }
46
+
47
+ template <>
48
+ inline ExpressionType DeserializationData::Get() {
49
+ AssertNotEmpty(enums);
50
+ return ExpressionType(enums.top());
51
+ }
52
+
53
+ template <>
54
+ inline void DeserializationData::Unset<ExpressionType>() {
55
+ AssertNotEmpty(enums);
56
+ enums.pop();
57
+ }
58
+
59
+ template <>
60
+ inline void DeserializationData::Set(LogicalOperatorType type) {
61
+ enums.push(idx_t(type));
62
+ }
63
+
64
+ template <>
65
+ inline LogicalOperatorType DeserializationData::Get() {
66
+ AssertNotEmpty(enums);
67
+ return LogicalOperatorType(enums.top());
68
+ }
69
+
70
+ template <>
71
+ inline void DeserializationData::Unset<LogicalOperatorType>() {
72
+ AssertNotEmpty(enums);
73
+ enums.pop();
74
+ }
75
+
76
+ template <>
77
+ inline void DeserializationData::Set(ClientContext &context) {
78
+ contexts.push(context);
79
+ }
80
+
81
+ template <>
82
+ inline ClientContext &DeserializationData::Get() {
83
+ AssertNotEmpty(contexts);
84
+ return contexts.top();
85
+ }
86
+
87
+ template <>
88
+ inline void DeserializationData::Unset<ClientContext>() {
89
+ AssertNotEmpty(contexts);
90
+ contexts.pop();
91
+ }
92
+
93
+ template <>
94
+ inline void DeserializationData::Set(bound_parameter_map_t &context) {
95
+ parameter_data.push(context);
96
+ }
97
+
98
+ template <>
99
+ inline bound_parameter_map_t &DeserializationData::Get() {
100
+ AssertNotEmpty(parameter_data);
101
+ return parameter_data.top();
102
+ }
103
+
104
+ template <>
105
+ inline void DeserializationData::Unset<bound_parameter_map_t>() {
106
+ AssertNotEmpty(parameter_data);
107
+ parameter_data.pop();
108
+ }
109
+
110
+ } // namespace duckdb
@@ -12,6 +12,7 @@
12
12
  #include "duckdb/common/serializer.hpp"
13
13
  #include "duckdb/common/enum_util.hpp"
14
14
  #include "duckdb/common/serializer/serialization_traits.hpp"
15
+ #include "duckdb/common/serializer/deserialization_data.hpp"
15
16
  #include "duckdb/common/types/interval.hpp"
16
17
  #include "duckdb/common/types/string_type.hpp"
17
18
  #include "duckdb/common/unordered_map.hpp"
@@ -24,6 +25,7 @@ class FormatDeserializer {
24
25
 
25
26
  protected:
26
27
  bool deserialize_enum_from_string = false;
28
+ DeserializationData data;
27
29
 
28
30
  public:
29
31
  // Read into an existing value
@@ -107,6 +109,24 @@ public:
107
109
  ReadDataPtr(ret, count);
108
110
  }
109
111
 
112
+ //! Set a serialization property
113
+ template <class T>
114
+ void Set(T entry) {
115
+ return data.Set<T>(entry);
116
+ }
117
+
118
+ //! Retrieve the last set serialization property of this type
119
+ template <class T>
120
+ T Get() {
121
+ return data.Get<T>();
122
+ }
123
+
124
+ //! Unset a serialization property
125
+ template <class T>
126
+ void Unset() {
127
+ return data.Unset<T>();
128
+ }
129
+
110
130
  private:
111
131
  // Deserialize anything implementing a FormatDeserialize method
112
132
  template <typename T = void>
@@ -152,6 +172,19 @@ private:
152
172
  return vec;
153
173
  }
154
174
 
175
+ template <typename T = void>
176
+ inline typename std::enable_if<is_unsafe_vector<T>::value, T>::type Read() {
177
+ using ELEMENT_TYPE = typename is_unsafe_vector<T>::ELEMENT_TYPE;
178
+ T vec;
179
+ auto size = OnListBegin();
180
+ for (idx_t i = 0; i < size; i++) {
181
+ vec.push_back(Read<ELEMENT_TYPE>());
182
+ }
183
+ OnListEnd();
184
+
185
+ return vec;
186
+ }
187
+
155
188
  // Deserialize a map
156
189
  template <typename T = void>
157
190
  inline typename std::enable_if<is_unordered_map<T>::value, T>::type Read() {
@@ -308,12 +341,24 @@ private:
308
341
  return ReadInterval();
309
342
  }
310
343
 
311
- // Deserialize a interval_t
344
+ // Deserialize a hugeint_t
312
345
  template <typename T = void>
313
346
  inline typename std::enable_if<std::is_same<T, hugeint_t>::value, T>::type Read() {
314
347
  return ReadHugeInt();
315
348
  }
316
349
 
350
+ // Deserialize a LogicalIndex
351
+ template <typename T = void>
352
+ inline typename std::enable_if<std::is_same<T, LogicalIndex>::value, T>::type Read() {
353
+ return LogicalIndex(ReadUnsignedInt64());
354
+ }
355
+
356
+ // Deserialize a PhysicalIndex
357
+ template <typename T = void>
358
+ inline typename std::enable_if<std::is_same<T, PhysicalIndex>::value, T>::type Read() {
359
+ return PhysicalIndex(ReadUnsignedInt64());
360
+ }
361
+
317
362
  protected:
318
363
  virtual void SetTag(const char *tag) {
319
364
  (void)tag;
@@ -28,7 +28,7 @@ protected:
28
28
  public:
29
29
  // Serialize a value
30
30
  template <class T>
31
- typename std::enable_if<!std::is_enum<T>::value, void>::type WriteProperty(const char *tag, T &value) {
31
+ typename std::enable_if<!std::is_enum<T>::value, void>::type WriteProperty(const char *tag, const T &value) {
32
32
  SetTag(tag);
33
33
  WriteValue(value);
34
34
  }
@@ -48,22 +48,8 @@ public:
48
48
  }
49
49
 
50
50
  // Optional pointer
51
- template <class T>
52
- void WriteOptionalProperty(const char *tag, T *ptr) {
53
- SetTag(tag);
54
- if (ptr == nullptr) {
55
- OnOptionalBegin(false);
56
- OnOptionalEnd(false);
57
- } else {
58
- OnOptionalBegin(true);
59
- WriteValue(*ptr);
60
- OnOptionalEnd(true);
61
- }
62
- }
63
-
64
- // Optional unique_ptr
65
- template <class T>
66
- void WriteOptionalProperty(const char *tag, const unique_ptr<T> &ptr) {
51
+ template <class POINTER>
52
+ void WriteOptionalProperty(const char *tag, POINTER &&ptr) {
67
53
  SetTag(tag);
68
54
  if (ptr == nullptr) {
69
55
  OnOptionalBegin(false);
@@ -122,10 +108,20 @@ protected:
122
108
  OnListEnd(count);
123
109
  }
124
110
 
111
+ template <class T>
112
+ void WriteValue(const unsafe_vector<T> &vec) {
113
+ auto count = vec.size();
114
+ OnListBegin(count);
115
+ for (auto &item : vec) {
116
+ WriteValue(item);
117
+ }
118
+ OnListEnd(count);
119
+ }
120
+
125
121
  // UnorderedSet
126
122
  // Serialized the same way as a list/vector
127
123
  template <class T, class HASH, class CMP>
128
- void WriteValue(const unordered_set<T, HASH, CMP> &set) {
124
+ void WriteValue(const duckdb::unordered_set<T, HASH, CMP> &set) {
129
125
  auto count = set.size();
130
126
  OnListBegin(count);
131
127
  for (auto &item : set) {
@@ -137,7 +133,7 @@ protected:
137
133
  // Set
138
134
  // Serialized the same way as a list/vector
139
135
  template <class T, class HASH, class CMP>
140
- void WriteValue(const set<T, HASH, CMP> &set) {
136
+ void WriteValue(const duckdb::set<T, HASH, CMP> &set) {
141
137
  auto count = set.size();
142
138
  OnListBegin(count);
143
139
  for (auto &item : set) {
@@ -148,7 +144,7 @@ protected:
148
144
 
149
145
  // Map
150
146
  template <class K, class V, class HASH, class CMP>
151
- void WriteValue(const std::unordered_map<K, V, HASH, CMP> &map) {
147
+ void WriteValue(const duckdb::unordered_map<K, V, HASH, CMP> &map) {
152
148
  auto count = map.size();
153
149
  OnMapBegin(count);
154
150
  for (auto &item : map) {
@@ -166,7 +162,7 @@ protected:
166
162
 
167
163
  // class or struct implementing `FormatSerialize(FormatSerializer& FormatSerializer)`;
168
164
  template <typename T>
169
- typename std::enable_if<has_serialize<T>::value>::type WriteValue(T &value) {
165
+ typename std::enable_if<has_serialize<T>::value>::type WriteValue(const T &value) {
170
166
  // Else, we defer to the .FormatSerialize method
171
167
  OnObjectBegin();
172
168
  value.FormatSerialize(*this);
@@ -243,6 +239,12 @@ protected:
243
239
  virtual void WriteValue(const char *str) = 0;
244
240
  virtual void WriteValue(interval_t value) = 0;
245
241
  virtual void WriteDataPtr(const_data_ptr_t ptr, idx_t count) = 0;
242
+ void WriteValue(LogicalIndex value) {
243
+ WriteValue(value.index);
244
+ }
245
+ void WriteValue(PhysicalIndex value) {
246
+ WriteValue(value.index);
247
+ }
246
248
  };
247
249
 
248
250
  } // namespace duckdb