duckdb 1.1.2-dev4.0 → 1.1.3

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
@@ -0,0 +1,72 @@
1
+ #include "duckdb/execution/operator/persistent/csv_buffer.hpp"
2
+ #include "duckdb/common/string_util.hpp"
3
+
4
+ namespace duckdb {
5
+
6
+ CSVBuffer::CSVBuffer(ClientContext &context, idx_t buffer_size_p, CSVFileHandle &file_handle,
7
+ idx_t &global_csv_current_position, idx_t file_number_p)
8
+ : context(context), first_buffer(true), file_number(file_number_p) {
9
+ this->handle = AllocateBuffer(buffer_size_p);
10
+
11
+ auto buffer = Ptr();
12
+ actual_size = file_handle.Read(buffer, buffer_size_p);
13
+ global_csv_start = global_csv_current_position;
14
+ global_csv_current_position += actual_size;
15
+ if (actual_size >= 3 && buffer[0] == '\xEF' && buffer[1] == '\xBB' && buffer[2] == '\xBF') {
16
+ start_position += 3;
17
+ }
18
+ last_buffer = file_handle.FinishedReading();
19
+ }
20
+
21
+ CSVBuffer::CSVBuffer(ClientContext &context, BufferHandle buffer_p, idx_t buffer_size_p, idx_t actual_size_p,
22
+ bool final_buffer, idx_t global_csv_current_position, idx_t file_number_p)
23
+ : context(context), handle(std::move(buffer_p)), actual_size(actual_size_p), last_buffer(final_buffer),
24
+ global_csv_start(global_csv_current_position), file_number(file_number_p) {
25
+ }
26
+
27
+ unique_ptr<CSVBuffer> CSVBuffer::Next(CSVFileHandle &file_handle, idx_t buffer_size, idx_t &global_csv_current_position,
28
+ idx_t file_number_p) {
29
+ auto next_buffer = AllocateBuffer(buffer_size);
30
+ idx_t next_buffer_actual_size = file_handle.Read(next_buffer.Ptr(), buffer_size);
31
+ if (next_buffer_actual_size == 0) {
32
+ // We are done reading
33
+ return nullptr;
34
+ }
35
+
36
+ auto next_csv_buffer =
37
+ make_uniq<CSVBuffer>(context, std::move(next_buffer), buffer_size, next_buffer_actual_size,
38
+ file_handle.FinishedReading(), global_csv_current_position, file_number_p);
39
+ global_csv_current_position += next_buffer_actual_size;
40
+ return next_csv_buffer;
41
+ }
42
+
43
+ BufferHandle CSVBuffer::AllocateBuffer(idx_t buffer_size) {
44
+ auto &buffer_manager = BufferManager::GetBufferManager(context);
45
+ return buffer_manager.Allocate(MaxValue<idx_t>(Storage::BLOCK_SIZE, buffer_size));
46
+ }
47
+
48
+ idx_t CSVBuffer::GetBufferSize() {
49
+ return actual_size;
50
+ }
51
+
52
+ idx_t CSVBuffer::GetStart() {
53
+ return start_position;
54
+ }
55
+
56
+ bool CSVBuffer::IsCSVFileLastBuffer() {
57
+ return last_buffer;
58
+ }
59
+
60
+ bool CSVBuffer::IsCSVFileFirstBuffer() {
61
+ return first_buffer;
62
+ }
63
+
64
+ idx_t CSVBuffer::GetCSVGlobalStart() {
65
+ return global_csv_start;
66
+ }
67
+
68
+ idx_t CSVBuffer::GetFileNumber() {
69
+ return file_number;
70
+ }
71
+
72
+ } // namespace duckdb
@@ -0,0 +1,158 @@
1
+ #include "duckdb/execution/operator/persistent/csv_file_handle.hpp"
2
+
3
+ namespace duckdb {
4
+
5
+ CSVFileHandle::CSVFileHandle(FileSystem &fs, Allocator &allocator, unique_ptr<FileHandle> file_handle_p,
6
+ const string &path_p, FileCompressionType compression, bool enable_reset)
7
+ : fs(fs), allocator(allocator), file_handle(std::move(file_handle_p)), path(path_p), compression(compression),
8
+ reset_enabled(enable_reset) {
9
+ can_seek = file_handle->CanSeek();
10
+ on_disk_file = file_handle->OnDiskFile();
11
+ file_size = file_handle->GetFileSize();
12
+ }
13
+
14
+ unique_ptr<FileHandle> CSVFileHandle::OpenFileHandle(FileSystem &fs, Allocator &allocator, const string &path,
15
+ FileCompressionType compression) {
16
+ auto file_handle = fs.OpenFile(path, FileFlags::FILE_FLAGS_READ, FileLockType::NO_LOCK, compression);
17
+ if (file_handle->CanSeek()) {
18
+ file_handle->Reset();
19
+ }
20
+ return file_handle;
21
+ }
22
+
23
+ unique_ptr<CSVFileHandle> CSVFileHandle::OpenFile(FileSystem &fs, Allocator &allocator, const string &path,
24
+ FileCompressionType compression, bool enable_reset) {
25
+ auto file_handle = CSVFileHandle::OpenFileHandle(fs, allocator, path, compression);
26
+ return make_uniq<CSVFileHandle>(fs, allocator, std::move(file_handle), path, compression, enable_reset);
27
+ }
28
+
29
+ bool CSVFileHandle::CanSeek() {
30
+ return can_seek;
31
+ }
32
+
33
+ void CSVFileHandle::Seek(idx_t position) {
34
+ if (!can_seek) {
35
+ throw InternalException("Cannot seek in this file");
36
+ }
37
+ file_handle->Seek(position);
38
+ }
39
+
40
+ idx_t CSVFileHandle::SeekPosition() {
41
+ if (!can_seek) {
42
+ throw InternalException("Cannot seek in this file");
43
+ }
44
+ return file_handle->SeekPosition();
45
+ }
46
+
47
+ void CSVFileHandle::Reset() {
48
+ requested_bytes = 0;
49
+ read_position = 0;
50
+ if (can_seek) {
51
+ // we can seek - reset the file handle
52
+ file_handle->Reset();
53
+ } else if (on_disk_file) {
54
+ // we cannot seek but it is an on-disk file - re-open the file
55
+ file_handle = CSVFileHandle::OpenFileHandle(fs, allocator, path, compression);
56
+ } else {
57
+ if (!reset_enabled) {
58
+ throw InternalException("Reset called but reset is not enabled for this CSV Handle");
59
+ }
60
+ read_position = 0;
61
+ }
62
+ }
63
+ bool CSVFileHandle::OnDiskFile() {
64
+ return on_disk_file;
65
+ }
66
+
67
+ idx_t CSVFileHandle::FileSize() {
68
+ return file_size;
69
+ }
70
+
71
+ bool CSVFileHandle::FinishedReading() {
72
+ return requested_bytes >= file_size;
73
+ }
74
+
75
+ idx_t CSVFileHandle::Read(void *buffer, idx_t nr_bytes) {
76
+ requested_bytes += nr_bytes;
77
+ if (on_disk_file || can_seek) {
78
+ // if this is a plain file source OR we can seek we are not caching anything
79
+ return file_handle->Read(buffer, nr_bytes);
80
+ }
81
+ // not a plain file source: we need to do some bookkeeping around the reset functionality
82
+ idx_t result_offset = 0;
83
+ if (read_position < buffer_size) {
84
+ // we need to read from our cached buffer
85
+ auto buffer_read_count = MinValue<idx_t>(nr_bytes, buffer_size - read_position);
86
+ memcpy(buffer, cached_buffer.get() + read_position, buffer_read_count);
87
+ result_offset += buffer_read_count;
88
+ read_position += buffer_read_count;
89
+ if (result_offset == nr_bytes) {
90
+ return nr_bytes;
91
+ }
92
+ } else if (!reset_enabled && cached_buffer.IsSet()) {
93
+ // reset is disabled, but we still have cached data
94
+ // we can remove any cached data
95
+ cached_buffer.Reset();
96
+ buffer_size = 0;
97
+ buffer_capacity = 0;
98
+ read_position = 0;
99
+ }
100
+ // we have data left to read from the file
101
+ // read directly into the buffer
102
+ auto bytes_read = file_handle->Read(char_ptr_cast(buffer) + result_offset, nr_bytes - result_offset);
103
+ file_size = file_handle->GetFileSize();
104
+ read_position += bytes_read;
105
+ if (reset_enabled) {
106
+ // if reset caching is enabled, we need to cache the bytes that we have read
107
+ if (buffer_size + bytes_read >= buffer_capacity) {
108
+ // no space; first enlarge the buffer
109
+ buffer_capacity = MaxValue<idx_t>(NextPowerOfTwo(buffer_size + bytes_read), buffer_capacity * 2);
110
+
111
+ auto new_buffer = allocator.Allocate(buffer_capacity);
112
+ if (buffer_size > 0) {
113
+ memcpy(new_buffer.get(), cached_buffer.get(), buffer_size);
114
+ }
115
+ cached_buffer = std::move(new_buffer);
116
+ }
117
+ memcpy(cached_buffer.get() + buffer_size, char_ptr_cast(buffer) + result_offset, bytes_read);
118
+ buffer_size += bytes_read;
119
+ }
120
+
121
+ return result_offset + bytes_read;
122
+ }
123
+
124
+ string CSVFileHandle::ReadLine() {
125
+ bool carriage_return = false;
126
+ string result;
127
+ char buffer[1];
128
+ while (true) {
129
+ idx_t bytes_read = Read(buffer, 1);
130
+ if (bytes_read == 0) {
131
+ return result;
132
+ }
133
+ if (carriage_return) {
134
+ if (buffer[0] != '\n') {
135
+ if (!file_handle->CanSeek()) {
136
+ throw BinderException(
137
+ "Carriage return newlines not supported when reading CSV files in which we cannot seek");
138
+ }
139
+ file_handle->Seek(file_handle->SeekPosition() - 1);
140
+ return result;
141
+ }
142
+ }
143
+ if (buffer[0] == '\n') {
144
+ return result;
145
+ }
146
+ if (buffer[0] != '\r') {
147
+ result += buffer[0];
148
+ } else {
149
+ carriage_return = true;
150
+ }
151
+ }
152
+ }
153
+
154
+ void CSVFileHandle::DisableReset() {
155
+ this->reset_enabled = false;
156
+ }
157
+
158
+ } // namespace duckdb
@@ -0,0 +1,280 @@
1
+ #include "duckdb/execution/operator/persistent/csv_reader_options.hpp"
2
+ #include "duckdb/common/bind_helpers.hpp"
3
+ #include "duckdb/common/vector_size.hpp"
4
+ #include "duckdb/common/string_util.hpp"
5
+
6
+ namespace duckdb {
7
+
8
+ static bool ParseBoolean(const Value &value, const string &loption);
9
+
10
+ static bool ParseBoolean(const vector<Value> &set, const string &loption) {
11
+ if (set.empty()) {
12
+ // no option specified: default to true
13
+ return true;
14
+ }
15
+ if (set.size() > 1) {
16
+ throw BinderException("\"%s\" expects a single argument as a boolean value (e.g. TRUE or 1)", loption);
17
+ }
18
+ return ParseBoolean(set[0], loption);
19
+ }
20
+
21
+ static bool ParseBoolean(const Value &value, const string &loption) {
22
+
23
+ if (value.type().id() == LogicalTypeId::LIST) {
24
+ auto &children = ListValue::GetChildren(value);
25
+ return ParseBoolean(children, loption);
26
+ }
27
+ if (value.type() == LogicalType::FLOAT || value.type() == LogicalType::DOUBLE ||
28
+ value.type().id() == LogicalTypeId::DECIMAL) {
29
+ throw BinderException("\"%s\" expects a boolean value (e.g. TRUE or 1)", loption);
30
+ }
31
+ return BooleanValue::Get(value.DefaultCastAs(LogicalType::BOOLEAN));
32
+ }
33
+
34
+ static string ParseString(const Value &value, const string &loption) {
35
+ if (value.IsNull()) {
36
+ return string();
37
+ }
38
+ if (value.type().id() == LogicalTypeId::LIST) {
39
+ auto &children = ListValue::GetChildren(value);
40
+ if (children.size() != 1) {
41
+ throw BinderException("\"%s\" expects a single argument as a string value", loption);
42
+ }
43
+ return ParseString(children[0], loption);
44
+ }
45
+ if (value.type().id() != LogicalTypeId::VARCHAR) {
46
+ throw BinderException("\"%s\" expects a string argument!", loption);
47
+ }
48
+ return value.GetValue<string>();
49
+ }
50
+
51
+ static int64_t ParseInteger(const Value &value, const string &loption) {
52
+ if (value.type().id() == LogicalTypeId::LIST) {
53
+ auto &children = ListValue::GetChildren(value);
54
+ if (children.size() != 1) {
55
+ // no option specified or multiple options specified
56
+ throw BinderException("\"%s\" expects a single argument as an integer value", loption);
57
+ }
58
+ return ParseInteger(children[0], loption);
59
+ }
60
+ return value.GetValue<int64_t>();
61
+ }
62
+
63
+ void BufferedCSVReaderOptions::SetHeader(bool input) {
64
+ this->header = input;
65
+ this->has_header = true;
66
+ }
67
+
68
+ void BufferedCSVReaderOptions::SetCompression(const string &compression_p) {
69
+ this->compression = FileCompressionTypeFromString(compression_p);
70
+ }
71
+
72
+ void BufferedCSVReaderOptions::SetEscape(const string &input) {
73
+ this->escape = input;
74
+ this->has_escape = true;
75
+ }
76
+
77
+ void BufferedCSVReaderOptions::SetDelimiter(const string &input) {
78
+ this->delimiter = StringUtil::Replace(input, "\\t", "\t");
79
+ this->has_delimiter = true;
80
+ if (input.empty()) {
81
+ this->delimiter = string("\0", 1);
82
+ }
83
+ }
84
+
85
+ void BufferedCSVReaderOptions::SetQuote(const string &quote_p) {
86
+ this->quote = quote_p;
87
+ this->has_quote = true;
88
+ }
89
+
90
+ void BufferedCSVReaderOptions::SetNewline(const string &input) {
91
+ if (input == "\\n" || input == "\\r") {
92
+ new_line = NewLineIdentifier::SINGLE;
93
+ } else if (input == "\\r\\n") {
94
+ new_line = NewLineIdentifier::CARRY_ON;
95
+ } else {
96
+ throw InvalidInputException("This is not accepted as a newline: " + input);
97
+ }
98
+ has_newline = true;
99
+ }
100
+
101
+ void BufferedCSVReaderOptions::SetDateFormat(LogicalTypeId type, const string &format, bool read_format) {
102
+ string error;
103
+ if (read_format) {
104
+ error = StrTimeFormat::ParseFormatSpecifier(format, date_format[type]);
105
+ date_format[type].format_specifier = format;
106
+ } else {
107
+ error = StrTimeFormat::ParseFormatSpecifier(format, write_date_format[type]);
108
+ }
109
+ if (!error.empty()) {
110
+ throw InvalidInputException("Could not parse DATEFORMAT: %s", error.c_str());
111
+ }
112
+ has_format[type] = true;
113
+ }
114
+
115
+ void BufferedCSVReaderOptions::SetReadOption(const string &loption, const Value &value,
116
+ vector<string> &expected_names) {
117
+ if (SetBaseOption(loption, value)) {
118
+ return;
119
+ }
120
+ if (loption == "auto_detect") {
121
+ auto_detect = ParseBoolean(value, loption);
122
+ } else if (loption == "sample_size") {
123
+ int64_t sample_size = ParseInteger(value, loption);
124
+ if (sample_size < 1 && sample_size != -1) {
125
+ throw BinderException("Unsupported parameter for SAMPLE_SIZE: cannot be smaller than 1");
126
+ }
127
+ if (sample_size == -1) {
128
+ sample_chunks = std::numeric_limits<uint64_t>::max();
129
+ sample_chunk_size = STANDARD_VECTOR_SIZE;
130
+ } else if (sample_size <= STANDARD_VECTOR_SIZE) {
131
+ sample_chunk_size = sample_size;
132
+ sample_chunks = 1;
133
+ } else {
134
+ sample_chunk_size = STANDARD_VECTOR_SIZE;
135
+ sample_chunks = sample_size / STANDARD_VECTOR_SIZE + 1;
136
+ }
137
+ } else if (loption == "skip") {
138
+ skip_rows = ParseInteger(value, loption);
139
+ skip_rows_set = true;
140
+ } else if (loption == "max_line_size" || loption == "maximum_line_size") {
141
+ maximum_line_size = ParseInteger(value, loption);
142
+ } else if (loption == "sample_chunk_size") {
143
+ sample_chunk_size = ParseInteger(value, loption);
144
+ if (sample_chunk_size > STANDARD_VECTOR_SIZE) {
145
+ throw BinderException(
146
+ "Unsupported parameter for SAMPLE_CHUNK_SIZE: cannot be bigger than STANDARD_VECTOR_SIZE %d",
147
+ STANDARD_VECTOR_SIZE);
148
+ } else if (sample_chunk_size < 1) {
149
+ throw BinderException("Unsupported parameter for SAMPLE_CHUNK_SIZE: cannot be smaller than 1");
150
+ }
151
+ } else if (loption == "sample_chunks") {
152
+ sample_chunks = ParseInteger(value, loption);
153
+ if (sample_chunks < 1) {
154
+ throw BinderException("Unsupported parameter for SAMPLE_CHUNKS: cannot be smaller than 1");
155
+ }
156
+ } else if (loption == "force_not_null") {
157
+ force_not_null = ParseColumnList(value, expected_names, loption);
158
+ } else if (loption == "date_format" || loption == "dateformat") {
159
+ string format = ParseString(value, loption);
160
+ SetDateFormat(LogicalTypeId::DATE, format, true);
161
+ } else if (loption == "timestamp_format" || loption == "timestampformat") {
162
+ string format = ParseString(value, loption);
163
+ SetDateFormat(LogicalTypeId::TIMESTAMP, format, true);
164
+ } else if (loption == "ignore_errors") {
165
+ ignore_errors = ParseBoolean(value, loption);
166
+ } else if (loption == "buffer_size") {
167
+ buffer_size = ParseInteger(value, loption);
168
+ if (buffer_size == 0) {
169
+ throw InvalidInputException("Buffer Size option must be higher than 0");
170
+ }
171
+ } else if (loption == "decimal_separator") {
172
+ decimal_separator = ParseString(value, loption);
173
+ if (decimal_separator != "." && decimal_separator != ",") {
174
+ throw BinderException("Unsupported parameter for DECIMAL_SEPARATOR: should be '.' or ','");
175
+ }
176
+ } else if (loption == "null_padding") {
177
+ null_padding = ParseBoolean(value, loption);
178
+ } else if (loption == "allow_quoted_nulls") {
179
+ allow_quoted_nulls = ParseBoolean(value, loption);
180
+ } else if (loption == "parallel") {
181
+ parallel_mode = ParseBoolean(value, loption) ? ParallelMode::PARALLEL : ParallelMode::SINGLE_THREADED;
182
+ } else if (loption == "rejects_table") {
183
+ // skip, handled in SetRejectsOptions
184
+ auto table_name = ParseString(value, loption);
185
+ if (table_name.empty()) {
186
+ throw BinderException("REJECTS_TABLE option cannot be empty");
187
+ }
188
+ rejects_table_name = table_name;
189
+ } else if (loption == "rejects_recovery_columns") {
190
+ // Get the list of columns to use as a recovery key
191
+ auto &children = ListValue::GetChildren(value);
192
+ for (auto &child : children) {
193
+ auto col_name = child.GetValue<string>();
194
+ rejects_recovery_columns.push_back(col_name);
195
+ }
196
+ } else if (loption == "rejects_limit") {
197
+ int64_t limit = ParseInteger(value, loption);
198
+ if (limit < 0) {
199
+ throw BinderException("Unsupported parameter for REJECTS_LIMIT: cannot be negative");
200
+ }
201
+ rejects_limit = limit;
202
+ } else {
203
+ throw BinderException("Unrecognized option for CSV reader \"%s\"", loption);
204
+ }
205
+ }
206
+
207
+ void BufferedCSVReaderOptions::SetWriteOption(const string &loption, const Value &value) {
208
+ if (loption == "new_line") {
209
+ // Steal this from SetBaseOption so we can write different newlines (e.g., format JSON ARRAY)
210
+ write_newline = ParseString(value, loption);
211
+ return;
212
+ }
213
+
214
+ if (SetBaseOption(loption, value)) {
215
+ return;
216
+ }
217
+
218
+ if (loption == "force_quote") {
219
+ force_quote = ParseColumnList(value, name_list, loption);
220
+ } else if (loption == "date_format" || loption == "dateformat") {
221
+ string format = ParseString(value, loption);
222
+ SetDateFormat(LogicalTypeId::DATE, format, false);
223
+ } else if (loption == "timestamp_format" || loption == "timestampformat") {
224
+ string format = ParseString(value, loption);
225
+ if (StringUtil::Lower(format) == "iso") {
226
+ format = "%Y-%m-%dT%H:%M:%S.%fZ";
227
+ }
228
+ SetDateFormat(LogicalTypeId::TIMESTAMP, format, false);
229
+ SetDateFormat(LogicalTypeId::TIMESTAMP_TZ, format, false);
230
+ } else if (loption == "prefix") {
231
+ prefix = ParseString(value, loption);
232
+ } else if (loption == "suffix") {
233
+ suffix = ParseString(value, loption);
234
+ } else {
235
+ throw BinderException("Unrecognized option CSV writer \"%s\"", loption);
236
+ }
237
+ }
238
+
239
+ bool BufferedCSVReaderOptions::SetBaseOption(const string &loption, const Value &value) {
240
+ // Make sure this function was only called after the option was turned into lowercase
241
+ D_ASSERT(!std::any_of(loption.begin(), loption.end(), ::isupper));
242
+
243
+ if (StringUtil::StartsWith(loption, "delim") || StringUtil::StartsWith(loption, "sep")) {
244
+ SetDelimiter(ParseString(value, loption));
245
+ } else if (loption == "quote") {
246
+ SetQuote(ParseString(value, loption));
247
+ } else if (loption == "new_line") {
248
+ SetNewline(ParseString(value, loption));
249
+ } else if (loption == "escape") {
250
+ SetEscape(ParseString(value, loption));
251
+ } else if (loption == "header") {
252
+ SetHeader(ParseBoolean(value, loption));
253
+ } else if (loption == "null" || loption == "nullstr") {
254
+ null_str = ParseString(value, loption);
255
+ } else if (loption == "encoding") {
256
+ auto encoding = StringUtil::Lower(ParseString(value, loption));
257
+ if (encoding != "utf8" && encoding != "utf-8") {
258
+ throw BinderException("Copy is only supported for UTF-8 encoded files, ENCODING 'UTF-8'");
259
+ }
260
+ } else if (loption == "compression") {
261
+ SetCompression(ParseString(value, loption));
262
+ } else {
263
+ // unrecognized option in base CSV
264
+ return false;
265
+ }
266
+ return true;
267
+ }
268
+
269
+ std::string BufferedCSVReaderOptions::ToString() const {
270
+ return " file=" + file_path + "\n delimiter='" + delimiter +
271
+ (has_delimiter ? "'" : (auto_detect ? "' (auto detected)" : "' (default)")) + "\n quote='" + quote +
272
+ (has_quote ? "'" : (auto_detect ? "' (auto detected)" : "' (default)")) + "\n escape='" + escape +
273
+ (has_escape ? "'" : (auto_detect ? "' (auto detected)" : "' (default)")) +
274
+ "\n header=" + std::to_string(header) +
275
+ (has_header ? "" : (auto_detect ? " (auto detected)" : "' (default)")) +
276
+ "\n sample_size=" + std::to_string(sample_chunk_size * sample_chunks) +
277
+ "\n ignore_errors=" + std::to_string(ignore_errors) + "\n all_varchar=" + std::to_string(all_varchar);
278
+ }
279
+
280
+ } // namespace duckdb