duckdb 0.7.2-dev2740.0 → 0.7.2-dev2867.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 (286) hide show
  1. package/binding.gyp +21 -13
  2. package/package.json +1 -1
  3. package/src/duckdb/extension/icu/icu-datepart.cpp +51 -1
  4. package/src/duckdb/extension/icu/icu-strptime.cpp +1 -1
  5. package/src/duckdb/extension/json/include/json_functions.hpp +35 -37
  6. package/src/duckdb/extension/json/include/json_scan.hpp +1 -1
  7. package/src/duckdb/extension/json/include/json_transform.hpp +1 -1
  8. package/src/duckdb/extension/json/json-extension.cpp +10 -20
  9. package/src/duckdb/extension/json/json_functions/copy_json.cpp +2 -2
  10. package/src/duckdb/extension/json/json_functions/json_array_length.cpp +2 -3
  11. package/src/duckdb/extension/json/json_functions/json_contains.cpp +2 -2
  12. package/src/duckdb/extension/json/json_functions/json_create.cpp +20 -20
  13. package/src/duckdb/extension/json/json_functions/json_extract.cpp +4 -6
  14. package/src/duckdb/extension/json/json_functions/json_keys.cpp +2 -3
  15. package/src/duckdb/extension/json/json_functions/json_merge_patch.cpp +2 -2
  16. package/src/duckdb/extension/json/json_functions/json_serialize_sql.cpp +8 -8
  17. package/src/duckdb/extension/json/json_functions/json_structure.cpp +2 -2
  18. package/src/duckdb/extension/json/json_functions/json_transform.cpp +4 -4
  19. package/src/duckdb/extension/json/json_functions/json_type.cpp +2 -3
  20. package/src/duckdb/extension/json/json_functions/json_valid.cpp +2 -2
  21. package/src/duckdb/extension/json/json_functions/read_json.cpp +6 -6
  22. package/src/duckdb/extension/json/json_functions/read_json_objects.cpp +4 -4
  23. package/src/duckdb/extension/json/json_functions.cpp +6 -6
  24. package/src/duckdb/extension/parquet/parquet-extension.cpp +16 -28
  25. package/src/duckdb/src/catalog/catalog_entry/pragma_function_catalog_entry.cpp +1 -2
  26. package/src/duckdb/src/catalog/catalog_entry/scalar_function_catalog_entry.cpp +1 -1
  27. package/src/duckdb/src/catalog/catalog_entry/scalar_macro_catalog_entry.cpp +2 -2
  28. package/src/duckdb/src/catalog/catalog_entry/table_function_catalog_entry.cpp +1 -2
  29. package/src/duckdb/src/catalog/catalog_transaction.cpp +4 -0
  30. package/src/duckdb/src/catalog/duck_catalog.cpp +8 -1
  31. package/src/duckdb/src/common/enums/date_part_specifier.cpp +82 -0
  32. package/src/duckdb/src/common/local_file_system.cpp +1 -3
  33. package/src/duckdb/src/common/multi_file_reader.cpp +11 -8
  34. package/src/duckdb/src/common/types/vector.cpp +136 -3
  35. package/src/duckdb/src/{function → core_functions}/aggregate/algebraic/avg.cpp +9 -12
  36. package/src/duckdb/src/core_functions/aggregate/algebraic/corr.cpp +13 -0
  37. package/src/duckdb/src/core_functions/aggregate/algebraic/covar.cpp +21 -0
  38. package/src/duckdb/src/core_functions/aggregate/algebraic/stddev.cpp +34 -0
  39. package/src/duckdb/src/{function → core_functions}/aggregate/distributive/approx_count.cpp +3 -3
  40. package/src/duckdb/src/{function → core_functions}/aggregate/distributive/arg_min_max.cpp +7 -23
  41. package/src/duckdb/src/{function → core_functions}/aggregate/distributive/bitagg.cpp +10 -10
  42. package/src/duckdb/src/{function → core_functions}/aggregate/distributive/bitstring_agg.cpp +4 -4
  43. package/src/duckdb/src/{function → core_functions}/aggregate/distributive/bool.cpp +1 -17
  44. package/src/duckdb/src/{function → core_functions}/aggregate/distributive/entropy.cpp +5 -4
  45. package/src/duckdb/src/{function → core_functions}/aggregate/distributive/kurtosis.cpp +5 -6
  46. package/src/duckdb/src/{function → core_functions}/aggregate/distributive/minmax.cpp +5 -5
  47. package/src/duckdb/src/{function → core_functions}/aggregate/distributive/product.cpp +2 -11
  48. package/src/duckdb/src/{function → core_functions}/aggregate/distributive/skew.cpp +5 -6
  49. package/src/duckdb/src/{function → core_functions}/aggregate/distributive/string_agg.cpp +4 -6
  50. package/src/duckdb/src/{function → core_functions}/aggregate/distributive/sum.cpp +38 -46
  51. package/src/duckdb/src/{function → core_functions}/aggregate/holistic/approximate_quantile.cpp +4 -5
  52. package/src/duckdb/src/{function → core_functions}/aggregate/holistic/mode.cpp +4 -5
  53. package/src/duckdb/src/{function → core_functions}/aggregate/holistic/quantile.cpp +31 -23
  54. package/src/duckdb/src/{function → core_functions}/aggregate/holistic/reservoir_quantile.cpp +4 -5
  55. package/src/duckdb/src/{function → core_functions}/aggregate/nested/histogram.cpp +4 -4
  56. package/src/duckdb/src/{function → core_functions}/aggregate/nested/list.cpp +6 -10
  57. package/src/duckdb/src/{function → core_functions}/aggregate/regression/regr_avg.cpp +7 -11
  58. package/src/duckdb/src/{function → core_functions}/aggregate/regression/regr_count.cpp +4 -4
  59. package/src/duckdb/src/{function → core_functions}/aggregate/regression/regr_intercept.cpp +5 -8
  60. package/src/duckdb/src/{function → core_functions}/aggregate/regression/regr_r2.cpp +5 -7
  61. package/src/duckdb/src/{function → core_functions}/aggregate/regression/regr_slope.cpp +5 -7
  62. package/src/duckdb/src/{function → core_functions}/aggregate/regression/regr_sxx_syy.cpp +8 -12
  63. package/src/duckdb/src/{function → core_functions}/aggregate/regression/regr_sxy.cpp +6 -8
  64. package/src/duckdb/src/core_functions/core_functions.cpp +50 -0
  65. package/src/duckdb/src/core_functions/function_list.cpp +352 -0
  66. package/src/duckdb/src/{function → core_functions}/scalar/bit/bitstring.cpp +12 -15
  67. package/src/duckdb/src/{function → core_functions}/scalar/blob/base64.cpp +6 -6
  68. package/src/duckdb/src/{function → core_functions}/scalar/blob/encode.cpp +7 -6
  69. package/src/duckdb/src/{function → core_functions}/scalar/date/age.cpp +3 -3
  70. package/src/duckdb/src/{function → core_functions}/scalar/date/current.cpp +8 -8
  71. package/src/duckdb/src/{function → core_functions}/scalar/date/date_diff.cpp +3 -6
  72. package/src/duckdb/src/{function → core_functions}/scalar/date/date_part.cpp +144 -148
  73. package/src/duckdb/src/{function → core_functions}/scalar/date/date_sub.cpp +3 -6
  74. package/src/duckdb/src/{function → core_functions}/scalar/date/date_trunc.cpp +3 -6
  75. package/src/duckdb/src/{function → core_functions}/scalar/date/epoch.cpp +7 -8
  76. package/src/duckdb/src/{function → core_functions}/scalar/date/make_date.cpp +14 -14
  77. package/src/duckdb/src/core_functions/scalar/date/strftime.cpp +251 -0
  78. package/src/duckdb/src/{function → core_functions}/scalar/date/time_bucket.cpp +4 -5
  79. package/src/duckdb/src/{function → core_functions}/scalar/date/to_interval.cpp +39 -19
  80. package/src/duckdb/src/{function/scalar/enum/enum_functions_implementation.cpp → core_functions/scalar/enum/enum_functions.cpp} +18 -22
  81. package/src/duckdb/src/{function → core_functions}/scalar/generic/alias.cpp +4 -4
  82. package/src/duckdb/src/{function → core_functions}/scalar/generic/current_setting.cpp +4 -5
  83. package/src/duckdb/src/{function → core_functions}/scalar/generic/error.cpp +4 -4
  84. package/src/duckdb/src/{function → core_functions}/scalar/generic/hash.cpp +4 -4
  85. package/src/duckdb/src/{function → core_functions}/scalar/generic/least.cpp +8 -9
  86. package/src/duckdb/src/{function → core_functions}/scalar/generic/stats.cpp +4 -4
  87. package/src/duckdb/src/{function/scalar/system → core_functions/scalar/generic}/system_functions.cpp +24 -13
  88. package/src/duckdb/src/{function → core_functions}/scalar/generic/typeof.cpp +4 -4
  89. package/src/duckdb/src/{function → core_functions}/scalar/list/array_slice.cpp +3 -13
  90. package/src/duckdb/src/{function → core_functions}/scalar/list/flatten.cpp +5 -5
  91. package/src/duckdb/src/{function → core_functions}/scalar/list/list_aggregates.cpp +2 -13
  92. package/src/duckdb/src/{function → core_functions}/scalar/list/list_lambdas.cpp +9 -24
  93. package/src/duckdb/src/{function → core_functions}/scalar/list/list_sort.cpp +8 -22
  94. package/src/duckdb/src/{function → core_functions}/scalar/list/list_value.cpp +4 -5
  95. package/src/duckdb/src/{function → core_functions}/scalar/list/range.cpp +8 -6
  96. package/src/duckdb/src/{function → core_functions}/scalar/map/cardinality.cpp +5 -4
  97. package/src/duckdb/src/{function → core_functions}/scalar/map/map.cpp +6 -63
  98. package/src/duckdb/src/{function → core_functions}/scalar/map/map_entries.cpp +5 -4
  99. package/src/duckdb/src/{function → core_functions}/scalar/map/map_extract.cpp +22 -7
  100. package/src/duckdb/src/{function → core_functions}/scalar/map/map_from_entries.cpp +6 -5
  101. package/src/duckdb/src/{function → core_functions}/scalar/map/map_keys_values.cpp +8 -7
  102. package/src/duckdb/src/{function → core_functions}/scalar/math/numeric.cpp +110 -138
  103. package/src/duckdb/src/{function → core_functions}/scalar/operators/bitwise.cpp +19 -20
  104. package/src/duckdb/src/{function/scalar/math → core_functions/scalar/random}/random.cpp +5 -6
  105. package/src/duckdb/src/{function/scalar/math → core_functions/scalar/random}/setseed.cpp +3 -3
  106. package/src/duckdb/src/{function → core_functions}/scalar/string/ascii.cpp +4 -5
  107. package/src/duckdb/src/{function → core_functions}/scalar/string/bar.cpp +4 -4
  108. package/src/duckdb/src/{function → core_functions}/scalar/string/chr.cpp +5 -6
  109. package/src/duckdb/src/{function → core_functions}/scalar/string/damerau_levenshtein.cpp +4 -6
  110. package/src/duckdb/src/{function/scalar/string/mismatches.cpp → core_functions/scalar/string/hamming.cpp} +3 -12
  111. package/src/duckdb/src/{function → core_functions}/scalar/string/hex.cpp +15 -25
  112. package/src/duckdb/src/{function → core_functions}/scalar/string/instr.cpp +6 -13
  113. package/src/duckdb/src/{function → core_functions}/scalar/string/jaccard.cpp +3 -6
  114. package/src/duckdb/src/{function → core_functions}/scalar/string/jaro_winkler.cpp +7 -6
  115. package/src/duckdb/src/{function → core_functions}/scalar/string/left_right.cpp +18 -11
  116. package/src/duckdb/src/{function → core_functions}/scalar/string/levenshtein.cpp +3 -12
  117. package/src/duckdb/src/{function → core_functions}/scalar/string/md5.cpp +15 -21
  118. package/src/duckdb/src/{function → core_functions}/scalar/string/pad.cpp +7 -13
  119. package/src/duckdb/src/{function → core_functions}/scalar/string/printf.cpp +10 -10
  120. package/src/duckdb/src/{function → core_functions}/scalar/string/repeat.cpp +3 -6
  121. package/src/duckdb/src/{function → core_functions}/scalar/string/replace.cpp +4 -7
  122. package/src/duckdb/src/{function → core_functions}/scalar/string/reverse.cpp +3 -3
  123. package/src/duckdb/src/{function → core_functions}/scalar/string/starts_with.cpp +4 -8
  124. package/src/duckdb/src/{function → core_functions}/scalar/string/string_split.cpp +11 -11
  125. package/src/duckdb/src/{function → core_functions}/scalar/string/translate.cpp +4 -7
  126. package/src/duckdb/src/{function → core_functions}/scalar/string/trim.cpp +19 -14
  127. package/src/duckdb/src/core_functions/scalar/string/unicode.cpp +28 -0
  128. package/src/duckdb/src/{function → core_functions}/scalar/struct/struct_insert.cpp +4 -4
  129. package/src/duckdb/src/{function → core_functions}/scalar/struct/struct_pack.cpp +3 -4
  130. package/src/duckdb/src/{function → core_functions}/scalar/union/union_extract.cpp +4 -8
  131. package/src/duckdb/src/{function → core_functions}/scalar/union/union_tag.cpp +4 -8
  132. package/src/duckdb/src/{function → core_functions}/scalar/union/union_value.cpp +4 -59
  133. package/src/duckdb/src/execution/operator/persistent/base_csv_reader.cpp +1 -1
  134. package/src/duckdb/src/execution/operator/persistent/buffered_csv_reader.cpp +1 -1
  135. package/src/duckdb/src/execution/operator/persistent/parallel_csv_reader.cpp +1 -1
  136. package/src/duckdb/src/execution/operator/schema/physical_create_type.cpp +11 -2
  137. package/src/duckdb/src/function/aggregate/distributive_functions.cpp +0 -17
  138. package/src/duckdb/src/function/cast/string_cast.cpp +1 -1
  139. package/src/duckdb/src/function/function.cpp +0 -8
  140. package/src/duckdb/src/function/function_set.cpp +25 -0
  141. package/src/duckdb/src/function/scalar/generic_functions.cpp +1 -9
  142. package/src/duckdb/src/function/scalar/nested_functions.cpp +0 -22
  143. package/src/duckdb/src/function/scalar/operators.cpp +0 -6
  144. package/src/duckdb/src/function/scalar/{date/strftime.cpp → strftime_format.cpp} +1 -249
  145. package/src/duckdb/src/function/scalar/string/length.cpp +0 -19
  146. package/src/duckdb/src/function/scalar/string_functions.cpp +0 -40
  147. package/src/duckdb/src/function/scalar/system/aggregate_export.cpp +5 -0
  148. package/src/duckdb/src/function/table/arrow_conversion.cpp +1 -1
  149. package/src/duckdb/src/function/table/read_csv.cpp +7 -4
  150. package/src/duckdb/src/function/table/system/duckdb_functions.cpp +27 -40
  151. package/src/duckdb/src/function/table/version/pragma_version.cpp +2 -2
  152. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/aggregate_function_catalog_entry.hpp +3 -3
  153. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/function_entry.hpp +33 -0
  154. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/macro_catalog_entry.hpp +2 -2
  155. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/pragma_function_catalog_entry.hpp +2 -2
  156. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/scalar_function_catalog_entry.hpp +2 -2
  157. package/src/duckdb/src/include/duckdb/catalog/catalog_entry/table_function_catalog_entry.hpp +2 -2
  158. package/src/duckdb/src/include/duckdb/catalog/catalog_transaction.hpp +2 -0
  159. package/src/duckdb/src/include/duckdb/common/algorithm.hpp +1 -0
  160. package/src/duckdb/src/include/duckdb/common/multi_file_reader.hpp +5 -4
  161. package/src/duckdb/src/include/duckdb/common/types/vector.hpp +11 -1
  162. package/src/duckdb/src/include/duckdb/{function → core_functions}/aggregate/algebraic/corr.hpp +3 -4
  163. package/src/duckdb/src/include/duckdb/{function → core_functions}/aggregate/algebraic/covar.hpp +1 -1
  164. package/src/duckdb/src/include/duckdb/{function → core_functions}/aggregate/algebraic/stddev.hpp +1 -1
  165. package/src/duckdb/src/include/duckdb/core_functions/aggregate/algebraic_functions.hpp +124 -0
  166. package/src/duckdb/src/include/duckdb/core_functions/aggregate/distributive_functions.hpp +229 -0
  167. package/src/duckdb/src/include/duckdb/core_functions/aggregate/holistic_functions.hpp +85 -0
  168. package/src/duckdb/src/include/duckdb/core_functions/aggregate/nested_functions.hpp +41 -0
  169. package/src/duckdb/src/include/duckdb/{function → core_functions}/aggregate/regression/regr_count.hpp +3 -4
  170. package/src/duckdb/src/include/duckdb/{function → core_functions}/aggregate/regression/regr_slope.hpp +2 -2
  171. package/src/duckdb/src/include/duckdb/core_functions/aggregate/regression_functions.hpp +97 -0
  172. package/src/duckdb/src/include/duckdb/{function → core_functions}/aggregate/sum_helpers.hpp +1 -1
  173. package/src/duckdb/src/include/duckdb/{function/scalar/uuid_functions.hpp → core_functions/core_functions.hpp} +7 -5
  174. package/src/duckdb/src/include/duckdb/core_functions/function_list.hpp +33 -0
  175. package/src/duckdb/src/include/duckdb/core_functions/scalar/bit_functions.hpp +52 -0
  176. package/src/duckdb/src/include/duckdb/core_functions/scalar/blob_functions.hpp +58 -0
  177. package/src/duckdb/src/include/duckdb/core_functions/scalar/date_functions.hpp +544 -0
  178. package/src/duckdb/src/include/duckdb/core_functions/scalar/enum_functions.hpp +61 -0
  179. package/src/duckdb/src/include/duckdb/core_functions/scalar/generic_functions.hpp +142 -0
  180. package/src/duckdb/src/include/duckdb/core_functions/scalar/list_functions.hpp +220 -0
  181. package/src/duckdb/src/include/duckdb/core_functions/scalar/map_functions.hpp +85 -0
  182. package/src/duckdb/src/include/duckdb/core_functions/scalar/math_functions.hpp +394 -0
  183. package/src/duckdb/src/include/duckdb/core_functions/scalar/operators_functions.hpp +70 -0
  184. package/src/duckdb/src/include/duckdb/core_functions/scalar/random_functions.hpp +49 -0
  185. package/src/duckdb/src/include/duckdb/core_functions/scalar/string_functions.hpp +439 -0
  186. package/src/duckdb/src/include/duckdb/core_functions/scalar/struct_functions.hpp +40 -0
  187. package/src/duckdb/src/include/duckdb/core_functions/scalar/union_functions.hpp +43 -0
  188. package/src/duckdb/src/include/duckdb/execution/operator/persistent/base_csv_reader.hpp +1 -1
  189. package/src/duckdb/src/include/duckdb/execution/operator/persistent/csv_reader_options.hpp +1 -1
  190. package/src/duckdb/src/include/duckdb/execution/operator/schema/physical_create_type.hpp +4 -0
  191. package/src/duckdb/src/include/duckdb/function/aggregate/distributive_functions.hpp +0 -85
  192. package/src/duckdb/src/include/duckdb/function/built_in_functions.hpp +0 -8
  193. package/src/duckdb/src/include/duckdb/function/function_set.hpp +7 -2
  194. package/src/duckdb/src/include/duckdb/function/scalar/generic_functions.hpp +1 -36
  195. package/src/duckdb/src/include/duckdb/function/scalar/nested_functions.hpp +0 -120
  196. package/src/duckdb/src/include/duckdb/function/scalar/operators.hpp +0 -24
  197. package/src/duckdb/src/include/duckdb/function/scalar/string_functions.hpp +1 -97
  198. package/src/duckdb/src/include/duckdb/function/table/read_csv.hpp +1 -1
  199. package/src/duckdb/src/include/duckdb/main/database.hpp +1 -0
  200. package/src/duckdb/src/include/duckdb/main/database_manager.hpp +3 -0
  201. package/src/duckdb/src/include/duckdb/main/extension_helper.hpp +0 -2
  202. package/src/duckdb/src/include/duckdb/main/extension_util.hpp +48 -0
  203. package/src/duckdb/src/include/duckdb/parser/parsed_data/create_function_info.hpp +6 -0
  204. package/src/duckdb/src/include/duckdb/parser/tableref/pivotref.hpp +3 -0
  205. package/src/duckdb/src/include/duckdb/parser/transformer.hpp +5 -1
  206. package/src/duckdb/src/main/attached_database.cpp +5 -3
  207. package/src/duckdb/src/main/database.cpp +34 -37
  208. package/src/duckdb/src/main/extension/extension_helper.cpp +1 -0
  209. package/src/duckdb/src/main/extension/extension_load.cpp +61 -38
  210. package/src/duckdb/src/main/extension/extension_util.cpp +90 -0
  211. package/src/duckdb/src/parser/transform/statement/transform_create_function.cpp +1 -4
  212. package/src/duckdb/src/parser/transform/statement/transform_create_view.cpp +2 -4
  213. package/src/duckdb/src/parser/transform/statement/transform_pivot_stmt.cpp +43 -24
  214. package/src/duckdb/src/parser/transform/tableref/transform_pivot.cpp +3 -0
  215. package/src/duckdb/src/planner/binder/statement/bind_create.cpp +17 -28
  216. package/src/duckdb/src/planner/binder/statement/bind_create_table.cpp +6 -7
  217. package/src/duckdb/third_party/fmt/format.cc +0 -5
  218. package/src/duckdb/third_party/fmt/include/fmt/core.h +10 -12
  219. package/src/duckdb/third_party/fmt/include/fmt/format-inl.h +2 -33
  220. package/src/duckdb/third_party/fmt/include/fmt/format.h +61 -24
  221. package/src/duckdb/third_party/fmt/include/fmt/printf.h +15 -1
  222. package/src/duckdb/third_party/libpg_query/include/nodes/parsenodes.hpp +1 -0
  223. package/src/duckdb/third_party/libpg_query/src_backend_parser_gram.cpp +10735 -10674
  224. package/src/duckdb/ub_src_common_enums.cpp +2 -0
  225. package/src/duckdb/ub_src_core_functions.cpp +4 -0
  226. package/src/duckdb/ub_src_core_functions_aggregate_algebraic.cpp +8 -0
  227. package/src/duckdb/ub_src_core_functions_aggregate_distributive.cpp +24 -0
  228. package/src/duckdb/ub_src_core_functions_aggregate_holistic.cpp +8 -0
  229. package/src/duckdb/ub_src_core_functions_aggregate_nested.cpp +4 -0
  230. package/src/duckdb/ub_src_core_functions_aggregate_regression.cpp +14 -0
  231. package/src/duckdb/ub_src_core_functions_scalar_bit.cpp +2 -0
  232. package/src/duckdb/ub_src_core_functions_scalar_blob.cpp +4 -0
  233. package/src/duckdb/ub_src_core_functions_scalar_date.cpp +22 -0
  234. package/src/duckdb/ub_src_core_functions_scalar_enum.cpp +2 -0
  235. package/src/duckdb/ub_src_core_functions_scalar_generic.cpp +16 -0
  236. package/src/duckdb/ub_src_core_functions_scalar_list.cpp +14 -0
  237. package/src/duckdb/ub_src_core_functions_scalar_map.cpp +12 -0
  238. package/src/duckdb/ub_src_core_functions_scalar_math.cpp +2 -0
  239. package/src/duckdb/ub_src_core_functions_scalar_operators.cpp +2 -0
  240. package/src/duckdb/ub_src_core_functions_scalar_random.cpp +4 -0
  241. package/src/duckdb/ub_src_core_functions_scalar_string.cpp +44 -0
  242. package/src/duckdb/ub_src_core_functions_scalar_struct.cpp +4 -0
  243. package/src/duckdb/ub_src_core_functions_scalar_union.cpp +6 -0
  244. package/src/duckdb/ub_src_function_aggregate.cpp +0 -8
  245. package/src/duckdb/ub_src_function_aggregate_distributive.cpp +0 -24
  246. package/src/duckdb/ub_src_function_scalar.cpp +2 -8
  247. package/src/duckdb/ub_src_function_scalar_generic.cpp +0 -14
  248. package/src/duckdb/ub_src_function_scalar_list.cpp +0 -14
  249. package/src/duckdb/ub_src_function_scalar_operators.cpp +0 -2
  250. package/src/duckdb/ub_src_function_scalar_string.cpp +0 -42
  251. package/src/duckdb/ub_src_function_scalar_struct.cpp +0 -4
  252. package/src/duckdb/ub_src_function_scalar_system.cpp +0 -2
  253. package/src/duckdb/ub_src_main_extension.cpp +2 -0
  254. package/src/duckdb/src/function/aggregate/algebraic/corr.cpp +0 -14
  255. package/src/duckdb/src/function/aggregate/algebraic/covar.cpp +0 -25
  256. package/src/duckdb/src/function/aggregate/algebraic/stddev.cpp +0 -54
  257. package/src/duckdb/src/function/aggregate/algebraic_functions.cpp +0 -21
  258. package/src/duckdb/src/function/aggregate/holistic_functions.cpp +0 -12
  259. package/src/duckdb/src/function/aggregate/nested_functions.cpp +0 -10
  260. package/src/duckdb/src/function/aggregate/regression_functions.cpp +0 -21
  261. package/src/duckdb/src/function/scalar/date_functions.cpp +0 -22
  262. package/src/duckdb/src/function/scalar/enum_functions.cpp +0 -13
  263. package/src/duckdb/src/function/scalar/math_functions.cpp +0 -50
  264. package/src/duckdb/src/function/scalar/trigonometrics_functions.cpp +0 -18
  265. package/src/duckdb/src/include/duckdb/function/aggregate/algebraic_functions.hpp +0 -56
  266. package/src/duckdb/src/include/duckdb/function/aggregate/holistic_functions.hpp +0 -33
  267. package/src/duckdb/src/include/duckdb/function/aggregate/nested_functions.hpp +0 -26
  268. package/src/duckdb/src/include/duckdb/function/aggregate/regression_functions.hpp +0 -53
  269. package/src/duckdb/src/include/duckdb/function/scalar/bit_functions.hpp +0 -32
  270. package/src/duckdb/src/include/duckdb/function/scalar/blob_functions.hpp +0 -24
  271. package/src/duckdb/src/include/duckdb/function/scalar/date_functions.hpp +0 -73
  272. package/src/duckdb/src/include/duckdb/function/scalar/enum_functions.hpp +0 -37
  273. package/src/duckdb/src/include/duckdb/function/scalar/math_functions.hpp +0 -137
  274. package/src/duckdb/src/include/duckdb/function/scalar/trigonometric_functions.hpp +0 -49
  275. package/src/duckdb/ub_src_function_aggregate_algebraic.cpp +0 -8
  276. package/src/duckdb/ub_src_function_aggregate_holistic.cpp +0 -8
  277. package/src/duckdb/ub_src_function_aggregate_nested.cpp +0 -4
  278. package/src/duckdb/ub_src_function_aggregate_regression.cpp +0 -14
  279. package/src/duckdb/ub_src_function_scalar_bit.cpp +0 -2
  280. package/src/duckdb/ub_src_function_scalar_blob.cpp +0 -4
  281. package/src/duckdb/ub_src_function_scalar_date.cpp +0 -22
  282. package/src/duckdb/ub_src_function_scalar_enum.cpp +0 -2
  283. package/src/duckdb/ub_src_function_scalar_map.cpp +0 -12
  284. package/src/duckdb/ub_src_function_scalar_math.cpp +0 -6
  285. package/src/duckdb/ub_src_function_scalar_union.cpp +0 -6
  286. /package/src/duckdb/src/include/duckdb/function/scalar/{strftime.hpp → strftime_format.hpp} +0 -0
@@ -28,12 +28,11 @@ static void GetTypeFunctionsInternal(ScalarFunctionSet &set, const LogicalType &
28
28
  JSONReadManyFunctionData::Bind, nullptr, nullptr, JSONFunctionLocalState::Init));
29
29
  }
30
30
 
31
- CreateScalarFunctionInfo JSONFunctions::GetTypeFunction() {
31
+ ScalarFunctionSet JSONFunctions::GetTypeFunction() {
32
32
  ScalarFunctionSet set("json_type");
33
33
  GetTypeFunctionsInternal(set, LogicalType::VARCHAR);
34
34
  GetTypeFunctionsInternal(set, JSONCommon::JSONType());
35
-
36
- return CreateScalarFunctionInfo(std::move(set));
35
+ return set;
37
36
  }
38
37
 
39
38
  } // namespace duckdb
@@ -16,12 +16,12 @@ static void GetValidFunctionInternal(ScalarFunctionSet &set, const LogicalType &
16
16
  nullptr, JSONFunctionLocalState::Init));
17
17
  }
18
18
 
19
- CreateScalarFunctionInfo JSONFunctions::GetValidFunction() {
19
+ ScalarFunctionSet JSONFunctions::GetValidFunction() {
20
20
  ScalarFunctionSet set("json_valid");
21
21
  GetValidFunctionInternal(set, LogicalType::VARCHAR);
22
22
  GetValidFunctionInternal(set, JSONCommon::JSONType());
23
23
 
24
- return CreateScalarFunctionInfo(set);
24
+ return set;
25
25
  }
26
26
 
27
27
  } // namespace duckdb
@@ -293,33 +293,33 @@ TableFunction JSONFunctions::GetReadJSONTableFunction(shared_ptr<JSONScanInfo> f
293
293
  return table_function;
294
294
  }
295
295
 
296
- CreateTableFunctionInfo CreateJSONFunctionInfo(string name, shared_ptr<JSONScanInfo> info, bool auto_function = false) {
296
+ TableFunctionSet CreateJSONFunctionInfo(string name, shared_ptr<JSONScanInfo> info, bool auto_function = false) {
297
297
  auto table_function = JSONFunctions::GetReadJSONTableFunction(std::move(info));
298
298
  table_function.name = std::move(name);
299
299
  if (auto_function) {
300
300
  table_function.named_parameters["maximum_depth"] = LogicalType::BIGINT;
301
301
  }
302
- return CreateTableFunctionInfo(MultiFileReader::CreateFunctionSet(table_function));
302
+ return MultiFileReader::CreateFunctionSet(table_function);
303
303
  }
304
304
 
305
- CreateTableFunctionInfo JSONFunctions::GetReadJSONFunction() {
305
+ TableFunctionSet JSONFunctions::GetReadJSONFunction() {
306
306
  auto info =
307
307
  make_shared<JSONScanInfo>(JSONScanType::READ_JSON, JSONFormat::UNSTRUCTURED, JSONRecordType::RECORDS, false);
308
308
  return CreateJSONFunctionInfo("read_json", std::move(info));
309
309
  }
310
310
 
311
- CreateTableFunctionInfo JSONFunctions::GetReadNDJSONFunction() {
311
+ TableFunctionSet JSONFunctions::GetReadNDJSONFunction() {
312
312
  auto info = make_shared<JSONScanInfo>(JSONScanType::READ_JSON, JSONFormat::NEWLINE_DELIMITED,
313
313
  JSONRecordType::RECORDS, false);
314
314
  return CreateJSONFunctionInfo("read_ndjson", std::move(info));
315
315
  }
316
316
 
317
- CreateTableFunctionInfo JSONFunctions::GetReadJSONAutoFunction() {
317
+ TableFunctionSet JSONFunctions::GetReadJSONAutoFunction() {
318
318
  auto info = make_shared<JSONScanInfo>(JSONScanType::READ_JSON, JSONFormat::AUTO_DETECT, JSONRecordType::AUTO, true);
319
319
  return CreateJSONFunctionInfo("read_json_auto", std::move(info), true);
320
320
  }
321
321
 
322
- CreateTableFunctionInfo JSONFunctions::GetReadNDJSONAutoFunction() {
322
+ TableFunctionSet JSONFunctions::GetReadNDJSONAutoFunction() {
323
323
  auto info =
324
324
  make_shared<JSONScanInfo>(JSONScanType::READ_JSON, JSONFormat::NEWLINE_DELIMITED, JSONRecordType::AUTO, true);
325
325
  return CreateJSONFunctionInfo("read_ndjson_auto", std::move(info), true);
@@ -46,22 +46,22 @@ TableFunction GetReadJSONObjectsTableFunction(bool list_parameter, shared_ptr<JS
46
46
  return table_function;
47
47
  }
48
48
 
49
- CreateTableFunctionInfo JSONFunctions::GetReadJSONObjectsFunction() {
49
+ TableFunctionSet JSONFunctions::GetReadJSONObjectsFunction() {
50
50
  TableFunctionSet function_set("read_json_objects");
51
51
  auto function_info =
52
52
  make_shared<JSONScanInfo>(JSONScanType::READ_JSON_OBJECTS, JSONFormat::UNSTRUCTURED, JSONRecordType::JSON);
53
53
  function_set.AddFunction(GetReadJSONObjectsTableFunction(false, function_info));
54
54
  function_set.AddFunction(GetReadJSONObjectsTableFunction(true, function_info));
55
- return CreateTableFunctionInfo(function_set);
55
+ return function_set;
56
56
  }
57
57
 
58
- CreateTableFunctionInfo JSONFunctions::GetReadNDJSONObjectsFunction() {
58
+ TableFunctionSet JSONFunctions::GetReadNDJSONObjectsFunction() {
59
59
  TableFunctionSet function_set("read_ndjson_objects");
60
60
  auto function_info =
61
61
  make_shared<JSONScanInfo>(JSONScanType::READ_JSON_OBJECTS, JSONFormat::NEWLINE_DELIMITED, JSONRecordType::JSON);
62
62
  function_set.AddFunction(GetReadJSONObjectsTableFunction(false, function_info));
63
63
  function_set.AddFunction(GetReadJSONObjectsTableFunction(true, function_info));
64
- return CreateTableFunctionInfo(function_set);
64
+ return function_set;
65
65
  }
66
66
 
67
67
  } // namespace duckdb
@@ -121,8 +121,8 @@ JSONFunctionLocalState &JSONFunctionLocalState::ResetAndGet(ExpressionState &sta
121
121
  return lstate;
122
122
  }
123
123
 
124
- vector<CreateScalarFunctionInfo> JSONFunctions::GetScalarFunctions() {
125
- vector<CreateScalarFunctionInfo> functions;
124
+ vector<ScalarFunctionSet> JSONFunctions::GetScalarFunctions() {
125
+ vector<ScalarFunctionSet> functions;
126
126
 
127
127
  // Extract functions
128
128
  AddAliases({"json_extract", "json_extract_path"}, GetExtractFunction(), functions);
@@ -153,14 +153,14 @@ vector<CreateScalarFunctionInfo> JSONFunctions::GetScalarFunctions() {
153
153
  return functions;
154
154
  }
155
155
 
156
- vector<CreatePragmaFunctionInfo> JSONFunctions::GetPragmaFunctions() {
157
- vector<CreatePragmaFunctionInfo> functions;
156
+ vector<PragmaFunctionSet> JSONFunctions::GetPragmaFunctions() {
157
+ vector<PragmaFunctionSet> functions;
158
158
  functions.push_back(GetExecuteJsonSerializedSqlPragmaFunction());
159
159
  return functions;
160
160
  }
161
161
 
162
- vector<CreateTableFunctionInfo> JSONFunctions::GetTableFunctions() {
163
- vector<CreateTableFunctionInfo> functions;
162
+ vector<TableFunctionSet> JSONFunctions::GetTableFunctions() {
163
+ vector<TableFunctionSet> functions;
164
164
 
165
165
  // Reads JSON as string
166
166
  functions.push_back(GetReadJSONObjectsFunction());
@@ -34,6 +34,7 @@
34
34
  #include "duckdb/catalog/catalog_entry/table_function_catalog_entry.hpp"
35
35
  #include "duckdb/common/multi_file_reader.hpp"
36
36
  #include "duckdb/storage/table/row_group.hpp"
37
+ #include "duckdb/main/extension_util.hpp"
37
38
  #endif
38
39
 
39
40
  namespace duckdb {
@@ -368,7 +369,8 @@ public:
368
369
  continue;
369
370
  }
370
371
  MultiFileReader::InitializeReader(*reader, bind_data.parquet_options.file_options, bind_data.reader_bind,
371
- bind_data.types, bind_data.names, input.column_ids, input.filters);
372
+ bind_data.types, bind_data.names, input.column_ids, input.filters,
373
+ bind_data.files[0]);
372
374
  }
373
375
 
374
376
  result->column_ids = input.column_ids;
@@ -560,9 +562,9 @@ public:
560
562
  shared_ptr<ParquetReader> reader;
561
563
  try {
562
564
  reader = make_shared<ParquetReader>(context, file, pq_options);
563
- MultiFileReader::InitializeReader(*reader, bind_data.parquet_options.file_options,
564
- bind_data.reader_bind, bind_data.types, bind_data.names,
565
- parallel_state.column_ids, parallel_state.filters);
565
+ MultiFileReader::InitializeReader(
566
+ *reader, bind_data.parquet_options.file_options, bind_data.reader_bind, bind_data.types,
567
+ bind_data.names, parallel_state.column_ids, parallel_state.filters, bind_data.files.front());
566
568
  } catch (...) {
567
569
  parallel_lock.lock();
568
570
  parallel_state.error_opening_file = true;
@@ -687,20 +689,23 @@ unique_ptr<TableRef> ParquetScanReplacement(ClientContext &context, const string
687
689
  }
688
690
 
689
691
  void ParquetExtension::Load(DuckDB &db) {
692
+ auto &db_instance = *db.instance;
690
693
  auto &fs = db.GetFileSystem();
691
694
  fs.RegisterSubSystem(FileCompressionType::ZSTD, make_uniq<ZStdFileSystem>());
692
695
 
693
696
  auto scan_fun = ParquetScanFunction::GetFunctionSet();
694
- CreateTableFunctionInfo cinfo(scan_fun);
695
- cinfo.name = "read_parquet";
696
- CreateTableFunctionInfo pq_scan = cinfo;
697
- pq_scan.name = "parquet_scan";
697
+ scan_fun.name = "read_parquet";
698
+ ExtensionUtil::RegisterFunction(db_instance, scan_fun);
699
+ scan_fun.name = "parquet_scan";
700
+ ExtensionUtil::RegisterFunction(db_instance, scan_fun);
698
701
 
702
+ // parquet_metadata
699
703
  ParquetMetaDataFunction meta_fun;
700
- CreateTableFunctionInfo meta_cinfo(MultiFileReader::CreateFunctionSet(meta_fun));
704
+ ExtensionUtil::RegisterFunction(db_instance, MultiFileReader::CreateFunctionSet(meta_fun));
701
705
 
706
+ // parquet_schema
702
707
  ParquetSchemaFunction schema_fun;
703
- CreateTableFunctionInfo schema_cinfo(MultiFileReader::CreateFunctionSet(schema_fun));
708
+ ExtensionUtil::RegisterFunction(db_instance, MultiFileReader::CreateFunctionSet(schema_fun));
704
709
 
705
710
  CopyFunction function("parquet");
706
711
  function.copy_to_bind = ParquetWriteBind;
@@ -714,24 +719,7 @@ void ParquetExtension::Load(DuckDB &db) {
714
719
  function.copy_from_function = scan_fun.functions[0];
715
720
 
716
721
  function.extension = "parquet";
717
- CreateCopyFunctionInfo info(function);
718
-
719
- Connection con(db);
720
- con.BeginTransaction();
721
- auto &context = *con.context;
722
- auto &catalog = Catalog::GetSystemCatalog(context);
723
-
724
- if (catalog.GetEntry<TableFunctionCatalogEntry>(context, DEFAULT_SCHEMA, "parquet_scan",
725
- OnEntryNotFound::RETURN_NULL)) {
726
- throw InvalidInputException("Parquet extension is either already loaded or built-in");
727
- }
728
-
729
- catalog.CreateCopyFunction(context, info);
730
- catalog.CreateTableFunction(context, cinfo);
731
- catalog.CreateTableFunction(context, pq_scan);
732
- catalog.CreateTableFunction(context, meta_cinfo);
733
- catalog.CreateTableFunction(context, schema_cinfo);
734
- con.Commit();
722
+ ExtensionUtil::RegisterFunction(db_instance, function);
735
723
 
736
724
  auto &config = DBConfig::GetConfig(*db.instance);
737
725
  config.replacement_scans.emplace_back(ParquetScanReplacement);
@@ -5,8 +5,7 @@ namespace duckdb {
5
5
 
6
6
  PragmaFunctionCatalogEntry::PragmaFunctionCatalogEntry(Catalog &catalog, SchemaCatalogEntry &schema,
7
7
  CreatePragmaFunctionInfo &info)
8
- : StandardEntry(CatalogType::PRAGMA_FUNCTION_ENTRY, schema, catalog, info.name),
9
- functions(std::move(info.functions)) {
8
+ : FunctionEntry(CatalogType::PRAGMA_FUNCTION_ENTRY, catalog, schema, info), functions(std::move(info.functions)) {
10
9
  }
11
10
 
12
11
  } // namespace duckdb
@@ -5,7 +5,7 @@ namespace duckdb {
5
5
 
6
6
  ScalarFunctionCatalogEntry::ScalarFunctionCatalogEntry(Catalog &catalog, SchemaCatalogEntry &schema,
7
7
  CreateScalarFunctionInfo &info)
8
- : StandardEntry(CatalogType::SCALAR_FUNCTION_ENTRY, schema, catalog, info.name), functions(info.functions) {
8
+ : FunctionEntry(CatalogType::SCALAR_FUNCTION_ENTRY, catalog, schema, info), functions(info.functions) {
9
9
  }
10
10
 
11
11
  unique_ptr<CatalogEntry> ScalarFunctionCatalogEntry::AlterEntry(ClientContext &context, AlterInfo &info) {
@@ -7,9 +7,9 @@
7
7
  namespace duckdb {
8
8
 
9
9
  MacroCatalogEntry::MacroCatalogEntry(Catalog &catalog, SchemaCatalogEntry &schema, CreateMacroInfo &info)
10
- : StandardEntry(
10
+ : FunctionEntry(
11
11
  (info.function->type == MacroType::SCALAR_MACRO ? CatalogType::MACRO_ENTRY : CatalogType::TABLE_MACRO_ENTRY),
12
- schema, catalog, info.name),
12
+ catalog, schema, info),
13
13
  function(std::move(info.function)) {
14
14
  this->temporary = info.temporary;
15
15
  this->internal = info.internal;
@@ -5,8 +5,7 @@ namespace duckdb {
5
5
 
6
6
  TableFunctionCatalogEntry::TableFunctionCatalogEntry(Catalog &catalog, SchemaCatalogEntry &schema,
7
7
  CreateTableFunctionInfo &info)
8
- : StandardEntry(CatalogType::TABLE_FUNCTION_ENTRY, schema, catalog, info.name),
9
- functions(std::move(info.functions)) {
8
+ : FunctionEntry(CatalogType::TABLE_FUNCTION_ENTRY, catalog, schema, info), functions(std::move(info.functions)) {
10
9
  D_ASSERT(this->functions.Size() > 0);
11
10
  }
12
11
 
@@ -31,4 +31,8 @@ ClientContext &CatalogTransaction::GetContext() {
31
31
  return *context;
32
32
  }
33
33
 
34
+ CatalogTransaction CatalogTransaction::GetSystemTransaction(DatabaseInstance &db) {
35
+ return CatalogTransaction(db, 1, 1);
36
+ }
37
+
34
38
  } // namespace duckdb
@@ -7,6 +7,9 @@
7
7
  #include "duckdb/catalog/default/default_schemas.hpp"
8
8
  #include "duckdb/function/built_in_functions.hpp"
9
9
  #include "duckdb/main/attached_database.hpp"
10
+ #ifndef DISABLE_CORE_FUNCTIONS_EXTENSION
11
+ #include "duckdb/core_functions/core_functions.hpp"
12
+ #endif
10
13
 
11
14
  namespace duckdb {
12
15
 
@@ -22,7 +25,7 @@ void DuckCatalog::Initialize(bool load_builtin) {
22
25
  // first initialize the base system catalogs
23
26
  // these are never written to the WAL
24
27
  // we start these at 1 because deleted entries default to 0
25
- CatalogTransaction data(GetDatabase(), 1, 1);
28
+ auto data = CatalogTransaction::GetSystemTransaction(GetDatabase());
26
29
 
27
30
  // create the default schema
28
31
  CreateSchemaInfo info;
@@ -34,6 +37,10 @@ void DuckCatalog::Initialize(bool load_builtin) {
34
37
  // initialize default functions
35
38
  BuiltinFunctions builtin(data, *this);
36
39
  builtin.Initialize();
40
+
41
+ #ifndef DISABLE_CORE_FUNCTIONS_EXTENSION
42
+ CoreFunctions::RegisterFunctions(*this, data);
43
+ #endif
37
44
  }
38
45
 
39
46
  Verify();
@@ -0,0 +1,82 @@
1
+ #include "duckdb/common/enums/date_part_specifier.hpp"
2
+ #include "duckdb/common/string_util.hpp"
3
+
4
+ namespace duckdb {
5
+
6
+ bool TryGetDatePartSpecifier(const string &specifier_p, DatePartSpecifier &result) {
7
+ auto specifier = StringUtil::Lower(specifier_p);
8
+ if (specifier == "year" || specifier == "yr" || specifier == "y" || specifier == "years" || specifier == "yrs") {
9
+ result = DatePartSpecifier::YEAR;
10
+ } else if (specifier == "month" || specifier == "mon" || specifier == "months" || specifier == "mons") {
11
+ result = DatePartSpecifier::MONTH;
12
+ } else if (specifier == "day" || specifier == "days" || specifier == "d" || specifier == "dayofmonth") {
13
+ result = DatePartSpecifier::DAY;
14
+ } else if (specifier == "decade" || specifier == "dec" || specifier == "decades" || specifier == "decs") {
15
+ result = DatePartSpecifier::DECADE;
16
+ } else if (specifier == "century" || specifier == "cent" || specifier == "centuries" || specifier == "c") {
17
+ result = DatePartSpecifier::CENTURY;
18
+ } else if (specifier == "millennium" || specifier == "mil" || specifier == "millenniums" ||
19
+ specifier == "millennia" || specifier == "mils" || specifier == "millenium") {
20
+ result = DatePartSpecifier::MILLENNIUM;
21
+ } else if (specifier == "microseconds" || specifier == "microsecond" || specifier == "us" || specifier == "usec" ||
22
+ specifier == "usecs" || specifier == "usecond" || specifier == "useconds") {
23
+ result = DatePartSpecifier::MICROSECONDS;
24
+ } else if (specifier == "milliseconds" || specifier == "millisecond" || specifier == "ms" || specifier == "msec" ||
25
+ specifier == "msecs" || specifier == "msecond" || specifier == "mseconds") {
26
+ result = DatePartSpecifier::MILLISECONDS;
27
+ } else if (specifier == "second" || specifier == "sec" || specifier == "seconds" || specifier == "secs" ||
28
+ specifier == "s") {
29
+ result = DatePartSpecifier::SECOND;
30
+ } else if (specifier == "minute" || specifier == "min" || specifier == "minutes" || specifier == "mins" ||
31
+ specifier == "m") {
32
+ result = DatePartSpecifier::MINUTE;
33
+ } else if (specifier == "hour" || specifier == "hr" || specifier == "hours" || specifier == "hrs" ||
34
+ specifier == "h") {
35
+ result = DatePartSpecifier::HOUR;
36
+ } else if (specifier == "epoch") {
37
+ // seconds since 1970-01-01
38
+ result = DatePartSpecifier::EPOCH;
39
+ } else if (specifier == "dow" || specifier == "dayofweek" || specifier == "weekday") {
40
+ // day of the week (Sunday = 0, Saturday = 6)
41
+ result = DatePartSpecifier::DOW;
42
+ } else if (specifier == "isodow") {
43
+ // isodow (Monday = 1, Sunday = 7)
44
+ result = DatePartSpecifier::ISODOW;
45
+ } else if (specifier == "week" || specifier == "weeks" || specifier == "w" || specifier == "weekofyear") {
46
+ // ISO week number
47
+ result = DatePartSpecifier::WEEK;
48
+ } else if (specifier == "doy" || specifier == "dayofyear") {
49
+ // day of the year (1-365/366)
50
+ result = DatePartSpecifier::DOY;
51
+ } else if (specifier == "quarter" || specifier == "quarters") {
52
+ // quarter of the year (1-4)
53
+ result = DatePartSpecifier::QUARTER;
54
+ } else if (specifier == "yearweek") {
55
+ // Combined isoyear and isoweek YYYYWW
56
+ result = DatePartSpecifier::YEARWEEK;
57
+ } else if (specifier == "isoyear") {
58
+ // ISO year (first week of the year may be in previous year)
59
+ result = DatePartSpecifier::ISOYEAR;
60
+ } else if (specifier == "era") {
61
+ result = DatePartSpecifier::ERA;
62
+ } else if (specifier == "timezone") {
63
+ result = DatePartSpecifier::TIMEZONE;
64
+ } else if (specifier == "timezone_hour") {
65
+ result = DatePartSpecifier::TIMEZONE_HOUR;
66
+ } else if (specifier == "timezone_minute") {
67
+ result = DatePartSpecifier::TIMEZONE_MINUTE;
68
+ } else {
69
+ return false;
70
+ }
71
+ return true;
72
+ }
73
+
74
+ DatePartSpecifier GetDatePartSpecifier(const string &specifier) {
75
+ DatePartSpecifier result;
76
+ if (!TryGetDatePartSpecifier(specifier, result)) {
77
+ throw ConversionException("extract specifier \"%s\" not recognized", specifier);
78
+ }
79
+ return result;
80
+ }
81
+
82
+ } // namespace duckdb
@@ -977,7 +977,6 @@ vector<string> LocalFileSystem::Glob(const string &path, FileOpener *opener) {
977
977
  throw IOException("Cannot use multiple \'**\' in one path");
978
978
  }
979
979
 
980
- bool recursive_search = false;
981
980
  for (idx_t i = absolute_path ? 1 : 0; i < splits.size(); i++) {
982
981
  bool is_last_chunk = i + 1 == splits.size();
983
982
  bool has_glob = HasGlob(splits[i]);
@@ -989,7 +988,7 @@ vector<string> LocalFileSystem::Glob(const string &path, FileOpener *opener) {
989
988
  if (previous_directories.empty()) {
990
989
  result.push_back(splits[i]);
991
990
  } else {
992
- if (recursive_search && is_last_chunk) {
991
+ if (is_last_chunk) {
993
992
  for (auto &prev_directory : previous_directories) {
994
993
  const string filename = JoinPath(prev_directory, splits[i]);
995
994
  if (FileExists(filename) || DirectoryExists(filename)) {
@@ -1004,7 +1003,6 @@ vector<string> LocalFileSystem::Glob(const string &path, FileOpener *opener) {
1004
1003
  }
1005
1004
  } else {
1006
1005
  if (IsCrawl(splits[i])) {
1007
- recursive_search = true;
1008
1006
  if (!is_last_chunk) {
1009
1007
  result = previous_directories;
1010
1008
  }
@@ -192,7 +192,7 @@ void MultiFileReader::FinalizeBind(const MultiFileReaderOptions &file_options, c
192
192
  void MultiFileReader::CreateNameMapping(const string &file_name, const vector<LogicalType> &local_types,
193
193
  const vector<string> &local_names, const vector<LogicalType> &global_types,
194
194
  const vector<string> &global_names, const vector<column_t> &global_column_ids,
195
- MultiFileReaderData &reader_data) {
195
+ MultiFileReaderData &reader_data, const string &initial_file) {
196
196
  D_ASSERT(global_types.size() == global_names.size());
197
197
  D_ASSERT(local_types.size() == local_names.size());
198
198
  // we have expected types: create a map of name -> column index
@@ -229,11 +229,12 @@ void MultiFileReader::CreateNameMapping(const string &file_name, const vector<Lo
229
229
  }
230
230
  candidate_names += local_name;
231
231
  }
232
- throw IOException(StringUtil::Format(
233
- "Failed to read file \"%s\": schema mismatch in glob: column \"%s\" was read from "
234
- "the original file, but could not be found in file \"%s\".\nCandidate names: %s\nIf you are trying to "
235
- "read files with different schemas, try setting union_by_name=True",
236
- file_name, global_name, file_name, candidate_names));
232
+ throw IOException(
233
+ StringUtil::Format("Failed to read file \"%s\": schema mismatch in glob: column \"%s\" was read from "
234
+ "the original file \"%s\", but could not be found in file \"%s\".\nCandidate names: "
235
+ "%s\nIf you are trying to "
236
+ "read files with different schemas, try setting union_by_name=True",
237
+ file_name, global_name, initial_file, file_name, candidate_names));
237
238
  }
238
239
  // we found the column in the local file - check if the types are the same
239
240
  auto local_id = entry->second;
@@ -254,8 +255,10 @@ void MultiFileReader::CreateNameMapping(const string &file_name, const vector<Lo
254
255
  void MultiFileReader::CreateMapping(const string &file_name, const vector<LogicalType> &local_types,
255
256
  const vector<string> &local_names, const vector<LogicalType> &global_types,
256
257
  const vector<string> &global_names, const vector<column_t> &global_column_ids,
257
- optional_ptr<TableFilterSet> filters, MultiFileReaderData &reader_data) {
258
- CreateNameMapping(file_name, local_types, local_names, global_types, global_names, global_column_ids, reader_data);
258
+ optional_ptr<TableFilterSet> filters, MultiFileReaderData &reader_data,
259
+ const string &initial_file) {
260
+ CreateNameMapping(file_name, local_types, local_names, global_types, global_names, global_column_ids, reader_data,
261
+ initial_file);
259
262
  if (filters) {
260
263
  reader_data.filter_map.resize(global_types.size());
261
264
  for (idx_t c = 0; c < reader_data.column_mapping.size(); c++) {