duckdb 1.1.2-dev4.0 → 1.1.2-dev6.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 (288) hide show
  1. package/package.json +1 -1
  2. package/src/duckdb/extension/icu/third_party/icu/common/putil.cpp +0 -5
  3. package/src/duckdb/extension/icu/third_party/icu/common/rbbiscan.cpp +1 -1
  4. package/src/duckdb/extension/icu/third_party/icu/common/rbbitblb.cpp +1 -1
  5. package/src/duckdb/extension/icu/third_party/icu/common/ucurr.cpp +1 -1
  6. package/src/duckdb/extension/icu/third_party/icu/common/uresbund.cpp +1 -1
  7. package/src/duckdb/extension/icu/third_party/icu/common/uresimp.h +31 -31
  8. package/src/duckdb/extension/icu/third_party/icu/common/ustring.cpp +1 -1
  9. package/src/duckdb/extension/icu/third_party/icu/common/uvector.cpp +1 -1
  10. package/src/duckdb/extension/icu/third_party/icu/i18n/coleitr.cpp +12 -12
  11. package/src/duckdb/extension/icu/third_party/icu/i18n/format.cpp +1 -1
  12. package/src/duckdb/extension/icu/third_party/icu/i18n/listformatter.cpp +4 -4
  13. package/src/duckdb/extension/icu/third_party/icu/i18n/number_decimalquantity.h +1 -1
  14. package/src/duckdb/extension/icu/third_party/icu/i18n/tzgnames.cpp +1 -1
  15. package/src/duckdb/extension/icu/third_party/icu/i18n/unicode/coleitr.h +28 -28
  16. package/src/duckdb/extension/icu/third_party/icu/i18n/unicode/format.h +7 -7
  17. package/src/duckdb/extension/icu/third_party/icu/i18n/unicode/ucol.h +1 -1
  18. package/src/duckdb/extension/icu/third_party/icu/i18n/unicode/ucoleitr.h +41 -41
  19. package/src/duckdb/extension/icu/third_party/icu/i18n/unicode/umsg.h +41 -41
  20. package/src/duckdb/extension/icu/third_party/icu/i18n/usrchimp.h +3 -3
  21. package/src/duckdb/extension/json/include/json_common.hpp +1 -1
  22. package/src/duckdb/extension/json/json_functions/json_structure.cpp +13 -7
  23. package/src/duckdb/extension/parquet/column_writer.cpp +2 -1
  24. package/src/duckdb/extension/parquet/geo_parquet.cpp +24 -9
  25. package/src/duckdb/extension/parquet/include/geo_parquet.hpp +3 -1
  26. package/src/duckdb/extension/parquet/include/parquet_reader.hpp +1 -0
  27. package/src/duckdb/extension/parquet/include/parquet_rle_bp_decoder.hpp +1 -1
  28. package/src/duckdb/extension/parquet/include/templated_column_reader.hpp +0 -4
  29. package/src/duckdb/extension/parquet/parquet_extension.cpp +20 -6
  30. package/src/duckdb/extension/parquet/parquet_reader.cpp +1 -2
  31. package/src/duckdb/extension/parquet/parquet_writer.cpp +1 -1
  32. package/src/duckdb/extension/parquet/serialize_parquet.cpp +0 -2
  33. package/src/duckdb/src/catalog/catalog_entry/duck_schema_entry.cpp +8 -1
  34. package/src/duckdb/src/catalog/default/default_functions.cpp +5 -5
  35. package/src/duckdb/src/common/allocator.cpp +3 -2
  36. package/src/duckdb/src/common/arrow/arrow_appender.cpp +1 -0
  37. package/src/duckdb/src/common/arrow/arrow_converter.cpp +11 -0
  38. package/src/duckdb/src/common/arrow/schema_metadata.cpp +6 -4
  39. package/src/duckdb/src/common/enum_util.cpp +33 -0
  40. package/src/duckdb/src/common/exception.cpp +3 -0
  41. package/src/duckdb/src/common/extra_type_info.cpp +1 -44
  42. package/src/duckdb/src/common/field_writer.cpp +97 -0
  43. package/src/duckdb/src/common/render_tree.cpp +7 -5
  44. package/src/duckdb/src/common/row_operations/row_match.cpp +359 -0
  45. package/src/duckdb/src/common/serializer/buffered_deserializer.cpp +27 -0
  46. package/src/duckdb/src/common/serializer/buffered_serializer.cpp +36 -0
  47. package/src/duckdb/src/common/serializer/format_serializer.cpp +15 -0
  48. package/src/duckdb/src/common/serializer.cpp +24 -0
  49. package/src/duckdb/src/common/sort/comparators.cpp +2 -2
  50. package/src/duckdb/src/common/types/bit.cpp +57 -34
  51. package/src/duckdb/src/common/types/data_chunk.cpp +32 -29
  52. package/src/duckdb/src/common/types/vector_cache.cpp +12 -6
  53. package/src/duckdb/src/common/vector_operations/comparison_operators.cpp +14 -0
  54. package/src/duckdb/src/core_functions/aggregate/distributive/bitstring_agg.cpp +20 -1
  55. package/src/duckdb/src/core_functions/aggregate/distributive/minmax.cpp +2 -2
  56. package/src/duckdb/src/core_functions/aggregate/holistic/approx_top_k.cpp +32 -7
  57. package/src/duckdb/src/core_functions/function_list.cpp +1 -2
  58. package/src/duckdb/src/core_functions/scalar/bit/bitstring.cpp +23 -5
  59. package/src/duckdb/src/core_functions/scalar/date/date_diff.cpp +12 -6
  60. package/src/duckdb/src/core_functions/scalar/date/date_part.cpp +1 -1
  61. package/src/duckdb/src/execution/expression_executor/execute_between.cpp +4 -3
  62. package/src/duckdb/src/execution/expression_executor/execute_case.cpp +4 -3
  63. package/src/duckdb/src/execution/expression_executor/execute_cast.cpp +2 -1
  64. package/src/duckdb/src/execution/expression_executor/execute_comparison.cpp +3 -2
  65. package/src/duckdb/src/execution/expression_executor/execute_conjunction.cpp +2 -1
  66. package/src/duckdb/src/execution/expression_executor/execute_function.cpp +2 -1
  67. package/src/duckdb/src/execution/expression_executor/execute_operator.cpp +3 -2
  68. package/src/duckdb/src/execution/expression_executor/execute_reference.cpp +1 -1
  69. package/src/duckdb/src/execution/expression_executor.cpp +9 -3
  70. package/src/duckdb/src/execution/expression_executor_state.cpp +11 -9
  71. package/src/duckdb/src/execution/index/art/fixed_size_allocator.cpp +238 -0
  72. package/src/duckdb/src/execution/index/art/plan_art.cpp +94 -0
  73. package/src/duckdb/src/execution/index/index_type_set.cpp +4 -1
  74. package/src/duckdb/src/execution/join_hashtable.cpp +7 -8
  75. package/src/duckdb/src/execution/operator/aggregate/physical_hash_aggregate.cpp +6 -4
  76. package/src/duckdb/src/execution/operator/csv_scanner/buffer_manager/csv_buffer_manager.cpp +4 -4
  77. package/src/duckdb/src/execution/operator/csv_scanner/scanner/base_scanner.cpp +1 -1
  78. package/src/duckdb/src/execution/operator/csv_scanner/scanner/csv_schema.cpp +44 -5
  79. package/src/duckdb/src/execution/operator/csv_scanner/scanner/string_value_scanner.cpp +28 -24
  80. package/src/duckdb/src/execution/operator/csv_scanner/sniffer/csv_sniffer.cpp +25 -26
  81. package/src/duckdb/src/execution/operator/csv_scanner/sniffer/dialect_detection.cpp +5 -3
  82. package/src/duckdb/src/execution/operator/csv_scanner/sniffer/header_detection.cpp +4 -4
  83. package/src/duckdb/src/execution/operator/csv_scanner/sniffer/type_detection.cpp +2 -2
  84. package/src/duckdb/src/execution/operator/csv_scanner/sniffer/type_refinement.cpp +1 -1
  85. package/src/duckdb/src/execution/operator/csv_scanner/sniffer/type_replacement.cpp +1 -1
  86. package/src/duckdb/src/execution/operator/csv_scanner/state_machine/csv_state_machine.cpp +1 -1
  87. package/src/duckdb/src/execution/operator/csv_scanner/state_machine/csv_state_machine_cache.cpp +2 -2
  88. package/src/duckdb/src/execution/operator/csv_scanner/table_function/csv_file_scanner.cpp +1 -1
  89. package/src/duckdb/src/execution/operator/csv_scanner/table_function/global_csv_state.cpp +1 -1
  90. package/src/duckdb/src/execution/operator/csv_scanner/util/csv_reader_options.cpp +73 -27
  91. package/src/duckdb/src/execution/operator/helper/physical_buffered_collector.cpp +1 -1
  92. package/src/duckdb/src/execution/operator/persistent/base_csv_reader.cpp +695 -0
  93. package/src/duckdb/src/execution/operator/persistent/buffered_csv_reader.cpp +1487 -0
  94. package/src/duckdb/src/execution/operator/persistent/csv_buffer.cpp +72 -0
  95. package/src/duckdb/src/execution/operator/persistent/csv_file_handle.cpp +158 -0
  96. package/src/duckdb/src/execution/operator/persistent/csv_reader_options.cpp +280 -0
  97. package/src/duckdb/src/execution/operator/persistent/parallel_csv_reader.cpp +666 -0
  98. package/src/duckdb/src/execution/operator/persistent/physical_export.cpp +14 -4
  99. package/src/duckdb/src/execution/operator/schema/physical_create_index.cpp +207 -0
  100. package/src/duckdb/src/execution/partitionable_hashtable.cpp +207 -0
  101. package/src/duckdb/src/execution/perfect_aggregate_hashtable.cpp +6 -1
  102. package/src/duckdb/src/execution/physical_plan/plan_comparison_join.cpp +0 -4
  103. package/src/duckdb/src/execution/physical_plan/plan_create_index.cpp +14 -87
  104. package/src/duckdb/src/execution/physical_plan/plan_export.cpp +1 -1
  105. package/src/duckdb/src/execution/physical_plan/plan_get.cpp +1 -1
  106. package/src/duckdb/src/execution/reservoir_sample.cpp +1 -1
  107. package/src/duckdb/src/execution/window_executor.cpp +3 -3
  108. package/src/duckdb/src/function/pragma/pragma_queries.cpp +1 -1
  109. package/src/duckdb/src/function/scalar/strftime_format.cpp +1 -2
  110. package/src/duckdb/src/function/scalar/string/concat.cpp +118 -151
  111. package/src/duckdb/src/function/table/arrow.cpp +13 -0
  112. package/src/duckdb/src/function/table/arrow_conversion.cpp +12 -7
  113. package/src/duckdb/src/function/table/copy_csv.cpp +1 -1
  114. package/src/duckdb/src/function/table/read_csv.cpp +2 -30
  115. package/src/duckdb/src/function/table/sniff_csv.cpp +2 -1
  116. package/src/duckdb/src/function/table/system/duckdb_secrets.cpp +15 -7
  117. package/src/duckdb/src/function/table/version/pragma_version.cpp +3 -3
  118. package/src/duckdb/src/include/duckdb/catalog/catalog_entry_retriever.hpp +1 -1
  119. package/src/duckdb/src/include/duckdb/common/atomic.hpp +13 -1
  120. package/src/duckdb/src/include/duckdb/common/bitpacking.hpp +3 -4
  121. package/src/duckdb/src/include/duckdb/common/enum_util.hpp +8 -0
  122. package/src/duckdb/src/include/duckdb/common/enums/metric_type.hpp +2 -0
  123. package/src/duckdb/src/include/duckdb/common/exception.hpp +10 -0
  124. package/src/duckdb/src/include/duckdb/common/extra_type_info/enum_type_info.hpp +53 -0
  125. package/src/duckdb/src/include/duckdb/common/insertion_order_preserving_map.hpp +5 -5
  126. package/src/duckdb/src/include/duckdb/common/multi_file_reader.hpp +5 -0
  127. package/src/duckdb/src/include/duckdb/common/types/bit.hpp +36 -33
  128. package/src/duckdb/src/include/duckdb/common/types/data_chunk.hpp +10 -13
  129. package/src/duckdb/src/include/duckdb/common/types/uhugeint.hpp +1 -1
  130. package/src/duckdb/src/include/duckdb/common/types/vector_cache.hpp +7 -5
  131. package/src/duckdb/src/include/duckdb/common/windows_undefs.hpp +2 -1
  132. package/src/duckdb/src/include/duckdb/core_functions/aggregate/minmax_n_helpers.hpp +2 -0
  133. package/src/duckdb/src/include/duckdb/core_functions/scalar/bit_functions.hpp +1 -1
  134. package/src/duckdb/src/include/duckdb/core_functions/scalar/list_functions.hpp +0 -6
  135. package/src/duckdb/src/include/duckdb/core_functions/scalar/math_functions.hpp +1 -1
  136. package/src/duckdb/src/include/duckdb/execution/expression_executor_state.hpp +3 -2
  137. package/src/duckdb/src/include/duckdb/execution/index/art/art.hpp +3 -0
  138. package/src/duckdb/src/include/duckdb/execution/index/index_type.hpp +16 -1
  139. package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_buffer_manager.hpp +4 -4
  140. package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_reader_options.hpp +4 -2
  141. package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_schema.hpp +3 -2
  142. package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/sniffer/csv_sniffer.hpp +91 -36
  143. package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/sniffer/sniff_result.hpp +36 -0
  144. package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/string_value_scanner.hpp +1 -1
  145. package/src/duckdb/src/include/duckdb/execution/operator/join/perfect_hash_join_executor.hpp +0 -1
  146. package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_export.hpp +2 -5
  147. package/src/duckdb/src/include/duckdb/function/table_function.hpp +1 -1
  148. package/src/duckdb/src/include/duckdb/main/database.hpp +5 -0
  149. package/src/duckdb/src/include/duckdb/main/extension_entries.hpp +1 -0
  150. package/src/duckdb/src/include/duckdb/main/profiling_info.hpp +20 -22
  151. package/src/duckdb/src/include/duckdb/main/query_profiler.hpp +7 -9
  152. package/src/duckdb/src/include/duckdb/main/secret/secret.hpp +8 -1
  153. package/src/duckdb/src/include/duckdb/main/table_description.hpp +14 -0
  154. package/src/duckdb/src/include/duckdb/optimizer/unnest_rewriter.hpp +5 -5
  155. package/src/duckdb/src/include/duckdb/parser/parsed_data/exported_table_data.hpp +15 -5
  156. package/src/duckdb/src/include/duckdb/parser/transformer.hpp +2 -0
  157. package/src/duckdb/src/include/duckdb/planner/expression_binder/order_binder.hpp +4 -0
  158. package/src/duckdb/src/include/duckdb/planner/operator/logical_export.hpp +10 -13
  159. package/src/duckdb/src/include/duckdb/planner/table_filter.hpp +1 -0
  160. package/src/duckdb/src/include/duckdb/storage/metadata/metadata_manager.hpp +2 -2
  161. package/src/duckdb/src/include/duckdb/storage/standard_buffer_manager.hpp +1 -1
  162. package/src/duckdb/src/include/duckdb/storage/statistics/distinct_statistics.hpp +0 -2
  163. package/src/duckdb/src/include/duckdb/storage/table/segment_tree.hpp +1 -0
  164. package/src/duckdb/src/include/duckdb/transaction/duck_transaction.hpp +5 -1
  165. package/src/duckdb/src/include/duckdb.h +2 -2
  166. package/src/duckdb/src/main/appender.cpp +3 -0
  167. package/src/duckdb/src/main/capi/profiling_info-c.cpp +5 -2
  168. package/src/duckdb/src/main/client_context.cpp +8 -2
  169. package/src/duckdb/src/main/connection.cpp +1 -1
  170. package/src/duckdb/src/main/database.cpp +13 -0
  171. package/src/duckdb/src/main/extension/extension_helper.cpp +1 -1
  172. package/src/duckdb/src/main/extension/extension_install.cpp +9 -1
  173. package/src/duckdb/src/main/extension/extension_load.cpp +3 -2
  174. package/src/duckdb/src/main/extension_install_info.cpp +1 -1
  175. package/src/duckdb/src/main/profiling_info.cpp +78 -58
  176. package/src/duckdb/src/main/query_profiler.cpp +79 -89
  177. package/src/duckdb/src/main/relation/read_csv_relation.cpp +1 -1
  178. package/src/duckdb/src/main/secret/secret.cpp +2 -1
  179. package/src/duckdb/src/main/secret/secret_manager.cpp +14 -0
  180. package/src/duckdb/src/optimizer/cte_filter_pusher.cpp +4 -2
  181. package/src/duckdb/src/optimizer/deliminator.cpp +0 -7
  182. package/src/duckdb/src/optimizer/in_clause_rewriter.cpp +7 -0
  183. package/src/duckdb/src/optimizer/pushdown/pushdown_left_join.cpp +4 -1
  184. package/src/duckdb/src/optimizer/unnest_rewriter.cpp +21 -21
  185. package/src/duckdb/src/parallel/task_scheduler.cpp +9 -0
  186. package/src/duckdb/src/parser/parsed_data/exported_table_data.cpp +22 -0
  187. package/src/duckdb/src/parser/parsed_expression_iterator.cpp +3 -0
  188. package/src/duckdb/src/parser/statement/insert_statement.cpp +7 -1
  189. package/src/duckdb/src/parser/transform/expression/transform_boolean_test.cpp +1 -1
  190. package/src/duckdb/src/parser/transform/helpers/transform_typename.cpp +89 -87
  191. package/src/duckdb/src/parser/transform/statement/transform_pivot_stmt.cpp +2 -2
  192. package/src/duckdb/src/planner/binder/expression/bind_macro_expression.cpp +4 -9
  193. package/src/duckdb/src/planner/binder/query_node/bind_select_node.cpp +4 -0
  194. package/src/duckdb/src/planner/binder/query_node/plan_setop.cpp +2 -2
  195. package/src/duckdb/src/planner/binder/statement/bind_create_table.cpp +4 -1
  196. package/src/duckdb/src/planner/binder/statement/bind_export.cpp +4 -3
  197. package/src/duckdb/src/planner/expression_binder/order_binder.cpp +13 -3
  198. package/src/duckdb/src/planner/expression_binder.cpp +1 -1
  199. package/src/duckdb/src/planner/operator/logical_export.cpp +28 -0
  200. package/src/duckdb/src/planner/table_binding.cpp +1 -2
  201. package/src/duckdb/src/planner/table_filter.cpp +6 -2
  202. package/src/duckdb/src/storage/buffer/buffer_pool.cpp +2 -1
  203. package/src/duckdb/src/storage/checkpoint_manager.cpp +1 -1
  204. package/src/duckdb/src/storage/compression/bitpacking.cpp +7 -3
  205. package/src/duckdb/src/storage/compression/dictionary_compression.cpp +1 -1
  206. package/src/duckdb/src/storage/metadata/metadata_manager.cpp +2 -2
  207. package/src/duckdb/src/storage/serialization/serialize_logical_operator.cpp +16 -0
  208. package/src/duckdb/src/storage/serialization/serialize_nodes.cpp +29 -0
  209. package/src/duckdb/src/storage/serialization/serialize_parse_info.cpp +15 -0
  210. package/src/duckdb/src/storage/single_file_block_manager.cpp +2 -1
  211. package/src/duckdb/src/storage/statistics/distinct_statistics.cpp +3 -5
  212. package/src/duckdb/src/storage/storage_info.cpp +4 -4
  213. package/src/duckdb/src/storage/table/row_group_collection.cpp +1 -1
  214. package/src/duckdb/src/storage/table/row_version_manager.cpp +5 -1
  215. package/src/duckdb/src/storage/temporary_file_manager.cpp +1 -1
  216. package/src/duckdb/src/transaction/duck_transaction.cpp +15 -14
  217. package/src/duckdb/third_party/brotli/common/brotli_platform.h +1 -1
  218. package/src/duckdb/third_party/brotli/dec/decode.cpp +1 -1
  219. package/src/duckdb/third_party/brotli/enc/memory.cpp +4 -4
  220. package/src/duckdb/third_party/fsst/libfsst.cpp +1 -1
  221. package/src/duckdb/third_party/hyperloglog/sds.cpp +1 -1
  222. package/src/duckdb/third_party/hyperloglog/sds.hpp +1 -1
  223. package/src/duckdb/third_party/libpg_query/include/common/keywords.hpp +1 -1
  224. package/src/duckdb/third_party/libpg_query/include/datatype/timestamp.hpp +1 -1
  225. package/src/duckdb/third_party/libpg_query/include/mb/pg_wchar.hpp +1 -1
  226. package/src/duckdb/third_party/libpg_query/include/nodes/bitmapset.hpp +1 -1
  227. package/src/duckdb/third_party/libpg_query/include/nodes/lockoptions.hpp +1 -1
  228. package/src/duckdb/third_party/libpg_query/include/nodes/makefuncs.hpp +1 -1
  229. package/src/duckdb/third_party/libpg_query/include/nodes/pg_list.hpp +1 -1
  230. package/src/duckdb/third_party/libpg_query/include/nodes/value.hpp +1 -1
  231. package/src/duckdb/third_party/libpg_query/include/parser/gramparse.hpp +1 -1
  232. package/src/duckdb/third_party/libpg_query/include/parser/parser.hpp +1 -1
  233. package/src/duckdb/third_party/libpg_query/include/parser/scanner.hpp +1 -1
  234. package/src/duckdb/third_party/libpg_query/include/parser/scansup.hpp +1 -1
  235. package/src/duckdb/third_party/libpg_query/include/pg_functions.hpp +1 -1
  236. package/src/duckdb/third_party/libpg_query/pg_functions.cpp +1 -1
  237. package/src/duckdb/third_party/libpg_query/src_backend_nodes_list.cpp +1 -1
  238. package/src/duckdb/third_party/libpg_query/src_backend_nodes_makefuncs.cpp +1 -1
  239. package/src/duckdb/third_party/libpg_query/src_backend_nodes_value.cpp +1 -1
  240. package/src/duckdb/third_party/libpg_query/src_backend_parser_gram.cpp +1964 -1964
  241. package/src/duckdb/third_party/libpg_query/src_backend_parser_parser.cpp +1 -1
  242. package/src/duckdb/third_party/libpg_query/src_backend_parser_scansup.cpp +1 -1
  243. package/src/duckdb/third_party/libpg_query/src_common_keywords.cpp +1 -1
  244. package/src/duckdb/third_party/lz4/lz4.cpp +1 -1
  245. package/src/duckdb/third_party/mbedtls/include/des_alt.h +1 -1
  246. package/src/duckdb/third_party/mbedtls/include/mbedtls/aes_alt.h +1 -1
  247. package/src/duckdb/third_party/mbedtls/include/mbedtls/aria_alt.h +1 -1
  248. package/src/duckdb/third_party/mbedtls/include/mbedtls/asn1write.h +1 -1
  249. package/src/duckdb/third_party/mbedtls/include/mbedtls/camellia_alt.h +1 -1
  250. package/src/duckdb/third_party/mbedtls/include/mbedtls/ccm_alt.h +1 -1
  251. package/src/duckdb/third_party/mbedtls/include/mbedtls/chacha20.h +1 -1
  252. package/src/duckdb/third_party/mbedtls/include/mbedtls/chachapoly.h +1 -1
  253. package/src/duckdb/third_party/mbedtls/include/mbedtls/cmac.h +1 -1
  254. package/src/duckdb/third_party/mbedtls/include/mbedtls/config_psa.h +1 -1
  255. package/src/duckdb/third_party/mbedtls/include/mbedtls/ecdsa.h +1 -1
  256. package/src/duckdb/third_party/mbedtls/include/mbedtls/ecp.h +1 -1
  257. package/src/duckdb/third_party/mbedtls/include/mbedtls/gcm_alt.h +1 -1
  258. package/src/duckdb/third_party/mbedtls/include/mbedtls/md5.h +1 -1
  259. package/src/duckdb/third_party/mbedtls/include/mbedtls/nist_kw.h +1 -1
  260. package/src/duckdb/third_party/mbedtls/include/mbedtls/pkcs12.h +1 -1
  261. package/src/duckdb/third_party/mbedtls/include/mbedtls/pkcs5.h +1 -1
  262. package/src/duckdb/third_party/mbedtls/include/mbedtls/psa_util.h +1 -1
  263. package/src/duckdb/third_party/mbedtls/include/mbedtls/ripemd160.h +1 -1
  264. package/src/duckdb/third_party/mbedtls/include/mbedtls/threading.h +1 -1
  265. package/src/duckdb/third_party/mbedtls/include/mbedtls/timing.h +1 -1
  266. package/src/duckdb/third_party/mbedtls/include/platform_alt.h +1 -1
  267. package/src/duckdb/third_party/mbedtls/include/psa/crypto.h +1 -1
  268. package/src/duckdb/third_party/mbedtls/include/rsa_alt.h +1 -1
  269. package/src/duckdb/third_party/mbedtls/include/sha1_alt.h +1 -1
  270. package/src/duckdb/third_party/mbedtls/include/sha256_alt.h +1 -1
  271. package/src/duckdb/third_party/mbedtls/include/sha512_alt.h +1 -1
  272. package/src/duckdb/third_party/mbedtls/include/ssl_misc.h +1 -1
  273. package/src/duckdb/third_party/mbedtls/library/aesni.h +1 -1
  274. package/src/duckdb/third_party/mbedtls/library/padlock.h +1 -1
  275. package/src/duckdb/third_party/miniz/miniz.cpp +1 -1
  276. package/src/duckdb/third_party/parquet/parquet_types.cpp +1 -1
  277. package/src/duckdb/third_party/parquet/windows_compatibility.h +1 -1
  278. package/src/duckdb/third_party/pcg/pcg_extras.hpp +1 -1
  279. package/src/duckdb/third_party/pcg/pcg_uint128.hpp +1 -1
  280. package/src/duckdb/third_party/skiplist/Node.h +4 -4
  281. package/src/duckdb/third_party/snappy/snappy.cc +1 -1
  282. package/src/duckdb/third_party/snappy/snappy_version.hpp +1 -1
  283. package/src/duckdb/third_party/thrift/thrift/thrift-config.h +1 -1
  284. package/src/duckdb/third_party/zstd/decompress/zstd_decompress_block.cpp +1 -1
  285. package/src/duckdb/third_party/zstd/include/zstd_static.h +1 -1
  286. package/src/duckdb/ub_src_execution_index_art.cpp +2 -0
  287. package/src/duckdb/ub_src_parser_parsed_data.cpp +2 -0
  288. package/src/duckdb/ub_src_planner_operator.cpp +2 -0
@@ -20,26 +20,23 @@ public:
20
20
  static constexpr const LogicalOperatorType TYPE = LogicalOperatorType::LOGICAL_EXPORT;
21
21
 
22
22
  public:
23
- LogicalExport(CopyFunction function, unique_ptr<CopyInfo> copy_info, BoundExportData exported_tables)
24
- : LogicalOperator(LogicalOperatorType::LOGICAL_EXPORT), function(std::move(function)),
25
- copy_info(std::move(copy_info)), exported_tables(std::move(exported_tables)) {
26
- }
27
- CopyFunction function;
23
+ LogicalExport(CopyFunction function, unique_ptr<CopyInfo> copy_info, unique_ptr<BoundExportData> exported_tables);
24
+
28
25
  unique_ptr<CopyInfo> copy_info;
29
- BoundExportData exported_tables;
26
+ CopyFunction function;
27
+ unique_ptr<BoundExportData> exported_tables;
30
28
 
31
- void Serialize(Serializer &serializer) const override {
32
- throw NotImplementedException("FIXME: Serialize LogicalExport statement");
33
- }
34
- unique_ptr<LogicalOperator> Deserialize(Deserializer &deserializer) {
35
- throw NotImplementedException("FIXME: Deserialize LogicalExport statement");
36
- }
29
+ void Serialize(Serializer &serializer) const override;
30
+ static unique_ptr<LogicalOperator> Deserialize(Deserializer &deserializer);
37
31
 
38
- public:
39
32
  protected:
33
+ LogicalExport(ClientContext &context, unique_ptr<ParseInfo> copy_info, unique_ptr<ParseInfo> exported_tables);
34
+
40
35
  void ResolveTypes() override {
41
36
  types.emplace_back(LogicalType::BOOLEAN);
42
37
  }
38
+
39
+ CopyFunction GetCopyFunction(ClientContext &context, CopyInfo &info);
43
40
  };
44
41
 
45
42
  } // namespace duckdb
@@ -45,6 +45,7 @@ public:
45
45
  //! Returns true if the statistics indicate that the segment can contain values that satisfy that filter
46
46
  virtual FilterPropagateResult CheckStatistics(BaseStatistics &stats) = 0;
47
47
  virtual string ToString(const string &column_name) = 0;
48
+ string DebugToString();
48
49
  virtual unique_ptr<TableFilter> Copy() const = 0;
49
50
  virtual bool Equals(const TableFilter &other) const {
50
51
  return filter_type != other.filter_type;
@@ -50,9 +50,9 @@ public:
50
50
  ~MetadataManager();
51
51
 
52
52
  MetadataHandle AllocateHandle();
53
- MetadataHandle Pin(MetadataPointer pointer);
53
+ MetadataHandle Pin(const MetadataPointer &pointer);
54
54
 
55
- MetaBlockPointer GetDiskPointer(MetadataPointer pointer, uint32_t offset = 0);
55
+ MetaBlockPointer GetDiskPointer(const MetadataPointer &pointer, uint32_t offset = 0);
56
56
  MetadataPointer FromDiskPointer(MetaBlockPointer pointer);
57
57
  MetadataPointer RegisterDiskPointer(MetaBlockPointer pointer);
58
58
 
@@ -76,7 +76,7 @@ public:
76
76
  void SetMemoryLimit(idx_t limit = (idx_t)-1) final;
77
77
  void SetSwapLimit(optional_idx limit = optional_idx()) final;
78
78
 
79
- //! Returns informaton about memory usage
79
+ //! Returns information about memory usage
80
80
  vector<MemoryInformation> GetMemoryUsageInfo() const override;
81
81
 
82
82
  //! Returns a list of all temporary files
@@ -52,8 +52,6 @@ private:
52
52
  static constexpr double INTEGRAL_SAMPLE_RATE = 0.3;
53
53
  //! For concurrent access
54
54
  mutable mutex lock;
55
- //! Preallocated vector for hashes
56
- Vector hash_vec;
57
55
  };
58
56
 
59
57
  } // namespace duckdb
@@ -145,6 +145,7 @@ public:
145
145
  }
146
146
  SegmentNode<T> node;
147
147
  segment->index = nodes.size();
148
+ segment->next = nullptr;
148
149
  node.row_start = segment->start;
149
150
  node.node = std::move(segment);
150
151
  nodes.push_back(std::move(node));
@@ -102,8 +102,12 @@ private:
102
102
  reference_map_t<RowGroupCollection, shared_ptr<RowGroupCollection>> updated_collections;
103
103
  //! Lock for the active_locks map
104
104
  mutex active_locks_lock;
105
+ struct ActiveTableLock {
106
+ mutex checkpoint_lock_mutex; // protects access to the checkpoint_lock field in this class
107
+ weak_ptr<CheckpointLock> checkpoint_lock;
108
+ };
105
109
  //! Active locks on tables
106
- reference_map_t<DataTableInfo, weak_ptr<CheckpointLock>> active_locks;
110
+ reference_map_t<DataTableInfo, unique_ptr<ActiveTableLock>> active_locks;
107
111
  };
108
112
 
109
113
  } // namespace duckdb
@@ -626,12 +626,12 @@ typedef struct _duckdb_arrow_array {
626
626
  //===--------------------------------------------------------------------===//
627
627
  //! Passed to C API extension as parameter to the entrypoint
628
628
  struct duckdb_extension_access {
629
- //! Indicate that an error has occured
629
+ //! Indicate that an error has occurred
630
630
  void (*set_error)(duckdb_extension_info info, const char *error);
631
631
  //! Fetch the database from duckdb to register extensions to
632
632
  duckdb_database *(*get_database)(duckdb_extension_info info);
633
633
  //! Fetch the API
634
- void *(*get_api)(duckdb_extension_info info, const char *version);
634
+ const void *(*get_api)(duckdb_extension_info info, const char *version);
635
635
  };
636
636
 
637
637
  //===--------------------------------------------------------------------===//
@@ -62,6 +62,9 @@ Appender::Appender(Connection &con, const string &schema_name, const string &tab
62
62
  }
63
63
  vector<optional_ptr<const ParsedExpression>> defaults;
64
64
  for (auto &column : description->columns) {
65
+ if (column.Generated()) {
66
+ continue;
67
+ }
65
68
  types.push_back(column.Type());
66
69
  defaults.push_back(column.HasDefaultValue() ? &column.DefaultValue() : nullptr);
67
70
  }
@@ -30,7 +30,7 @@ duckdb_value duckdb_profiling_info_get_value(duckdb_profiling_info info, const c
30
30
  auto &node = *reinterpret_cast<duckdb::ProfilingNode *>(info);
31
31
  auto &profiling_info = node.GetProfilingInfo();
32
32
  auto key_enum = EnumUtil::FromString<MetricsType>(duckdb::StringUtil::Upper(key));
33
- if (!profiling_info.Enabled(key_enum)) {
33
+ if (!profiling_info.Enabled(profiling_info.settings, key_enum)) {
34
34
  return nullptr;
35
35
  }
36
36
 
@@ -46,10 +46,13 @@ duckdb_value duckdb_profiling_info_get_metrics(duckdb_profiling_info info) {
46
46
  auto &node = *reinterpret_cast<duckdb::ProfilingNode *>(info);
47
47
  auto &profiling_info = node.GetProfilingInfo();
48
48
 
49
- // FIXME: filter between operator metrics and query node metrics.
50
49
  duckdb::unordered_map<duckdb::string, duckdb::string> metrics_map;
51
50
  for (const auto &metric : profiling_info.metrics) {
52
51
  auto key = EnumUtil::ToString(metric.first);
52
+ if (!profiling_info.Enabled(profiling_info.settings, metric.first)) {
53
+ continue;
54
+ }
55
+
53
56
  if (key == EnumUtil::ToString(MetricsType::OPERATOR_TYPE)) {
54
57
  auto type = duckdb::PhysicalOperatorType(metric.second.GetValue<uint8_t>());
55
58
  metrics_map[key] = EnumUtil::ToString(type);
@@ -1132,13 +1132,19 @@ void ClientContext::Append(TableDescription &description, ColumnDataCollection &
1132
1132
  auto &table_entry =
1133
1133
  Catalog::GetEntry<TableCatalogEntry>(*this, INVALID_CATALOG, description.schema, description.table);
1134
1134
  // verify that the table columns and types match up
1135
- if (description.columns.size() != table_entry.GetColumns().PhysicalColumnCount()) {
1135
+ if (description.PhysicalColumnCount() != table_entry.GetColumns().PhysicalColumnCount()) {
1136
1136
  throw InvalidInputException("Failed to append: table entry has different number of columns!");
1137
1137
  }
1138
+ idx_t table_entry_col_idx = 0;
1138
1139
  for (idx_t i = 0; i < description.columns.size(); i++) {
1139
- if (description.columns[i].Type() != table_entry.GetColumns().GetColumn(PhysicalIndex(i)).Type()) {
1140
+ auto &column = description.columns[i];
1141
+ if (column.Generated()) {
1142
+ continue;
1143
+ }
1144
+ if (column.Type() != table_entry.GetColumns().GetColumn(PhysicalIndex(table_entry_col_idx)).Type()) {
1140
1145
  throw InvalidInputException("Failed to append: table entry has different number of columns!");
1141
1146
  }
1147
+ table_entry_col_idx++;
1142
1148
  }
1143
1149
  auto binder = Binder::CreateBinder(*this);
1144
1150
  auto bound_constraints = binder->BindConstraints(table_entry);
@@ -19,7 +19,7 @@
19
19
  namespace duckdb {
20
20
 
21
21
  Connection::Connection(DatabaseInstance &database)
22
- : context(make_shared_ptr<ClientContext>(database.shared_from_this())) {
22
+ : context(make_shared_ptr<ClientContext>(database.shared_from_this())), warning_cb(nullptr) {
23
23
  ConnectionManager::Get(database).AddConnection(*context);
24
24
  #ifdef DEBUG
25
25
  EnableProfiling();
@@ -25,6 +25,7 @@
25
25
  #include "duckdb/storage/storage_extension.hpp"
26
26
  #include "duckdb/storage/storage_manager.hpp"
27
27
  #include "duckdb/transaction/transaction_manager.hpp"
28
+ #include "duckdb/main/capi/extension_api.hpp"
28
29
 
29
30
  #ifndef DUCKDB_NO_THREADS
30
31
  #include "duckdb/common/thread.hpp"
@@ -56,6 +57,7 @@ DBConfig::~DBConfig() {
56
57
 
57
58
  DatabaseInstance::DatabaseInstance() {
58
59
  config.is_user_config = false;
60
+ create_api_v0 = nullptr;
59
61
  }
60
62
 
61
63
  DatabaseInstance::~DatabaseInstance() {
@@ -258,6 +260,10 @@ void DatabaseInstance::LoadExtensionSettings() {
258
260
  }
259
261
  }
260
262
 
263
+ static duckdb_ext_api_v0 CreateAPIv0Wrapper() {
264
+ return CreateAPIv0();
265
+ }
266
+
261
267
  void DatabaseInstance::Initialize(const char *database_path, DBConfig *user_config) {
262
268
  DBConfig default_config;
263
269
  DBConfig *config_ptr = &default_config;
@@ -267,6 +273,8 @@ void DatabaseInstance::Initialize(const char *database_path, DBConfig *user_conf
267
273
 
268
274
  Configure(*config_ptr, database_path);
269
275
 
276
+ create_api_v0 = CreateAPIv0Wrapper;
277
+
270
278
  if (user_config && !user_config->options.use_temporary_directory) {
271
279
  // temporary directories explicitly disabled
272
280
  config.options.temporary_directory = string();
@@ -504,6 +512,11 @@ ValidChecker &DatabaseInstance::GetValidChecker() {
504
512
  return db_validity;
505
513
  }
506
514
 
515
+ const duckdb_ext_api_v0 DatabaseInstance::GetExtensionAPIV0() {
516
+ D_ASSERT(create_api_v0);
517
+ return create_api_v0();
518
+ }
519
+
507
520
  ValidChecker &ValidChecker::Get(DatabaseInstance &db) {
508
521
  return db.GetValidChecker();
509
522
  }
@@ -363,7 +363,7 @@ ExtensionUpdateResult ExtensionHelper::UpdateExtension(ClientContext &context, c
363
363
  throw InvalidInputException("Failed to update the extension '%s', the extension is not installed!",
364
364
  extension_name);
365
365
  } else if (update_result.tag == ExtensionUpdateResultTag::UNKNOWN) {
366
- throw InternalException("Failed to update extension '%s', an unknown error ocurred", extension_name);
366
+ throw InternalException("Failed to update extension '%s', an unknown error occurred", extension_name);
367
367
  }
368
368
  return update_result;
369
369
  }
@@ -358,7 +358,15 @@ static unique_ptr<ExtensionInstallInfo> InstallFromHttpUrl(DatabaseInstance &db,
358
358
  {
359
359
  auto fs = FileSystem::CreateLocal();
360
360
  if (fs->FileExists(local_extension_path + ".info")) {
361
- install_info = ExtensionInstallInfo::TryReadInfoFile(*fs, local_extension_path + ".info", extension_name);
361
+ try {
362
+ install_info =
363
+ ExtensionInstallInfo::TryReadInfoFile(*fs, local_extension_path + ".info", extension_name);
364
+ } catch (...) {
365
+ if (!options.force_install) {
366
+ // We are going to rewrite the file anyhow, so this is fine
367
+ throw;
368
+ }
369
+ }
362
370
  }
363
371
  }
364
372
 
@@ -91,7 +91,7 @@ struct ExtensionAccess {
91
91
  }
92
92
 
93
93
  //! Called by the extension get a pointer the correctly versioned extension C API struct.
94
- static void *GetAPI(duckdb_extension_info info, const char *version) {
94
+ static const void *GetAPI(duckdb_extension_info info, const char *version) {
95
95
 
96
96
  string version_string = version;
97
97
  idx_t major, minor, patch;
@@ -106,7 +106,8 @@ struct ExtensionAccess {
106
106
  "Unsupported C CAPI version detected during extension initialization: " + string(version));
107
107
  return nullptr;
108
108
  }
109
- load_state.api_struct = CreateAPIv0();
109
+
110
+ load_state.api_struct = load_state.db.GetExtensionAPIV0();
110
111
  return &load_state.api_struct;
111
112
  }
112
113
  };
@@ -100,7 +100,7 @@ unique_ptr<ExtensionInstallInfo> ExtensionInstallInfo::TryReadInfoFile(FileSyste
100
100
  } catch (std::exception &ex) {
101
101
  ErrorData error(ex);
102
102
  throw IOException(
103
- "Failed to read info file for '%s' extension: '%s'.\nA serialization error occured: '%s'\n%s",
103
+ "Failed to read info file for '%s' extension: '%s'.\nA serialization error occurred: '%s'\n%s",
104
104
  extension_name, info_file_path, error.RawMessage(), hint);
105
105
  }
106
106
  }
@@ -9,44 +9,53 @@ using namespace duckdb_yyjson; // NOLINT
9
9
 
10
10
  namespace duckdb {
11
11
 
12
+ ProfilingInfo::ProfilingInfo(const profiler_settings_t &n_settings, const idx_t depth) : settings(n_settings) {
13
+ // Expand.
14
+ if (depth == 0) {
15
+ settings.insert(MetricsType::QUERY_NAME);
16
+ } else {
17
+ settings.insert(MetricsType::OPERATOR_TYPE);
18
+ }
19
+ for (const auto &metric : settings) {
20
+ Expand(expanded_settings, metric);
21
+ }
22
+
23
+ // Reduce.
24
+ if (depth == 0) {
25
+ auto op_metrics = DefaultOperatorSettings();
26
+ for (const auto metric : op_metrics) {
27
+ settings.erase(metric);
28
+ }
29
+ } else {
30
+ auto root_metrics = DefaultRootSettings();
31
+ for (const auto metric : root_metrics) {
32
+ settings.erase(metric);
33
+ }
34
+ }
35
+ ResetMetrics();
36
+ }
37
+
12
38
  profiler_settings_t ProfilingInfo::DefaultSettings() {
13
39
  return {MetricsType::QUERY_NAME, MetricsType::BLOCKED_THREAD_TIME, MetricsType::CPU_TIME,
14
40
  MetricsType::EXTRA_INFO, MetricsType::CUMULATIVE_CARDINALITY, MetricsType::OPERATOR_TYPE,
15
41
  MetricsType::OPERATOR_CARDINALITY, MetricsType::CUMULATIVE_ROWS_SCANNED, MetricsType::OPERATOR_ROWS_SCANNED,
16
- MetricsType::OPERATOR_TIMING, MetricsType::RESULT_SET_SIZE};
42
+ MetricsType::OPERATOR_TIMING, MetricsType::RESULT_SET_SIZE, MetricsType::LATENCY,
43
+ MetricsType::ROWS_RETURNED};
17
44
  }
18
45
 
19
- profiler_settings_t ProfilingInfo::DefaultOperatorSettings() {
20
- return {MetricsType::OPERATOR_CARDINALITY, MetricsType::OPERATOR_ROWS_SCANNED, MetricsType::OPERATOR_TIMING,
21
- MetricsType::RESULT_SET_SIZE};
46
+ profiler_settings_t ProfilingInfo::DefaultRootSettings() {
47
+ return {MetricsType::QUERY_NAME, MetricsType::BLOCKED_THREAD_TIME, MetricsType::LATENCY,
48
+ MetricsType::ROWS_RETURNED};
22
49
  }
23
50
 
24
- profiler_settings_t ProfilingInfo::AllSettings() {
25
- auto all_settings = DefaultSettings();
26
- auto optimizer_settings = MetricsUtils::GetOptimizerMetrics();
27
- auto phase_timings = MetricsUtils::GetPhaseTimingMetrics();
28
-
29
- for (auto &setting : optimizer_settings) {
30
- all_settings.insert(setting);
31
- }
32
-
33
- for (auto &setting : phase_timings) {
34
- all_settings.insert(setting);
35
- }
36
-
37
- return all_settings;
51
+ profiler_settings_t ProfilingInfo::DefaultOperatorSettings() {
52
+ return {MetricsType::OPERATOR_CARDINALITY, MetricsType::OPERATOR_ROWS_SCANNED, MetricsType::OPERATOR_TIMING,
53
+ MetricsType::OPERATOR_TYPE};
38
54
  }
39
55
 
40
56
  void ProfilingInfo::ResetMetrics() {
41
57
  metrics.clear();
42
-
43
- auto all_settings = AllSettings();
44
-
45
- for (auto &metric : all_settings) {
46
- if (!Enabled(metric)) {
47
- continue;
48
- }
49
-
58
+ for (auto &metric : expanded_settings) {
50
59
  if (MetricsUtils::IsOptimizerMetric(metric) || MetricsUtils::IsPhaseTimingMetric(metric)) {
51
60
  metrics[metric] = Value::CreateValue(0.0);
52
61
  continue;
@@ -54,24 +63,25 @@ void ProfilingInfo::ResetMetrics() {
54
63
 
55
64
  switch (metric) {
56
65
  case MetricsType::QUERY_NAME:
66
+ metrics[metric] = Value::CreateValue("");
67
+ break;
68
+ case MetricsType::LATENCY:
57
69
  case MetricsType::BLOCKED_THREAD_TIME:
58
70
  case MetricsType::CPU_TIME:
59
- case MetricsType::OPERATOR_TIMING: {
71
+ case MetricsType::OPERATOR_TIMING:
60
72
  metrics[metric] = Value::CreateValue(0.0);
61
73
  break;
62
- }
63
- case MetricsType::OPERATOR_TYPE: {
74
+ case MetricsType::OPERATOR_TYPE:
64
75
  metrics[metric] = Value::CreateValue<uint8_t>(0);
65
76
  break;
66
- }
77
+ case MetricsType::ROWS_RETURNED:
67
78
  case MetricsType::RESULT_SET_SIZE:
68
79
  case MetricsType::CUMULATIVE_CARDINALITY:
69
80
  case MetricsType::OPERATOR_CARDINALITY:
70
81
  case MetricsType::CUMULATIVE_ROWS_SCANNED:
71
- case MetricsType::OPERATOR_ROWS_SCANNED: {
82
+ case MetricsType::OPERATOR_ROWS_SCANNED:
72
83
  metrics[metric] = Value::CreateValue<uint64_t>(0);
73
84
  break;
74
- }
75
85
  case MetricsType::EXTRA_INFO:
76
86
  break;
77
87
  default:
@@ -80,35 +90,45 @@ void ProfilingInfo::ResetMetrics() {
80
90
  }
81
91
  }
82
92
 
83
- bool ProfilingInfo::Enabled(const MetricsType setting) const {
84
- if (settings.find(setting) != settings.end()) {
93
+ bool ProfilingInfo::Enabled(const profiler_settings_t &settings, const MetricsType metric) {
94
+ if (settings.find(metric) != settings.end()) {
85
95
  return true;
86
96
  }
97
+ return false;
98
+ }
87
99
 
88
- switch (setting) {
89
- case MetricsType::OPERATOR_TIMING:
90
- return Enabled(MetricsType::CPU_TIME);
91
- case MetricsType::OPERATOR_CARDINALITY:
92
- return Enabled(MetricsType::CUMULATIVE_CARDINALITY);
93
- case MetricsType::OPERATOR_ROWS_SCANNED:
94
- return Enabled(MetricsType::CUMULATIVE_ROWS_SCANNED);
95
- default:
96
- break;
100
+ void ProfilingInfo::Expand(profiler_settings_t &settings, const MetricsType metric) {
101
+ settings.insert(metric);
102
+
103
+ switch (metric) {
104
+ case MetricsType::CPU_TIME:
105
+ settings.insert(MetricsType::OPERATOR_TIMING);
106
+ return;
107
+ case MetricsType::CUMULATIVE_CARDINALITY:
108
+ settings.insert(MetricsType::OPERATOR_CARDINALITY);
109
+ return;
110
+ case MetricsType::CUMULATIVE_ROWS_SCANNED:
111
+ settings.insert(MetricsType::OPERATOR_ROWS_SCANNED);
112
+ return;
113
+ case MetricsType::CUMULATIVE_OPTIMIZER_TIMING:
114
+ case MetricsType::ALL_OPTIMIZERS: {
115
+ auto optimizer_metrics = MetricsUtils::GetOptimizerMetrics();
116
+ for (const auto optimizer_metric : optimizer_metrics) {
117
+ settings.insert(optimizer_metric);
118
+ }
119
+ return;
97
120
  }
98
-
99
- if (MetricsUtils::IsOptimizerMetric(setting)) {
100
- return Enabled(MetricsType::CUMULATIVE_OPTIMIZER_TIMING);
121
+ default:
122
+ return;
101
123
  }
102
-
103
- return false;
104
124
  }
105
125
 
106
- string ProfilingInfo::GetMetricAsString(MetricsType setting) const {
107
- if (!Enabled(setting)) {
108
- throw InternalException("Metric %s not enabled", EnumUtil::ToString(setting));
126
+ string ProfilingInfo::GetMetricAsString(const MetricsType metric) const {
127
+ if (!Enabled(settings, metric)) {
128
+ throw InternalException("Metric %s not enabled", EnumUtil::ToString(metric));
109
129
  }
110
130
 
111
- if (setting == MetricsType::EXTRA_INFO) {
131
+ if (metric == MetricsType::EXTRA_INFO) {
112
132
  string result;
113
133
  for (auto &it : extra_info) {
114
134
  if (!result.empty()) {
@@ -120,14 +140,12 @@ string ProfilingInfo::GetMetricAsString(MetricsType setting) const {
120
140
  }
121
141
 
122
142
  // The metric cannot be NULL and must be initialized.
123
- D_ASSERT(!metrics.at(setting).IsNull());
124
-
125
- if (setting == MetricsType::OPERATOR_TYPE) {
126
- auto type = PhysicalOperatorType(metrics.at(setting).GetValue<uint8_t>());
143
+ D_ASSERT(!metrics.at(metric).IsNull());
144
+ if (metric == MetricsType::OPERATOR_TYPE) {
145
+ auto type = PhysicalOperatorType(metrics.at(metric).GetValue<uint8_t>());
127
146
  return EnumUtil::ToString(type);
128
147
  }
129
-
130
- return metrics.at(setting).ToString();
148
+ return metrics.at(metric).ToString();
131
149
  }
132
150
 
133
151
  void ProfilingInfo::WriteMetricsToJSON(yyjson_mut_doc *doc, yyjson_mut_val *dest) {
@@ -169,6 +187,7 @@ void ProfilingInfo::WriteMetricsToJSON(yyjson_mut_doc *doc, yyjson_mut_val *dest
169
187
  case MetricsType::QUERY_NAME:
170
188
  yyjson_mut_obj_add_strcpy(doc, dest, key_ptr, metrics[metric].GetValue<string>().c_str());
171
189
  break;
190
+ case MetricsType::LATENCY:
172
191
  case MetricsType::BLOCKED_THREAD_TIME:
173
192
  case MetricsType::CPU_TIME:
174
193
  case MetricsType::OPERATOR_TIMING: {
@@ -179,6 +198,7 @@ void ProfilingInfo::WriteMetricsToJSON(yyjson_mut_doc *doc, yyjson_mut_val *dest
179
198
  yyjson_mut_obj_add_strcpy(doc, dest, key_ptr, GetMetricAsString(metric).c_str());
180
199
  break;
181
200
  }
201
+ case MetricsType::ROWS_RETURNED:
182
202
  case MetricsType::RESULT_SET_SIZE:
183
203
  case MetricsType::CUMULATIVE_CARDINALITY:
184
204
  case MetricsType::OPERATOR_CARDINALITY: