duckdb 1.1.2-dev2.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 (289) hide show
  1. package/binding.gyp +4 -2
  2. package/package.json +1 -1
  3. package/src/duckdb/extension/icu/third_party/icu/common/putil.cpp +0 -5
  4. package/src/duckdb/extension/icu/third_party/icu/common/rbbiscan.cpp +1 -1
  5. package/src/duckdb/extension/icu/third_party/icu/common/rbbitblb.cpp +1 -1
  6. package/src/duckdb/extension/icu/third_party/icu/common/ucurr.cpp +1 -1
  7. package/src/duckdb/extension/icu/third_party/icu/common/uresbund.cpp +1 -1
  8. package/src/duckdb/extension/icu/third_party/icu/common/uresimp.h +31 -31
  9. package/src/duckdb/extension/icu/third_party/icu/common/ustring.cpp +1 -1
  10. package/src/duckdb/extension/icu/third_party/icu/common/uvector.cpp +1 -1
  11. package/src/duckdb/extension/icu/third_party/icu/i18n/coleitr.cpp +12 -12
  12. package/src/duckdb/extension/icu/third_party/icu/i18n/format.cpp +1 -1
  13. package/src/duckdb/extension/icu/third_party/icu/i18n/listformatter.cpp +4 -4
  14. package/src/duckdb/extension/icu/third_party/icu/i18n/number_decimalquantity.h +1 -1
  15. package/src/duckdb/extension/icu/third_party/icu/i18n/tzgnames.cpp +1 -1
  16. package/src/duckdb/extension/icu/third_party/icu/i18n/unicode/coleitr.h +28 -28
  17. package/src/duckdb/extension/icu/third_party/icu/i18n/unicode/format.h +7 -7
  18. package/src/duckdb/extension/icu/third_party/icu/i18n/unicode/ucol.h +1 -1
  19. package/src/duckdb/extension/icu/third_party/icu/i18n/unicode/ucoleitr.h +41 -41
  20. package/src/duckdb/extension/icu/third_party/icu/i18n/unicode/umsg.h +41 -41
  21. package/src/duckdb/extension/icu/third_party/icu/i18n/usrchimp.h +3 -3
  22. package/src/duckdb/extension/json/include/json_common.hpp +1 -1
  23. package/src/duckdb/extension/json/json_functions/json_structure.cpp +13 -7
  24. package/src/duckdb/extension/parquet/column_writer.cpp +2 -1
  25. package/src/duckdb/extension/parquet/geo_parquet.cpp +24 -9
  26. package/src/duckdb/extension/parquet/include/geo_parquet.hpp +3 -1
  27. package/src/duckdb/extension/parquet/include/parquet_reader.hpp +1 -0
  28. package/src/duckdb/extension/parquet/include/parquet_rle_bp_decoder.hpp +1 -1
  29. package/src/duckdb/extension/parquet/include/templated_column_reader.hpp +0 -4
  30. package/src/duckdb/extension/parquet/parquet_extension.cpp +20 -6
  31. package/src/duckdb/extension/parquet/parquet_reader.cpp +1 -2
  32. package/src/duckdb/extension/parquet/parquet_writer.cpp +1 -1
  33. package/src/duckdb/extension/parquet/serialize_parquet.cpp +0 -2
  34. package/src/duckdb/src/catalog/catalog_entry/duck_schema_entry.cpp +8 -1
  35. package/src/duckdb/src/catalog/default/default_functions.cpp +5 -5
  36. package/src/duckdb/src/common/allocator.cpp +3 -2
  37. package/src/duckdb/src/common/arrow/arrow_appender.cpp +1 -0
  38. package/src/duckdb/src/common/arrow/arrow_converter.cpp +11 -0
  39. package/src/duckdb/src/common/arrow/schema_metadata.cpp +6 -4
  40. package/src/duckdb/src/common/enum_util.cpp +33 -0
  41. package/src/duckdb/src/common/exception.cpp +3 -0
  42. package/src/duckdb/src/common/extra_type_info.cpp +1 -44
  43. package/src/duckdb/src/common/field_writer.cpp +97 -0
  44. package/src/duckdb/src/common/render_tree.cpp +7 -5
  45. package/src/duckdb/src/common/row_operations/row_match.cpp +359 -0
  46. package/src/duckdb/src/common/serializer/buffered_deserializer.cpp +27 -0
  47. package/src/duckdb/src/common/serializer/buffered_serializer.cpp +36 -0
  48. package/src/duckdb/src/common/serializer/format_serializer.cpp +15 -0
  49. package/src/duckdb/src/common/serializer.cpp +24 -0
  50. package/src/duckdb/src/common/sort/comparators.cpp +2 -2
  51. package/src/duckdb/src/common/types/bit.cpp +57 -34
  52. package/src/duckdb/src/common/types/data_chunk.cpp +32 -29
  53. package/src/duckdb/src/common/types/vector_cache.cpp +12 -6
  54. package/src/duckdb/src/common/vector_operations/comparison_operators.cpp +14 -0
  55. package/src/duckdb/src/core_functions/aggregate/distributive/bitstring_agg.cpp +20 -1
  56. package/src/duckdb/src/core_functions/aggregate/distributive/minmax.cpp +2 -2
  57. package/src/duckdb/src/core_functions/aggregate/holistic/approx_top_k.cpp +32 -7
  58. package/src/duckdb/src/core_functions/function_list.cpp +1 -2
  59. package/src/duckdb/src/core_functions/scalar/bit/bitstring.cpp +23 -5
  60. package/src/duckdb/src/core_functions/scalar/date/date_diff.cpp +12 -6
  61. package/src/duckdb/src/core_functions/scalar/date/date_part.cpp +1 -1
  62. package/src/duckdb/src/execution/expression_executor/execute_between.cpp +4 -3
  63. package/src/duckdb/src/execution/expression_executor/execute_case.cpp +4 -3
  64. package/src/duckdb/src/execution/expression_executor/execute_cast.cpp +2 -1
  65. package/src/duckdb/src/execution/expression_executor/execute_comparison.cpp +3 -2
  66. package/src/duckdb/src/execution/expression_executor/execute_conjunction.cpp +2 -1
  67. package/src/duckdb/src/execution/expression_executor/execute_function.cpp +2 -1
  68. package/src/duckdb/src/execution/expression_executor/execute_operator.cpp +3 -2
  69. package/src/duckdb/src/execution/expression_executor/execute_reference.cpp +1 -1
  70. package/src/duckdb/src/execution/expression_executor.cpp +9 -3
  71. package/src/duckdb/src/execution/expression_executor_state.cpp +11 -9
  72. package/src/duckdb/src/execution/index/art/fixed_size_allocator.cpp +238 -0
  73. package/src/duckdb/src/execution/index/art/plan_art.cpp +94 -0
  74. package/src/duckdb/src/execution/index/index_type_set.cpp +4 -1
  75. package/src/duckdb/src/execution/join_hashtable.cpp +7 -8
  76. package/src/duckdb/src/execution/operator/aggregate/physical_hash_aggregate.cpp +6 -4
  77. package/src/duckdb/src/execution/operator/csv_scanner/buffer_manager/csv_buffer_manager.cpp +4 -4
  78. package/src/duckdb/src/execution/operator/csv_scanner/scanner/base_scanner.cpp +1 -1
  79. package/src/duckdb/src/execution/operator/csv_scanner/scanner/csv_schema.cpp +44 -5
  80. package/src/duckdb/src/execution/operator/csv_scanner/scanner/string_value_scanner.cpp +28 -24
  81. package/src/duckdb/src/execution/operator/csv_scanner/sniffer/csv_sniffer.cpp +25 -26
  82. package/src/duckdb/src/execution/operator/csv_scanner/sniffer/dialect_detection.cpp +5 -3
  83. package/src/duckdb/src/execution/operator/csv_scanner/sniffer/header_detection.cpp +4 -4
  84. package/src/duckdb/src/execution/operator/csv_scanner/sniffer/type_detection.cpp +2 -2
  85. package/src/duckdb/src/execution/operator/csv_scanner/sniffer/type_refinement.cpp +1 -1
  86. package/src/duckdb/src/execution/operator/csv_scanner/sniffer/type_replacement.cpp +1 -1
  87. package/src/duckdb/src/execution/operator/csv_scanner/state_machine/csv_state_machine.cpp +1 -1
  88. package/src/duckdb/src/execution/operator/csv_scanner/state_machine/csv_state_machine_cache.cpp +2 -2
  89. package/src/duckdb/src/execution/operator/csv_scanner/table_function/csv_file_scanner.cpp +1 -1
  90. package/src/duckdb/src/execution/operator/csv_scanner/table_function/global_csv_state.cpp +1 -1
  91. package/src/duckdb/src/execution/operator/csv_scanner/util/csv_reader_options.cpp +73 -27
  92. package/src/duckdb/src/execution/operator/helper/physical_buffered_collector.cpp +1 -1
  93. package/src/duckdb/src/execution/operator/persistent/base_csv_reader.cpp +695 -0
  94. package/src/duckdb/src/execution/operator/persistent/buffered_csv_reader.cpp +1487 -0
  95. package/src/duckdb/src/execution/operator/persistent/csv_buffer.cpp +72 -0
  96. package/src/duckdb/src/execution/operator/persistent/csv_file_handle.cpp +158 -0
  97. package/src/duckdb/src/execution/operator/persistent/csv_reader_options.cpp +280 -0
  98. package/src/duckdb/src/execution/operator/persistent/parallel_csv_reader.cpp +666 -0
  99. package/src/duckdb/src/execution/operator/persistent/physical_export.cpp +14 -4
  100. package/src/duckdb/src/execution/operator/schema/physical_create_index.cpp +207 -0
  101. package/src/duckdb/src/execution/partitionable_hashtable.cpp +207 -0
  102. package/src/duckdb/src/execution/perfect_aggregate_hashtable.cpp +6 -1
  103. package/src/duckdb/src/execution/physical_plan/plan_comparison_join.cpp +0 -4
  104. package/src/duckdb/src/execution/physical_plan/plan_create_index.cpp +14 -87
  105. package/src/duckdb/src/execution/physical_plan/plan_export.cpp +1 -1
  106. package/src/duckdb/src/execution/physical_plan/plan_get.cpp +1 -1
  107. package/src/duckdb/src/execution/reservoir_sample.cpp +1 -1
  108. package/src/duckdb/src/execution/window_executor.cpp +3 -3
  109. package/src/duckdb/src/function/pragma/pragma_queries.cpp +1 -1
  110. package/src/duckdb/src/function/scalar/strftime_format.cpp +1 -2
  111. package/src/duckdb/src/function/scalar/string/concat.cpp +118 -151
  112. package/src/duckdb/src/function/table/arrow.cpp +13 -0
  113. package/src/duckdb/src/function/table/arrow_conversion.cpp +12 -7
  114. package/src/duckdb/src/function/table/copy_csv.cpp +1 -1
  115. package/src/duckdb/src/function/table/read_csv.cpp +2 -30
  116. package/src/duckdb/src/function/table/sniff_csv.cpp +2 -1
  117. package/src/duckdb/src/function/table/system/duckdb_secrets.cpp +15 -7
  118. package/src/duckdb/src/function/table/version/pragma_version.cpp +3 -3
  119. package/src/duckdb/src/include/duckdb/catalog/catalog_entry_retriever.hpp +1 -1
  120. package/src/duckdb/src/include/duckdb/common/atomic.hpp +13 -1
  121. package/src/duckdb/src/include/duckdb/common/bitpacking.hpp +3 -4
  122. package/src/duckdb/src/include/duckdb/common/enum_util.hpp +8 -0
  123. package/src/duckdb/src/include/duckdb/common/enums/metric_type.hpp +2 -0
  124. package/src/duckdb/src/include/duckdb/common/exception.hpp +10 -0
  125. package/src/duckdb/src/include/duckdb/common/extra_type_info/enum_type_info.hpp +53 -0
  126. package/src/duckdb/src/include/duckdb/common/insertion_order_preserving_map.hpp +5 -5
  127. package/src/duckdb/src/include/duckdb/common/multi_file_reader.hpp +5 -0
  128. package/src/duckdb/src/include/duckdb/common/types/bit.hpp +36 -33
  129. package/src/duckdb/src/include/duckdb/common/types/data_chunk.hpp +10 -13
  130. package/src/duckdb/src/include/duckdb/common/types/uhugeint.hpp +1 -1
  131. package/src/duckdb/src/include/duckdb/common/types/vector_cache.hpp +7 -5
  132. package/src/duckdb/src/include/duckdb/common/windows_undefs.hpp +2 -1
  133. package/src/duckdb/src/include/duckdb/core_functions/aggregate/minmax_n_helpers.hpp +2 -0
  134. package/src/duckdb/src/include/duckdb/core_functions/scalar/bit_functions.hpp +1 -1
  135. package/src/duckdb/src/include/duckdb/core_functions/scalar/list_functions.hpp +0 -6
  136. package/src/duckdb/src/include/duckdb/core_functions/scalar/math_functions.hpp +1 -1
  137. package/src/duckdb/src/include/duckdb/execution/expression_executor_state.hpp +3 -2
  138. package/src/duckdb/src/include/duckdb/execution/index/art/art.hpp +3 -0
  139. package/src/duckdb/src/include/duckdb/execution/index/index_type.hpp +16 -1
  140. package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_buffer_manager.hpp +4 -4
  141. package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_reader_options.hpp +4 -2
  142. package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/csv_schema.hpp +3 -2
  143. package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/sniffer/csv_sniffer.hpp +91 -36
  144. package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/sniffer/sniff_result.hpp +36 -0
  145. package/src/duckdb/src/include/duckdb/execution/operator/csv_scanner/string_value_scanner.hpp +1 -1
  146. package/src/duckdb/src/include/duckdb/execution/operator/join/perfect_hash_join_executor.hpp +0 -1
  147. package/src/duckdb/src/include/duckdb/execution/operator/persistent/physical_export.hpp +2 -5
  148. package/src/duckdb/src/include/duckdb/function/table_function.hpp +1 -1
  149. package/src/duckdb/src/include/duckdb/main/database.hpp +5 -0
  150. package/src/duckdb/src/include/duckdb/main/extension_entries.hpp +1 -0
  151. package/src/duckdb/src/include/duckdb/main/profiling_info.hpp +20 -22
  152. package/src/duckdb/src/include/duckdb/main/query_profiler.hpp +7 -9
  153. package/src/duckdb/src/include/duckdb/main/secret/secret.hpp +8 -1
  154. package/src/duckdb/src/include/duckdb/main/table_description.hpp +14 -0
  155. package/src/duckdb/src/include/duckdb/optimizer/unnest_rewriter.hpp +5 -5
  156. package/src/duckdb/src/include/duckdb/parser/parsed_data/exported_table_data.hpp +15 -5
  157. package/src/duckdb/src/include/duckdb/parser/transformer.hpp +2 -0
  158. package/src/duckdb/src/include/duckdb/planner/expression_binder/order_binder.hpp +4 -0
  159. package/src/duckdb/src/include/duckdb/planner/operator/logical_export.hpp +10 -13
  160. package/src/duckdb/src/include/duckdb/planner/table_filter.hpp +1 -0
  161. package/src/duckdb/src/include/duckdb/storage/metadata/metadata_manager.hpp +2 -2
  162. package/src/duckdb/src/include/duckdb/storage/standard_buffer_manager.hpp +1 -1
  163. package/src/duckdb/src/include/duckdb/storage/statistics/distinct_statistics.hpp +0 -2
  164. package/src/duckdb/src/include/duckdb/storage/table/segment_tree.hpp +1 -0
  165. package/src/duckdb/src/include/duckdb/transaction/duck_transaction.hpp +5 -1
  166. package/src/duckdb/src/include/duckdb.h +2 -2
  167. package/src/duckdb/src/main/appender.cpp +3 -0
  168. package/src/duckdb/src/main/capi/profiling_info-c.cpp +5 -2
  169. package/src/duckdb/src/main/client_context.cpp +8 -2
  170. package/src/duckdb/src/main/connection.cpp +1 -1
  171. package/src/duckdb/src/main/database.cpp +13 -0
  172. package/src/duckdb/src/main/extension/extension_helper.cpp +1 -1
  173. package/src/duckdb/src/main/extension/extension_install.cpp +9 -1
  174. package/src/duckdb/src/main/extension/extension_load.cpp +3 -2
  175. package/src/duckdb/src/main/extension_install_info.cpp +1 -1
  176. package/src/duckdb/src/main/profiling_info.cpp +78 -58
  177. package/src/duckdb/src/main/query_profiler.cpp +79 -89
  178. package/src/duckdb/src/main/relation/read_csv_relation.cpp +1 -1
  179. package/src/duckdb/src/main/secret/secret.cpp +2 -1
  180. package/src/duckdb/src/main/secret/secret_manager.cpp +14 -0
  181. package/src/duckdb/src/optimizer/cte_filter_pusher.cpp +4 -2
  182. package/src/duckdb/src/optimizer/deliminator.cpp +0 -7
  183. package/src/duckdb/src/optimizer/in_clause_rewriter.cpp +7 -0
  184. package/src/duckdb/src/optimizer/pushdown/pushdown_left_join.cpp +4 -1
  185. package/src/duckdb/src/optimizer/unnest_rewriter.cpp +21 -21
  186. package/src/duckdb/src/parallel/task_scheduler.cpp +9 -0
  187. package/src/duckdb/src/parser/parsed_data/exported_table_data.cpp +22 -0
  188. package/src/duckdb/src/parser/parsed_expression_iterator.cpp +3 -0
  189. package/src/duckdb/src/parser/statement/insert_statement.cpp +7 -1
  190. package/src/duckdb/src/parser/transform/expression/transform_boolean_test.cpp +1 -1
  191. package/src/duckdb/src/parser/transform/helpers/transform_typename.cpp +89 -87
  192. package/src/duckdb/src/parser/transform/statement/transform_pivot_stmt.cpp +2 -2
  193. package/src/duckdb/src/planner/binder/expression/bind_macro_expression.cpp +4 -9
  194. package/src/duckdb/src/planner/binder/query_node/bind_select_node.cpp +4 -0
  195. package/src/duckdb/src/planner/binder/query_node/plan_setop.cpp +2 -2
  196. package/src/duckdb/src/planner/binder/statement/bind_create_table.cpp +4 -1
  197. package/src/duckdb/src/planner/binder/statement/bind_export.cpp +4 -3
  198. package/src/duckdb/src/planner/expression_binder/order_binder.cpp +13 -3
  199. package/src/duckdb/src/planner/expression_binder.cpp +1 -1
  200. package/src/duckdb/src/planner/operator/logical_export.cpp +28 -0
  201. package/src/duckdb/src/planner/table_binding.cpp +1 -2
  202. package/src/duckdb/src/planner/table_filter.cpp +6 -2
  203. package/src/duckdb/src/storage/buffer/buffer_pool.cpp +2 -1
  204. package/src/duckdb/src/storage/checkpoint_manager.cpp +1 -1
  205. package/src/duckdb/src/storage/compression/bitpacking.cpp +7 -3
  206. package/src/duckdb/src/storage/compression/dictionary_compression.cpp +1 -1
  207. package/src/duckdb/src/storage/metadata/metadata_manager.cpp +2 -2
  208. package/src/duckdb/src/storage/serialization/serialize_logical_operator.cpp +16 -0
  209. package/src/duckdb/src/storage/serialization/serialize_nodes.cpp +29 -0
  210. package/src/duckdb/src/storage/serialization/serialize_parse_info.cpp +15 -0
  211. package/src/duckdb/src/storage/single_file_block_manager.cpp +2 -1
  212. package/src/duckdb/src/storage/statistics/distinct_statistics.cpp +3 -5
  213. package/src/duckdb/src/storage/storage_info.cpp +4 -4
  214. package/src/duckdb/src/storage/table/row_group_collection.cpp +1 -1
  215. package/src/duckdb/src/storage/table/row_version_manager.cpp +5 -1
  216. package/src/duckdb/src/storage/temporary_file_manager.cpp +1 -1
  217. package/src/duckdb/src/transaction/duck_transaction.cpp +15 -14
  218. package/src/duckdb/third_party/brotli/common/brotli_platform.h +1 -1
  219. package/src/duckdb/third_party/brotli/dec/decode.cpp +1 -1
  220. package/src/duckdb/third_party/brotli/enc/memory.cpp +4 -4
  221. package/src/duckdb/third_party/fsst/libfsst.cpp +1 -1
  222. package/src/duckdb/third_party/hyperloglog/sds.cpp +1 -1
  223. package/src/duckdb/third_party/hyperloglog/sds.hpp +1 -1
  224. package/src/duckdb/third_party/libpg_query/include/common/keywords.hpp +1 -1
  225. package/src/duckdb/third_party/libpg_query/include/datatype/timestamp.hpp +1 -1
  226. package/src/duckdb/third_party/libpg_query/include/mb/pg_wchar.hpp +1 -1
  227. package/src/duckdb/third_party/libpg_query/include/nodes/bitmapset.hpp +1 -1
  228. package/src/duckdb/third_party/libpg_query/include/nodes/lockoptions.hpp +1 -1
  229. package/src/duckdb/third_party/libpg_query/include/nodes/makefuncs.hpp +1 -1
  230. package/src/duckdb/third_party/libpg_query/include/nodes/pg_list.hpp +1 -1
  231. package/src/duckdb/third_party/libpg_query/include/nodes/value.hpp +1 -1
  232. package/src/duckdb/third_party/libpg_query/include/parser/gramparse.hpp +1 -1
  233. package/src/duckdb/third_party/libpg_query/include/parser/parser.hpp +1 -1
  234. package/src/duckdb/third_party/libpg_query/include/parser/scanner.hpp +1 -1
  235. package/src/duckdb/third_party/libpg_query/include/parser/scansup.hpp +1 -1
  236. package/src/duckdb/third_party/libpg_query/include/pg_functions.hpp +1 -1
  237. package/src/duckdb/third_party/libpg_query/pg_functions.cpp +1 -1
  238. package/src/duckdb/third_party/libpg_query/src_backend_nodes_list.cpp +1 -1
  239. package/src/duckdb/third_party/libpg_query/src_backend_nodes_makefuncs.cpp +1 -1
  240. package/src/duckdb/third_party/libpg_query/src_backend_nodes_value.cpp +1 -1
  241. package/src/duckdb/third_party/libpg_query/src_backend_parser_gram.cpp +1964 -1964
  242. package/src/duckdb/third_party/libpg_query/src_backend_parser_parser.cpp +1 -1
  243. package/src/duckdb/third_party/libpg_query/src_backend_parser_scansup.cpp +1 -1
  244. package/src/duckdb/third_party/libpg_query/src_common_keywords.cpp +1 -1
  245. package/src/duckdb/third_party/lz4/lz4.cpp +1 -1
  246. package/src/duckdb/third_party/mbedtls/include/des_alt.h +1 -1
  247. package/src/duckdb/third_party/mbedtls/include/mbedtls/aes_alt.h +1 -1
  248. package/src/duckdb/third_party/mbedtls/include/mbedtls/aria_alt.h +1 -1
  249. package/src/duckdb/third_party/mbedtls/include/mbedtls/asn1write.h +1 -1
  250. package/src/duckdb/third_party/mbedtls/include/mbedtls/camellia_alt.h +1 -1
  251. package/src/duckdb/third_party/mbedtls/include/mbedtls/ccm_alt.h +1 -1
  252. package/src/duckdb/third_party/mbedtls/include/mbedtls/chacha20.h +1 -1
  253. package/src/duckdb/third_party/mbedtls/include/mbedtls/chachapoly.h +1 -1
  254. package/src/duckdb/third_party/mbedtls/include/mbedtls/cmac.h +1 -1
  255. package/src/duckdb/third_party/mbedtls/include/mbedtls/config_psa.h +1 -1
  256. package/src/duckdb/third_party/mbedtls/include/mbedtls/ecdsa.h +1 -1
  257. package/src/duckdb/third_party/mbedtls/include/mbedtls/ecp.h +1 -1
  258. package/src/duckdb/third_party/mbedtls/include/mbedtls/gcm_alt.h +1 -1
  259. package/src/duckdb/third_party/mbedtls/include/mbedtls/md5.h +1 -1
  260. package/src/duckdb/third_party/mbedtls/include/mbedtls/nist_kw.h +1 -1
  261. package/src/duckdb/third_party/mbedtls/include/mbedtls/pkcs12.h +1 -1
  262. package/src/duckdb/third_party/mbedtls/include/mbedtls/pkcs5.h +1 -1
  263. package/src/duckdb/third_party/mbedtls/include/mbedtls/psa_util.h +1 -1
  264. package/src/duckdb/third_party/mbedtls/include/mbedtls/ripemd160.h +1 -1
  265. package/src/duckdb/third_party/mbedtls/include/mbedtls/threading.h +1 -1
  266. package/src/duckdb/third_party/mbedtls/include/mbedtls/timing.h +1 -1
  267. package/src/duckdb/third_party/mbedtls/include/platform_alt.h +1 -1
  268. package/src/duckdb/third_party/mbedtls/include/psa/crypto.h +1 -1
  269. package/src/duckdb/third_party/mbedtls/include/rsa_alt.h +1 -1
  270. package/src/duckdb/third_party/mbedtls/include/sha1_alt.h +1 -1
  271. package/src/duckdb/third_party/mbedtls/include/sha256_alt.h +1 -1
  272. package/src/duckdb/third_party/mbedtls/include/sha512_alt.h +1 -1
  273. package/src/duckdb/third_party/mbedtls/include/ssl_misc.h +1 -1
  274. package/src/duckdb/third_party/mbedtls/library/aesni.h +1 -1
  275. package/src/duckdb/third_party/mbedtls/library/padlock.h +1 -1
  276. package/src/duckdb/third_party/miniz/miniz.cpp +1 -1
  277. package/src/duckdb/third_party/parquet/parquet_types.cpp +1 -1
  278. package/src/duckdb/third_party/parquet/windows_compatibility.h +1 -1
  279. package/src/duckdb/third_party/pcg/pcg_extras.hpp +1 -1
  280. package/src/duckdb/third_party/pcg/pcg_uint128.hpp +1 -1
  281. package/src/duckdb/third_party/skiplist/Node.h +4 -4
  282. package/src/duckdb/third_party/snappy/snappy.cc +1 -1
  283. package/src/duckdb/third_party/snappy/snappy_version.hpp +1 -1
  284. package/src/duckdb/third_party/thrift/thrift/thrift-config.h +1 -1
  285. package/src/duckdb/third_party/zstd/decompress/zstd_decompress_block.cpp +1 -1
  286. package/src/duckdb/third_party/zstd/include/zstd_static.h +1 -1
  287. package/src/duckdb/ub_src_execution_index_art.cpp +2 -0
  288. package/src/duckdb/ub_src_parser_parsed_data.cpp +2 -0
  289. package/src/duckdb/ub_src_planner_operator.cpp +2 -0
@@ -4,6 +4,7 @@
4
4
  #include "duckdb/common/string_util.hpp"
5
5
  #include "duckdb/common/enum_util.hpp"
6
6
  #include "duckdb/common/multi_file_reader.hpp"
7
+ #include "duckdb/common/set.hpp"
7
8
 
8
9
  namespace duckdb {
9
10
 
@@ -404,7 +405,7 @@ string CSVReaderOptions::ToString(const string &current_file_path) const {
404
405
  auto &skip_rows = dialect_options.skip_rows;
405
406
 
406
407
  auto &header = dialect_options.header;
407
- string error = " file=" + current_file_path + "\n ";
408
+ string error = " file = " + current_file_path + "\n ";
408
409
  // Let's first print options that can either be set by the user or by the sniffer
409
410
  // delimiter
410
411
  error += FormatOptionLine("delimiter", delimiter);
@@ -427,13 +428,13 @@ string CSVReaderOptions::ToString(const string &current_file_path) const {
427
428
 
428
429
  // Now we do options that can only be set by the user, that might hold some general significance
429
430
  // null padding
430
- error += "null_padding=" + std::to_string(null_padding) + "\n ";
431
+ error += "null_padding = " + std::to_string(null_padding) + "\n ";
431
432
  // sample_size
432
- error += "sample_size=" + std::to_string(sample_size_chunks * STANDARD_VECTOR_SIZE) + "\n ";
433
+ error += "sample_size = " + std::to_string(sample_size_chunks * STANDARD_VECTOR_SIZE) + "\n ";
433
434
  // ignore_errors
434
- error += "ignore_errors=" + ignore_errors.FormatValue() + "\n ";
435
+ error += "ignore_errors = " + ignore_errors.FormatValue() + "\n ";
435
436
  // all_varchar
436
- error += "all_varchar=" + std::to_string(all_varchar) + "\n";
437
+ error += "all_varchar = " + std::to_string(all_varchar) + "\n";
437
438
 
438
439
  // Add information regarding sniffer mismatches (if any)
439
440
  error += sniffer_user_mismatch_error;
@@ -452,15 +453,15 @@ static Value StringVectorToValue(const vector<string> &vec) {
452
453
  static uint8_t GetCandidateSpecificity(const LogicalType &candidate_type) {
453
454
  //! Const ht with accepted auto_types and their weights in specificity
454
455
  const duckdb::unordered_map<uint8_t, uint8_t> auto_type_candidates_specificity {
455
- {(uint8_t)LogicalTypeId::VARCHAR, 0}, {(uint8_t)LogicalTypeId::DOUBLE, 1},
456
- {(uint8_t)LogicalTypeId::FLOAT, 2}, {(uint8_t)LogicalTypeId::DECIMAL, 3},
457
- {(uint8_t)LogicalTypeId::BIGINT, 4}, {(uint8_t)LogicalTypeId::INTEGER, 5},
458
- {(uint8_t)LogicalTypeId::SMALLINT, 6}, {(uint8_t)LogicalTypeId::TINYINT, 7},
459
- {(uint8_t)LogicalTypeId::TIMESTAMP, 8}, {(uint8_t)LogicalTypeId::DATE, 9},
460
- {(uint8_t)LogicalTypeId::TIME, 10}, {(uint8_t)LogicalTypeId::BOOLEAN, 11},
461
- {(uint8_t)LogicalTypeId::SQLNULL, 12}};
462
-
463
- auto id = (uint8_t)candidate_type.id();
456
+ {static_cast<uint8_t>(LogicalTypeId::VARCHAR), 0}, {static_cast<uint8_t>(LogicalTypeId::DOUBLE), 1},
457
+ {static_cast<uint8_t>(LogicalTypeId::FLOAT), 2}, {static_cast<uint8_t>(LogicalTypeId::DECIMAL), 3},
458
+ {static_cast<uint8_t>(LogicalTypeId::BIGINT), 4}, {static_cast<uint8_t>(LogicalTypeId::INTEGER), 5},
459
+ {static_cast<uint8_t>(LogicalTypeId::SMALLINT), 6}, {static_cast<uint8_t>(LogicalTypeId::TINYINT), 7},
460
+ {static_cast<uint8_t>(LogicalTypeId::TIMESTAMP), 8}, {static_cast<uint8_t>(LogicalTypeId::DATE), 9},
461
+ {static_cast<uint8_t>(LogicalTypeId::TIME), 10}, {static_cast<uint8_t>(LogicalTypeId::BOOLEAN), 11},
462
+ {static_cast<uint8_t>(LogicalTypeId::SQLNULL), 12}};
463
+
464
+ auto id = static_cast<uint8_t>(candidate_type.id());
464
465
  auto it = auto_type_candidates_specificity.find(id);
465
466
  if (it == auto_type_candidates_specificity.end()) {
466
467
  throw BinderException("Auto Type Candidate of type %s is not accepted as a valid input",
@@ -468,7 +469,7 @@ static uint8_t GetCandidateSpecificity(const LogicalType &candidate_type) {
468
469
  }
469
470
  return it->second;
470
471
  }
471
- bool StoreUserDefinedParameter(string &option) {
472
+ bool StoreUserDefinedParameter(const string &option) {
472
473
  if (option == "column_types" || option == "types" || option == "dtypes" || option == "auto_detect" ||
473
474
  option == "auto_type_candidates" || option == "columns" || option == "names") {
474
475
  // We don't store options related to types, names and auto-detection since these are either irrelevant to our
@@ -477,20 +478,49 @@ bool StoreUserDefinedParameter(string &option) {
477
478
  }
478
479
  return true;
479
480
  }
480
- void CSVReaderOptions::FromNamedParameters(named_parameter_map_t &in, ClientContext &context) {
481
+
482
+ void CSVReaderOptions::Verify() {
483
+ if (rejects_table_name.IsSetByUser() && !store_rejects.GetValue() && store_rejects.IsSetByUser()) {
484
+ throw BinderException("REJECTS_TABLE option is only supported when store_rejects is not manually set to false");
485
+ }
486
+ if (rejects_scan_name.IsSetByUser() && !store_rejects.GetValue() && store_rejects.IsSetByUser()) {
487
+ throw BinderException("REJECTS_SCAN option is only supported when store_rejects is not manually set to false");
488
+ }
489
+ if (rejects_scan_name.IsSetByUser() || rejects_table_name.IsSetByUser()) {
490
+ // Ensure we set store_rejects to true automagically
491
+ store_rejects.Set(true, false);
492
+ }
493
+ // Validate rejects_table options
494
+ if (store_rejects.GetValue()) {
495
+ if (!ignore_errors.GetValue() && ignore_errors.IsSetByUser()) {
496
+ throw BinderException(
497
+ "STORE_REJECTS option is only supported when IGNORE_ERRORS is not manually set to false");
498
+ }
499
+ // Ensure we set ignore errors to true automagically
500
+ ignore_errors.Set(true, false);
501
+ if (file_options.union_by_name) {
502
+ throw BinderException("REJECTS_TABLE option is not supported when UNION_BY_NAME is set to true");
503
+ }
504
+ }
505
+ if (rejects_limit != 0 && !store_rejects.GetValue()) {
506
+ throw BinderException("REJECTS_LIMIT option is only supported when REJECTS_TABLE is set to a table name");
507
+ }
508
+ }
509
+
510
+ void CSVReaderOptions::FromNamedParameters(const named_parameter_map_t &in, ClientContext &context) {
481
511
  map<string, string> ordered_user_defined_parameters;
482
512
  for (auto &kv : in) {
483
513
  if (MultiFileReader().ParseOption(kv.first, kv.second, file_options, context)) {
484
514
  continue;
485
515
  }
486
516
  auto loption = StringUtil::Lower(kv.first);
487
- // skip variables that are specific to auto detection
517
+ // skip variables that are specific to auto-detection
488
518
  if (StoreUserDefinedParameter(loption)) {
489
519
  ordered_user_defined_parameters[loption] = kv.second.ToSQLString();
490
520
  }
491
521
  if (loption == "columns") {
492
522
  if (!name_list.empty()) {
493
- throw BinderException("read_csv_auto column_names/names can only be supplied once");
523
+ throw BinderException("read_csv column_names/names can only be supplied once");
494
524
  }
495
525
  columns_set = true;
496
526
  auto &child_type = kv.second.type();
@@ -539,23 +569,40 @@ void CSVReaderOptions::FromNamedParameters(named_parameter_map_t &in, ClientCont
539
569
  auto_type_candidates.emplace_back(candidate_type.second);
540
570
  }
541
571
  } else if (loption == "column_names" || loption == "names") {
572
+ unordered_set<string> column_names;
542
573
  if (!name_list.empty()) {
543
- throw BinderException("read_csv_auto column_names/names can only be supplied once");
574
+ throw BinderException("read_csv column_names/names can only be supplied once");
544
575
  }
545
576
  if (kv.second.IsNull()) {
546
- throw BinderException("read_csv_auto %s cannot be NULL", kv.first);
577
+ throw BinderException("read_csv %s cannot be NULL", kv.first);
547
578
  }
548
579
  auto &children = ListValue::GetChildren(kv.second);
549
580
  for (auto &child : children) {
550
581
  name_list.push_back(StringValue::Get(child));
551
582
  }
583
+ for (auto &name : name_list) {
584
+ bool empty = true;
585
+ for (auto &c : name) {
586
+ if (!StringUtil::CharacterIsSpace(c)) {
587
+ empty = false;
588
+ break;
589
+ }
590
+ }
591
+ if (empty) {
592
+ throw BinderException("read_csv %s cannot have empty (or all whitespace) value", kv.first);
593
+ }
594
+ if (column_names.find(name) != column_names.end()) {
595
+ throw BinderException("read_csv %s must have unique values. \"%s\" is repeated.", kv.first, name);
596
+ }
597
+ column_names.insert(name);
598
+ }
552
599
  } else if (loption == "column_types" || loption == "types" || loption == "dtypes") {
553
600
  auto &child_type = kv.second.type();
554
601
  if (child_type.id() != LogicalTypeId::STRUCT && child_type.id() != LogicalTypeId::LIST) {
555
- throw BinderException("read_csv_auto %s requires a struct or list as input", kv.first);
602
+ throw BinderException("read_csv %s requires a struct or list as input", kv.first);
556
603
  }
557
604
  if (!sql_type_list.empty()) {
558
- throw BinderException("read_csv_auto column_types/types/dtypes can only be supplied once");
605
+ throw BinderException("read_csv column_types/types/dtypes can only be supplied once");
559
606
  }
560
607
  vector<string> sql_type_names;
561
608
  if (child_type.id() == LogicalTypeId::STRUCT) {
@@ -565,7 +612,7 @@ void CSVReaderOptions::FromNamedParameters(named_parameter_map_t &in, ClientCont
565
612
  auto &name = StructType::GetChildName(child_type, i);
566
613
  auto &val = struct_children[i];
567
614
  if (val.type().id() != LogicalTypeId::VARCHAR) {
568
- throw BinderException("read_csv_auto %s requires a type specification as string", kv.first);
615
+ throw BinderException("read_csv %s requires a type specification as string", kv.first);
569
616
  }
570
617
  sql_type_names.push_back(StringValue::Get(val));
571
618
  sql_types_per_column[name] = i;
@@ -573,7 +620,7 @@ void CSVReaderOptions::FromNamedParameters(named_parameter_map_t &in, ClientCont
573
620
  } else {
574
621
  auto &list_child = ListType::GetChildType(child_type);
575
622
  if (list_child.id() != LogicalTypeId::VARCHAR) {
576
- throw BinderException("read_csv_auto %s requires a list of types (varchar) as input", kv.first);
623
+ throw BinderException("read_csv %s requires a list of types (varchar) as input", kv.first);
577
624
  }
578
625
  auto &children = ListValue::GetChildren(kv.second);
579
626
  for (auto &child : children) {
@@ -584,8 +631,7 @@ void CSVReaderOptions::FromNamedParameters(named_parameter_map_t &in, ClientCont
584
631
  for (auto &sql_type : sql_type_names) {
585
632
  auto def_type = TransformStringToLogicalType(sql_type, context);
586
633
  if (def_type.id() == LogicalTypeId::USER) {
587
- throw BinderException("Unrecognized type \"%s\" for read_csv_auto %s definition", sql_type,
588
- kv.first);
634
+ throw BinderException("Unrecognized type \"%s\" for read_csv %s definition", sql_type, kv.first);
589
635
  }
590
636
  sql_type_list.push_back(std::move(def_type));
591
637
  }
@@ -606,7 +652,7 @@ void CSVReaderOptions::FromNamedParameters(named_parameter_map_t &in, ClientCont
606
652
  }
607
653
 
608
654
  //! This function is used to remember options set by the sniffer, for use in ReadCSVRelation
609
- void CSVReaderOptions::ToNamedParameters(named_parameter_map_t &named_params) {
655
+ void CSVReaderOptions::ToNamedParameters(named_parameter_map_t &named_params) const {
610
656
  auto &delimiter = dialect_options.state_machine_options.delimiter;
611
657
  auto &quote = dialect_options.state_machine_options.quote;
612
658
  auto &escape = dialect_options.state_machine_options.escape;
@@ -59,7 +59,7 @@ unique_ptr<LocalSinkState> PhysicalBufferedCollector::GetLocalSinkState(Executio
59
59
  unique_ptr<QueryResult> PhysicalBufferedCollector::GetResult(GlobalSinkState &state) {
60
60
  auto &gstate = state.Cast<BufferedCollectorGlobalState>();
61
61
  lock_guard<mutex> l(gstate.glock);
62
- // FIXME: maybe we want to check if the execution was successfull before creating the StreamQueryResult ?
62
+ // FIXME: maybe we want to check if the execution was successful before creating the StreamQueryResult ?
63
63
  auto cc = gstate.context.lock();
64
64
  auto result = make_uniq<StreamQueryResult>(statement_type, properties, types, names, cc->GetClientProperties(),
65
65
  gstate.buffered_data);