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
@@ -8,25 +8,50 @@
8
8
 
9
9
  #pragma once
10
10
 
11
- #include "duckdb/execution/operator/csv_scanner/state_machine/csv_state_machine.hpp"
11
+ #include "duckdb/execution/operator/csv_scanner/csv_state_machine.hpp"
12
12
  #include "duckdb/common/vector.hpp"
13
- #include "duckdb/execution/operator/csv_scanner/sniffer/quote_rules.hpp"
14
- #include "duckdb/execution/operator/csv_scanner/scanner/column_count_scanner.hpp"
13
+ #include "duckdb/execution/operator/csv_scanner/quote_rules.hpp"
14
+ #include "duckdb/execution/operator/csv_scanner/column_count_scanner.hpp"
15
+ #include "duckdb/execution/operator/csv_scanner/csv_schema.hpp"
16
+ #include "duckdb/execution/operator/csv_scanner/header_value.hpp"
17
+ #include "duckdb/execution/operator/csv_scanner/sniffer/sniff_result.hpp"
15
18
 
16
19
  namespace duckdb {
17
20
  struct DateTimestampSniffing {
18
21
  bool initialized = false;
22
+ bool had_match = false;
19
23
  vector<string> format;
24
+ idx_t initial_size;
20
25
  };
21
- //! Struct to store the result of the Sniffer
22
- struct SnifferResult {
23
- SnifferResult(vector<LogicalType> return_types_p, vector<string> names_p)
24
- : return_types(std::move(return_types_p)), names(std::move(names_p)) {
25
- }
26
- //! Return Types that were detected
27
- vector<LogicalType> return_types;
28
- //! Column Names that were detected
29
- vector<string> names;
26
+
27
+ //! All the options that will be used to sniff the dialect of the CSV file
28
+ struct DialectCandidates {
29
+ //! The constructor populates all of our the options that will be used in our sniffer search space
30
+ explicit DialectCandidates(const CSVStateMachineOptions &options);
31
+
32
+ //! Static functions to get defaults of the search space
33
+ static vector<char> GetDefaultDelimiter();
34
+
35
+ static vector<vector<char>> GetDefaultQuote();
36
+
37
+ static vector<QuoteRule> GetDefaultQuoteRule();
38
+
39
+ static vector<vector<char>> GetDefaultEscape();
40
+
41
+ static vector<char> GetDefaultComment();
42
+
43
+ string Print();
44
+
45
+ //! Candidates for the delimiter
46
+ vector<char> delim_candidates;
47
+ //! Candidates for the comment
48
+ vector<char> comment_candidates;
49
+ //! Quote-Rule Candidates
50
+ vector<QuoteRule> quote_rule_candidates;
51
+ //! Candidates for the quote option
52
+ unordered_map<uint8_t, vector<char>> quote_candidates_map;
53
+ //! Candidates for the escape option
54
+ unordered_map<uint8_t, vector<char>> escape_candidates_map;
30
55
  };
31
56
 
32
57
  //! This represents the data related to columns that have been set by the user
@@ -45,12 +70,12 @@ struct SetColumns {
45
70
  //! Column Names that were detected
46
71
  const vector<string> *names = nullptr;
47
72
  //! If columns are set
48
- bool IsSet();
73
+ bool IsSet() const;
49
74
  //! How many columns
50
- idx_t Size();
75
+ idx_t Size() const;
51
76
  //! Helper function that checks if candidate is acceptable based on the number of columns it produces
52
- inline bool IsCandidateUnacceptable(idx_t num_cols, bool null_padding, bool ignore_errors,
53
- bool last_value_always_empty) {
77
+ inline bool IsCandidateUnacceptable(const idx_t num_cols, bool null_padding, bool ignore_errors,
78
+ bool last_value_always_empty) const {
54
79
  if (!IsSet() || ignore_errors) {
55
80
  // We can't say its unacceptable if it's not set or if we ignore errors
56
81
  return false;
@@ -74,11 +99,17 @@ struct SetColumns {
74
99
  }
75
100
  };
76
101
 
102
+ //! Struct used to know if we have a date or timestamp type already identified in this CSV File
103
+ struct HasType {
104
+ bool date = false;
105
+ bool timestamp = false;
106
+ };
107
+
77
108
  //! Sniffer that detects Header, Dialect and Types of CSV Files
78
109
  class CSVSniffer {
79
110
  public:
80
111
  explicit CSVSniffer(CSVReaderOptions &options_p, shared_ptr<CSVBufferManager> buffer_manager_p,
81
- CSVStateMachineCache &state_machine_cache, SetColumns set_columns = {});
112
+ CSVStateMachineCache &state_machine_cache, bool default_null_to_varchar = true);
82
113
 
83
114
  //! Main method that sniffs the CSV file, returns the types, names and options as a result
84
115
  //! CSV Sniffing consists of five steps:
@@ -89,8 +120,22 @@ public:
89
120
  //! 5. Type Replacement: Replaces the types of the columns if the user specified them
90
121
  SnifferResult SniffCSV(bool force_match = false);
91
122
 
123
+ //! I call it adaptive, since that's a sexier term.
124
+ //! In practice this Function that only sniffs the first two rows, to verify if a header exists and what are the
125
+ //! data types It does this considering a priorly set CSV schema. If there is a mismatch of the schema it runs the
126
+ //! full on blazing all guns sniffer, if that still fails it tells the user to union_by_name.
127
+ //! It returns the projection order.
128
+ SnifferResult AdaptiveSniff(const CSVSchema &file_schema);
129
+
130
+ //! Function that only sniffs the first two rows, to verify if a header exists and what are the data types
131
+ AdaptiveSnifferResult MinimalSniff();
132
+
92
133
  static NewLineIdentifier DetectNewLineDelimiter(CSVBufferManager &buffer_manager);
93
134
 
135
+ //! If a string_t value can be cast to a type
136
+ static bool CanYouCastIt(ClientContext &context, const string_t value, const LogicalType &type,
137
+ const DialectOptions &dialect_options, const bool is_null, const char decimal_separator);
138
+
94
139
  private:
95
140
  //! CSV State Machine Cache
96
141
  CSVStateMachineCache &state_machine_cache;
@@ -106,6 +151,7 @@ private:
106
151
  SetColumns set_columns;
107
152
  shared_ptr<CSVErrorHandler> error_handler;
108
153
  shared_ptr<CSVErrorHandler> detection_error_handler;
154
+
109
155
  //! Sets the result options
110
156
  void SetResultOptions();
111
157
 
@@ -115,42 +161,41 @@ private:
115
161
  //! First phase of auto detection: detect CSV dialect (i.e. delimiter, quote rules, etc)
116
162
  void DetectDialect();
117
163
  //! Functions called in the main DetectDialect(); function
118
- //! 1. Generates the search space candidates for the dialect
119
- void GenerateCandidateDetectionSearchSpace(vector<char> &delim_candidates, vector<QuoteRule> &quoterule_candidates,
120
- unordered_map<uint8_t, vector<char>> &quote_candidates_map,
121
- unordered_map<uint8_t, vector<char>> &escape_candidates_map);
122
- //! 2. Generates the search space candidates for the state machines
164
+ //! 1. Generates the search space candidates for the state machines
123
165
  void GenerateStateMachineSearchSpace(vector<unique_ptr<ColumnCountScanner>> &column_count_scanners,
124
- const vector<char> &delimiter_candidates,
125
- const vector<QuoteRule> &quoterule_candidates,
126
- const unordered_map<uint8_t, vector<char>> &quote_candidates_map,
127
- const unordered_map<uint8_t, vector<char>> &escape_candidates_map);
128
- //! 3. Analyzes if dialect candidate is a good candidate to be considered, if so, it adds it to the candidates
166
+ const DialectCandidates &dialect_candidates);
167
+
168
+ //! 2. Analyzes if dialect candidate is a good candidate to be considered, if so, it adds it to the candidates
129
169
  void AnalyzeDialectCandidate(unique_ptr<ColumnCountScanner>, idx_t &rows_read, idx_t &best_consistent_rows,
130
- idx_t &prev_padding_count);
131
- //! 4. Refine Candidates over remaining chunks
170
+ idx_t &prev_padding_count, idx_t &min_ignored_rows);
171
+ //! 3. Refine Candidates over remaining chunks
132
172
  void RefineCandidates();
133
173
 
134
174
  //! Checks if candidate still produces good values for the next chunk
135
- bool RefineCandidateNextChunk(ColumnCountScanner &candidate);
175
+ bool RefineCandidateNextChunk(ColumnCountScanner &candidate) const;
136
176
 
137
177
  //! ------------------------------------------------------//
138
178
  //! ------------------- Type Detection ------------------ //
139
179
  //! ------------------------------------------------------//
140
- //! Second phase of auto detection: detect types, format template candidates
180
+ //! Second phase of auto-detection: detect types, format template candidates
141
181
  //! ordered by descending specificity (~ from high to low)
142
182
  void DetectTypes();
143
183
  //! Change the date format for the type to the string
144
184
  //! Try to cast a string value to the specified sql type
145
- bool TryCastValue(CSVStateMachine &candidate, const Value &value, const LogicalType &sql_type);
146
- void SetDateFormat(CSVStateMachine &candidate, const string &format_specifier, const LogicalTypeId &sql_type);
185
+ static void SetDateFormat(CSVStateMachine &candidate, const string &format_specifier,
186
+ const LogicalTypeId &sql_type);
147
187
 
148
188
  //! Function that initialized the necessary variables used for date and timestamp detection
149
189
  void InitializeDateAndTimeStampDetection(CSVStateMachine &candidate, const string &separator,
150
190
  const LogicalType &sql_type);
191
+ //! Sets user defined date and time formats (if any)
192
+ void SetUserDefinedDateTimeFormat(CSVStateMachine &candidate) const;
151
193
  //! Functions that performs detection for date and timestamp formats
152
194
  void DetectDateAndTimeStampFormats(CSVStateMachine &candidate, const LogicalType &sql_type, const string &separator,
153
- Value &dummy_val);
195
+ const string_t &dummy_val);
196
+ //! Sniffs the types from a data chunk
197
+ void SniffTypes(DataChunk &data_chunk, CSVStateMachine &state_machine,
198
+ unordered_map<idx_t, vector<LogicalType>> &info_sql_types_candidates, idx_t start_idx_detection);
154
199
 
155
200
  //! Variables for Type Detection
156
201
  //! Format Candidates for Date and Timestamp Types
@@ -163,9 +208,10 @@ private:
163
208
  unordered_map<idx_t, vector<LogicalType>> best_sql_types_candidates_per_column_idx;
164
209
  map<LogicalTypeId, vector<string>> best_format_candidates;
165
210
  unique_ptr<StringValueScanner> best_candidate;
166
- vector<Value> best_header_row;
211
+ vector<HeaderValue> best_header_row;
167
212
  //! Variable used for sniffing date and timestamp
168
213
  map<LogicalTypeId, DateTimestampSniffing> format_candidates;
214
+ map<LogicalTypeId, DateTimestampSniffing> original_format_candidates;
169
215
 
170
216
  //! ------------------------------------------------------//
171
217
  //! ------------------ Type Refinement ------------------ //
@@ -173,17 +219,26 @@ private:
173
219
  void RefineTypes();
174
220
  bool TryCastVector(Vector &parse_chunk_col, idx_t size, const LogicalType &sql_type);
175
221
  vector<LogicalType> detected_types;
176
-
222
+ //! If when finding a SQLNULL type in type detection we default it to varchar
223
+ const bool default_null_to_varchar;
177
224
  //! ------------------------------------------------------//
178
225
  //! ------------------ Header Detection ----------------- //
179
226
  //! ------------------------------------------------------//
180
227
  void DetectHeader();
228
+ static bool DetectHeaderWithSetColumn(ClientContext &context, vector<HeaderValue> &best_header_row,
229
+ const SetColumns &set_columns, CSVReaderOptions &options);
230
+ static vector<string>
231
+ DetectHeaderInternal(ClientContext &context, vector<HeaderValue> &best_header_row, CSVStateMachine &state_machine,
232
+ const SetColumns &set_columns,
233
+ unordered_map<idx_t, vector<LogicalType>> &best_sql_types_candidates_per_column_idx,
234
+ CSVReaderOptions &options, CSVErrorHandler &error_handler);
181
235
  vector<string> names;
182
236
 
183
237
  //! ------------------------------------------------------//
184
238
  //! ------------------ Type Replacement ----------------- //
185
239
  //! ------------------------------------------------------//
186
240
  void ReplaceTypes();
241
+ vector<bool> manually_set;
187
242
  };
188
243
 
189
244
  } // namespace duckdb
@@ -0,0 +1,36 @@
1
+ //===----------------------------------------------------------------------===//
2
+ // DuckDB
3
+ //
4
+ // duckdb/execution/operator/csv_scanner/sniffer/sniff_result.hpp
5
+ //
6
+ //
7
+ //===----------------------------------------------------------------------===//
8
+
9
+ #pragma once
10
+
11
+ #include "duckdb/execution/operator/csv_scanner/csv_state_machine.hpp"
12
+ #include "duckdb/common/vector.hpp"
13
+
14
+ namespace duckdb {
15
+
16
+ //! Struct to store the result of the Sniffer
17
+ struct SnifferResult {
18
+ SnifferResult(vector<LogicalType> return_types_p, vector<string> names_p)
19
+ : return_types(std::move(return_types_p)), names(std::move(names_p)) {
20
+ }
21
+ //! Return Types that were detected
22
+ vector<LogicalType> return_types;
23
+ //! Column Names that were detected
24
+ vector<string> names;
25
+ };
26
+
27
+ struct AdaptiveSnifferResult : SnifferResult {
28
+ AdaptiveSnifferResult(vector<LogicalType> return_types_p, vector<string> names_p, bool more_than_one_row_p)
29
+ : SnifferResult(std::move(return_types_p), std::move(names_p)), more_than_one_row(more_than_one_row_p) {
30
+ }
31
+ bool more_than_one_row;
32
+ SnifferResult ToSnifferResult() {
33
+ return {return_types, names};
34
+ }
35
+ };
36
+ } // namespace duckdb
@@ -186,7 +186,7 @@ public:
186
186
 
187
187
  //! Internal Data Chunk used for flushing
188
188
  DataChunk parse_chunk;
189
- idx_t number_of_rows = 0;
189
+ int64_t number_of_rows = 0;
190
190
  idx_t cur_col_id = 0;
191
191
  bool figure_out_new_line = false;
192
192
  //! Information to properly handle errors
@@ -26,7 +26,6 @@ struct PerfectHashJoinStats {
26
26
  Value probe_max;
27
27
  bool is_build_small = false;
28
28
  bool is_build_dense = false;
29
- bool is_probe_in_domain = false;
30
29
  idx_t build_range = 0;
31
30
  idx_t estimated_cardinality = 0;
32
31
  };
@@ -34,17 +34,14 @@ public:
34
34
 
35
35
  public:
36
36
  PhysicalExport(vector<LogicalType> types, CopyFunction function, unique_ptr<CopyInfo> info,
37
- idx_t estimated_cardinality, BoundExportData exported_tables)
38
- : PhysicalOperator(PhysicalOperatorType::EXPORT, std::move(types), estimated_cardinality),
39
- function(std::move(function)), info(std::move(info)), exported_tables(std::move(exported_tables)) {
40
- }
37
+ idx_t estimated_cardinality, unique_ptr<BoundExportData> exported_tables);
41
38
 
42
39
  //! The copy function to use to read the file
43
40
  CopyFunction function;
44
41
  //! The binding info containing the set of options for reading the file
45
42
  unique_ptr<CopyInfo> info;
46
43
  //! The table info for each table that will be exported
47
- BoundExportData exported_tables;
44
+ unique_ptr<BoundExportData> exported_tables;
48
45
 
49
46
  public:
50
47
  // Source interface
@@ -242,7 +242,7 @@ public:
242
242
  //! The returned FunctionData object should be constant and should not be changed during execution.
243
243
  table_function_bind_t bind;
244
244
  //! (Optional) Bind replace function
245
- //! This function is called before the regular bind function. It allows returning a TableRef will be used to
245
+ //! This function is called before the regular bind function. It allows returning a TableRef that will be used to
246
246
  //! to generate a logical plan that replaces the LogicalGet of a regularly bound TableFunction. The BindReplace can
247
247
  //! also return a nullptr to indicate a regular bind needs to be performed instead.
248
248
  table_function_bind_replace_t bind_replace;
@@ -12,6 +12,7 @@
12
12
  #include "duckdb/main/valid_checker.hpp"
13
13
  #include "duckdb/common/winapi.hpp"
14
14
  #include "duckdb/main/extension.hpp"
15
+ #include "duckdb/main/capi/extension_api.hpp"
15
16
  #include "duckdb/main/extension_install_info.hpp"
16
17
  #include "duckdb/main/settings.hpp"
17
18
 
@@ -58,6 +59,8 @@ public:
58
59
  DUCKDB_API ValidChecker &GetValidChecker();
59
60
  DUCKDB_API void SetExtensionLoaded(const string &extension_name, ExtensionInstallInfo &install_info);
60
61
 
62
+ DUCKDB_API const duckdb_ext_api_v0 GetExtensionAPIV0();
63
+
61
64
  idx_t NumberOfThreads();
62
65
 
63
66
  DUCKDB_API static DatabaseInstance &GetDatabase(ClientContext &context);
@@ -91,6 +94,8 @@ private:
91
94
  ValidChecker db_validity;
92
95
  unique_ptr<DatabaseFileSystem> db_file_system;
93
96
  shared_ptr<DatabaseCacheEntry> db_cache_entry;
97
+
98
+ duckdb_ext_api_v0 (*create_api_v0)();
94
99
  };
95
100
 
96
101
  //! The database object. This object holds the catalog and all the
@@ -410,6 +410,7 @@ static constexpr ExtensionEntry EXTENSION_SETTINGS[] = {
410
410
  {"binary_as_string", "parquet"},
411
411
  {"ca_cert_file", "httpfs"},
412
412
  {"calendar", "icu"},
413
+ {"enable_geoparquet_conversion", "parquet"},
413
414
  {"enable_server_cert_verification", "httpfs"},
414
415
  {"force_download", "httpfs"},
415
416
  {"hf_max_per_page", "httpfs"},
@@ -26,38 +26,36 @@ namespace duckdb {
26
26
 
27
27
  class ProfilingInfo {
28
28
  public:
29
- // Enabling a metric adds it to this set.
29
+ //! Enabling a metric adds it to this set.
30
30
  profiler_settings_t settings;
31
- // Contains all enabled metrics.
31
+ //! This set contains the expanded to-be-collected metrics, which can differ from 'settings'.
32
+ profiler_settings_t expanded_settings;
33
+ //! Contains all enabled metrics.
32
34
  profiler_metrics_t metrics;
33
- // Additional metrics.
35
+ //! Additional metrics.
34
36
  // FIXME: move to metrics.
35
37
  InsertionOrderPreservingMap<string> extra_info;
36
38
 
37
39
  public:
38
40
  ProfilingInfo() = default;
39
- explicit ProfilingInfo(profiler_settings_t &n_settings, idx_t depth = 0) : settings(n_settings) {
40
- if (depth == 0) {
41
- settings.insert(MetricsType::QUERY_NAME);
42
- } else {
43
- settings.insert(MetricsType::OPERATOR_TYPE);
44
- }
45
- ResetMetrics();
46
- }
41
+ explicit ProfilingInfo(const profiler_settings_t &n_settings, const idx_t depth = 0);
47
42
  ProfilingInfo(ProfilingInfo &) = default;
48
43
  ProfilingInfo &operator=(ProfilingInfo const &) = default;
49
44
 
50
45
  public:
51
46
  static profiler_settings_t DefaultSettings();
47
+ static profiler_settings_t DefaultRootSettings();
52
48
  static profiler_settings_t DefaultOperatorSettings();
53
- static profiler_settings_t AllSettings();
54
49
 
55
50
  public:
56
51
  void ResetMetrics();
57
- bool Enabled(const MetricsType setting) const;
52
+ //! Returns true, if the query profiler must collect this metric.
53
+ static bool Enabled(const profiler_settings_t &settings, const MetricsType metric);
54
+ //! Expand metrics depending on the collection of other metrics.
55
+ static void Expand(profiler_settings_t &settings, const MetricsType metric);
58
56
 
59
57
  public:
60
- string GetMetricAsString(MetricsType setting) const;
58
+ string GetMetricAsString(const MetricsType metric) const;
61
59
  void WriteMetricsToJSON(duckdb_yyjson::yyjson_mut_doc *doc, duckdb_yyjson::yyjson_mut_val *destination);
62
60
 
63
61
  public:
@@ -68,20 +66,20 @@ public:
68
66
  }
69
67
 
70
68
  template <class METRIC_TYPE>
71
- void AddToMetric(const MetricsType setting, const Value &value) {
72
- D_ASSERT(!metrics[setting].IsNull());
73
- if (metrics.find(setting) == metrics.end()) {
74
- metrics[setting] = value;
69
+ void AddToMetric(const MetricsType type, const Value &value) {
70
+ D_ASSERT(!metrics[type].IsNull());
71
+ if (metrics.find(type) == metrics.end()) {
72
+ metrics[type] = value;
75
73
  return;
76
74
  }
77
- auto new_value = metrics[setting].GetValue<METRIC_TYPE>() + value.GetValue<METRIC_TYPE>();
78
- metrics[setting] = Value::CreateValue(new_value);
75
+ auto new_value = metrics[type].GetValue<METRIC_TYPE>() + value.GetValue<METRIC_TYPE>();
76
+ metrics[type] = Value::CreateValue(new_value);
79
77
  }
80
78
 
81
79
  template <class METRIC_TYPE>
82
- void AddToMetric(const MetricsType setting, const METRIC_TYPE &value) {
80
+ void AddToMetric(const MetricsType type, const METRIC_TYPE &value) {
83
81
  auto new_value = Value::CreateValue(value);
84
- return AddToMetric<METRIC_TYPE>(setting, new_value);
82
+ return AddToMetric<METRIC_TYPE>(type, new_value);
85
83
  }
86
84
  };
87
85
  } // namespace duckdb
@@ -64,7 +64,10 @@ class OperatorProfiler {
64
64
 
65
65
  public:
66
66
  DUCKDB_API explicit OperatorProfiler(ClientContext &context);
67
+ ~OperatorProfiler() {
68
+ }
67
69
 
70
+ public:
68
71
  DUCKDB_API void StartOperator(optional_ptr<const PhysicalOperator> phys_op);
69
72
  DUCKDB_API void EndOperator(optional_ptr<DataChunk> chunk);
70
73
 
@@ -72,20 +75,14 @@ public:
72
75
  DUCKDB_API void Flush(const PhysicalOperator &phys_op);
73
76
  DUCKDB_API OperatorInformation &GetOperatorInfo(const PhysicalOperator &phys_op);
74
77
 
75
- ~OperatorProfiler() {
76
- }
77
-
78
+ public:
78
79
  ClientContext &context;
79
80
 
80
- bool HasOperatorSetting(const MetricsType &metric) const {
81
- return operator_settings.find(metric) != operator_settings.end();
82
- }
83
-
84
81
  private:
85
82
  //! Whether or not the profiler is enabled
86
83
  bool enabled;
87
84
  //! Sub-settings for the operator profiler
88
- profiler_settings_t operator_settings;
85
+ profiler_settings_t settings;
89
86
 
90
87
  //! The timer used to time the execution time of the individual Physical Operators
91
88
  Profiler op;
@@ -113,7 +110,8 @@ public:
113
110
  using TreeMap = reference_map_t<const PhysicalOperator, reference<ProfilingNode>>;
114
111
 
115
112
  private:
116
- unique_ptr<ProfilingNode> CreateTree(const PhysicalOperator &root, profiler_settings_t settings, idx_t depth = 0);
113
+ unique_ptr<ProfilingNode> CreateTree(const PhysicalOperator &root, const profiler_settings_t &settings,
114
+ const idx_t depth = 0);
117
115
  void Render(const ProfilingNode &node, std::ostream &str) const;
118
116
 
119
117
  public:
@@ -80,6 +80,13 @@ struct SecretType {
80
80
  string default_provider;
81
81
  };
82
82
 
83
+ enum class SecretSerializationType : uint8_t {
84
+ //! The secret is serialized with a custom serialization function
85
+ CUSTOM = 0,
86
+ //! The secret has been serialized as a KeyValueSecret
87
+ KEY_VALUE_SECRET = 1
88
+ };
89
+
83
90
  //! Base class from which BaseSecret classes can be made.
84
91
  class BaseSecret {
85
92
  friend class SecretManager;
@@ -187,7 +194,7 @@ public:
187
194
 
188
195
  for (const auto &entry : ListValue::GetChildren(secret_map_value)) {
189
196
  auto kv_struct = StructValue::GetChildren(entry);
190
- result->secret_map[kv_struct[0].ToString()] = kv_struct[1].ToString();
197
+ result->secret_map[kv_struct[0].ToString()] = kv_struct[1];
191
198
  }
192
199
 
193
200
  Value redact_set_value;
@@ -13,12 +13,26 @@
13
13
  namespace duckdb {
14
14
 
15
15
  struct TableDescription {
16
+ public:
16
17
  //! The schema of the table
17
18
  string schema;
18
19
  //! The table name of the table
19
20
  string table;
20
21
  //! The columns of the table
21
22
  vector<ColumnDefinition> columns;
23
+
24
+ public:
25
+ idx_t PhysicalColumnCount() const {
26
+ idx_t count = 0;
27
+ for (auto &column : columns) {
28
+ if (column.Generated()) {
29
+ continue;
30
+ }
31
+ count++;
32
+ }
33
+ D_ASSERT(count != 0);
34
+ return count;
35
+ }
22
36
  };
23
37
 
24
38
  } // namespace duckdb
@@ -8,8 +8,8 @@
8
8
 
9
9
  #pragma once
10
10
 
11
- #include "duckdb/planner/logical_operator.hpp"
12
11
  #include "duckdb/common/pair.hpp"
12
+ #include "duckdb/planner/logical_operator.hpp"
13
13
 
14
14
  namespace duckdb {
15
15
 
@@ -61,14 +61,14 @@ public:
61
61
 
62
62
  private:
63
63
  //! Find delim joins that contain an UNNEST
64
- void FindCandidates(unique_ptr<LogicalOperator> *op_ptr, vector<unique_ptr<LogicalOperator> *> &candidates);
64
+ void FindCandidates(unique_ptr<LogicalOperator> &op, vector<reference<unique_ptr<LogicalOperator>>> &candidates);
65
65
  //! Rewrite a delim join that contains an UNNEST
66
- bool RewriteCandidate(unique_ptr<LogicalOperator> *candidate);
66
+ bool RewriteCandidate(unique_ptr<LogicalOperator> &candidate);
67
67
  //! Update the bindings of the RHS sequence of LOGICAL_PROJECTION(s)
68
- void UpdateRHSBindings(unique_ptr<LogicalOperator> *plan_ptr, unique_ptr<LogicalOperator> *candidate,
68
+ void UpdateRHSBindings(unique_ptr<LogicalOperator> &plan, unique_ptr<LogicalOperator> &candidate,
69
69
  UnnestRewriterPlanUpdater &updater);
70
70
  //! Update the bindings of the BOUND_UNNEST expression of the LOGICAL_UNNEST
71
- void UpdateBoundUnnestBindings(UnnestRewriterPlanUpdater &updater, unique_ptr<LogicalOperator> *candidate);
71
+ void UpdateBoundUnnestBindings(UnnestRewriterPlanUpdater &updater, unique_ptr<LogicalOperator> &candidate);
72
72
 
73
73
  //! Store all delim columns of the delim join
74
74
  void GetDelimColumns(LogicalOperator &op);
@@ -1,7 +1,7 @@
1
1
  //===----------------------------------------------------------------------===//
2
2
  // DuckDB
3
3
  //
4
- // duckdb/parser/parsed_data/export_table_data.hpp
4
+ // duckdb/parser/parsed_data/exported_table_data.hpp
5
5
  //
6
6
  //
7
7
  //===----------------------------------------------------------------------===//
@@ -28,16 +28,23 @@ struct ExportedTableData {
28
28
  string file_path;
29
29
  //! Not Null columns, if any
30
30
  vector<string> not_null_columns;
31
+
32
+ void Serialize(Serializer &serializer) const;
33
+ static ExportedTableData Deserialize(Deserializer &deserializer);
31
34
  };
32
35
 
33
36
  struct ExportedTableInfo {
34
- ExportedTableInfo(TableCatalogEntry &entry, ExportedTableData table_data_p, vector<string> &not_null_columns_p)
35
- : entry(entry), table_data(std::move(table_data_p)) {
36
- table_data.not_null_columns = not_null_columns_p;
37
- }
37
+ ExportedTableInfo(TableCatalogEntry &entry, ExportedTableData table_data_p, vector<string> &not_null_columns_p);
38
+ ExportedTableInfo(ClientContext &context, ExportedTableData table_data);
38
39
 
39
40
  TableCatalogEntry &entry;
40
41
  ExportedTableData table_data;
42
+
43
+ void Serialize(Serializer &serializer) const;
44
+ static ExportedTableInfo Deserialize(Deserializer &deserializer);
45
+
46
+ private:
47
+ static TableCatalogEntry &GetEntry(ClientContext &context, const ExportedTableData &table_data);
41
48
  };
42
49
 
43
50
  struct BoundExportData : public ParseInfo {
@@ -49,6 +56,9 @@ public:
49
56
  }
50
57
 
51
58
  vector<ExportedTableInfo> data;
59
+
60
+ void Serialize(Serializer &serializer) const override;
61
+ static unique_ptr<ParseInfo> Deserialize(Deserializer &deserializer);
52
62
  };
53
63
 
54
64
  } // namespace duckdb
@@ -323,6 +323,8 @@ private:
323
323
  //! Transform a range var into a (schema) qualified name
324
324
  QualifiedName TransformQualifiedName(duckdb_libpgquery::PGRangeVar &root);
325
325
 
326
+ //! Transform a Postgres TypeName string into a LogicalType (non-LIST types)
327
+ LogicalType TransformTypeNameInternal(duckdb_libpgquery::PGTypeName &name);
326
328
  //! Transform a Postgres TypeName string into a LogicalType
327
329
  LogicalType TransformTypeName(duckdb_libpgquery::PGTypeName &name);
328
330
 
@@ -37,6 +37,9 @@ public:
37
37
 
38
38
  unique_ptr<Expression> CreateExtraReference(unique_ptr<ParsedExpression> expr);
39
39
 
40
+ //! Sets the query component, for error messages
41
+ void SetQueryComponent(string component = string());
42
+
40
43
  private:
41
44
  unique_ptr<Expression> CreateProjectionReference(ParsedExpression &expr, const idx_t index);
42
45
  unique_ptr<Expression> BindConstant(ParsedExpression &expr);
@@ -46,6 +49,7 @@ private:
46
49
  vector<reference<Binder>> binders;
47
50
  optional_ptr<vector<unique_ptr<ParsedExpression>>> extra_list;
48
51
  SelectBindState &bind_state;
52
+ string query_component = "ORDER BY";
49
53
  };
50
54
 
51
55
  } // namespace duckdb