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
@@ -0,0 +1,50 @@
1
+ #include "duckdb/core_functions/core_functions.hpp"
2
+ #include "duckdb/core_functions/function_list.hpp"
3
+ #include "duckdb/parser/parsed_data/create_aggregate_function_info.hpp"
4
+ #include "duckdb/parser/parsed_data/create_scalar_function_info.hpp"
5
+
6
+ namespace duckdb {
7
+
8
+ template <class T>
9
+ void FillExtraInfo(StaticFunctionDefinition &function, T &info) {
10
+ info.internal = true;
11
+ info.description = function.description;
12
+ info.parameter_names = StringUtil::Split(function.parameters, ",");
13
+ info.example = function.example;
14
+ }
15
+
16
+ void CoreFunctions::RegisterFunctions(Catalog &catalog, CatalogTransaction transaction) {
17
+ auto functions = StaticFunctionDefinition::GetFunctionList();
18
+ for (idx_t i = 0; functions[i].name; i++) {
19
+ auto &function = functions[i];
20
+ if (function.get_function || function.get_function_set) {
21
+ // scalar function
22
+ ScalarFunctionSet result;
23
+ if (function.get_function) {
24
+ result.AddFunction(function.get_function());
25
+ } else {
26
+ result = function.get_function_set();
27
+ }
28
+ result.name = function.name;
29
+ CreateScalarFunctionInfo info(result);
30
+ FillExtraInfo(function, info);
31
+ catalog.CreateFunction(transaction, info);
32
+ } else if (function.get_aggregate_function || function.get_aggregate_function_set) {
33
+ // aggregate function
34
+ AggregateFunctionSet result;
35
+ if (function.get_aggregate_function) {
36
+ result.AddFunction(function.get_aggregate_function());
37
+ } else {
38
+ result = function.get_aggregate_function_set();
39
+ }
40
+ result.name = function.name;
41
+ CreateAggregateFunctionInfo info(result);
42
+ FillExtraInfo(function, info);
43
+ catalog.CreateFunction(transaction, info);
44
+ } else {
45
+ throw InternalException("Do not know how to register function of this type");
46
+ }
47
+ }
48
+ }
49
+
50
+ } // namespace duckdb
@@ -0,0 +1,352 @@
1
+ #include "duckdb/core_functions/function_list.hpp"
2
+ #include "duckdb/core_functions/aggregate/algebraic_functions.hpp"
3
+ #include "duckdb/core_functions/aggregate/distributive_functions.hpp"
4
+ #include "duckdb/core_functions/aggregate/holistic_functions.hpp"
5
+ #include "duckdb/core_functions/aggregate/nested_functions.hpp"
6
+ #include "duckdb/core_functions/aggregate/regression_functions.hpp"
7
+ #include "duckdb/core_functions/scalar/bit_functions.hpp"
8
+ #include "duckdb/core_functions/scalar/blob_functions.hpp"
9
+ #include "duckdb/core_functions/scalar/date_functions.hpp"
10
+ #include "duckdb/core_functions/scalar/enum_functions.hpp"
11
+ #include "duckdb/core_functions/scalar/generic_functions.hpp"
12
+ #include "duckdb/core_functions/scalar/list_functions.hpp"
13
+ #include "duckdb/core_functions/scalar/map_functions.hpp"
14
+ #include "duckdb/core_functions/scalar/math_functions.hpp"
15
+ #include "duckdb/core_functions/scalar/operators_functions.hpp"
16
+ #include "duckdb/core_functions/scalar/random_functions.hpp"
17
+ #include "duckdb/core_functions/scalar/string_functions.hpp"
18
+ #include "duckdb/core_functions/scalar/struct_functions.hpp"
19
+ #include "duckdb/core_functions/scalar/union_functions.hpp"
20
+
21
+ namespace duckdb {
22
+
23
+ // Scalar Function
24
+ #define DUCKDB_SCALAR_FUNCTION_BASE(_PARAM, _NAME) \
25
+ { _NAME, _PARAM::Parameters, _PARAM::Description, _PARAM::Example, _PARAM::GetFunction, nullptr, nullptr, nullptr }
26
+ #define DUCKDB_SCALAR_FUNCTION(_PARAM) DUCKDB_SCALAR_FUNCTION_BASE(_PARAM, _PARAM::Name)
27
+ #define DUCKDB_SCALAR_FUNCTION_ALIAS(_PARAM) DUCKDB_SCALAR_FUNCTION_BASE(_PARAM::ALIAS, _PARAM::Name)
28
+ // Scalar Function Set
29
+ #define DUCKDB_SCALAR_FUNCTION_SET_BASE(_PARAM, _NAME) \
30
+ { _NAME, _PARAM::Parameters, _PARAM::Description, _PARAM::Example, nullptr, _PARAM::GetFunctions, nullptr, nullptr }
31
+ #define DUCKDB_SCALAR_FUNCTION_SET(_PARAM) DUCKDB_SCALAR_FUNCTION_SET_BASE(_PARAM, _PARAM::Name)
32
+ #define DUCKDB_SCALAR_FUNCTION_SET_ALIAS(_PARAM) DUCKDB_SCALAR_FUNCTION_SET_BASE(_PARAM::ALIAS, _PARAM::Name)
33
+ // Aggregate Function
34
+ #define DUCKDB_AGGREGATE_FUNCTION_BASE(_PARAM, _NAME) \
35
+ { _NAME, _PARAM::Parameters, _PARAM::Description, _PARAM::Example, nullptr, nullptr, _PARAM::GetFunction, nullptr }
36
+ #define DUCKDB_AGGREGATE_FUNCTION(_PARAM) DUCKDB_AGGREGATE_FUNCTION_BASE(_PARAM, _PARAM::Name)
37
+ #define DUCKDB_AGGREGATE_FUNCTION_ALIAS(_PARAM) DUCKDB_AGGREGATE_FUNCTION_BASE(_PARAM::ALIAS, _PARAM::Name)
38
+ // Aggregate Function Set
39
+ #define DUCKDB_AGGREGATE_FUNCTION_SET_BASE(_PARAM, _NAME) \
40
+ { _NAME, _PARAM::Parameters, _PARAM::Description, _PARAM::Example, nullptr, nullptr, nullptr, _PARAM::GetFunctions }
41
+ #define DUCKDB_AGGREGATE_FUNCTION_SET(_PARAM) DUCKDB_AGGREGATE_FUNCTION_SET_BASE(_PARAM, _PARAM::Name)
42
+ #define DUCKDB_AGGREGATE_FUNCTION_SET_ALIAS(_PARAM) DUCKDB_AGGREGATE_FUNCTION_SET_BASE(_PARAM::ALIAS, _PARAM::Name)
43
+ #define FINAL_FUNCTION \
44
+ { nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr }
45
+
46
+ // this list is generated by scripts/generate_functions.py
47
+ static StaticFunctionDefinition internal_functions[] = {
48
+ DUCKDB_SCALAR_FUNCTION(FactorialOperatorFun),
49
+ DUCKDB_SCALAR_FUNCTION_SET(BitwiseAndFun),
50
+ DUCKDB_SCALAR_FUNCTION(PowOperatorFun),
51
+ DUCKDB_SCALAR_FUNCTION_SET(LeftShiftFun),
52
+ DUCKDB_SCALAR_FUNCTION_SET(RightShiftFun),
53
+ DUCKDB_SCALAR_FUNCTION_SET(AbsOperatorFun),
54
+ DUCKDB_SCALAR_FUNCTION_ALIAS(PowOperatorFunAlias),
55
+ DUCKDB_SCALAR_FUNCTION(StartsWithOperatorFun),
56
+ DUCKDB_SCALAR_FUNCTION_SET_ALIAS(AbsFun),
57
+ DUCKDB_SCALAR_FUNCTION(AcosFun),
58
+ DUCKDB_SCALAR_FUNCTION_SET(AgeFun),
59
+ DUCKDB_SCALAR_FUNCTION_ALIAS(AggregateFun),
60
+ DUCKDB_SCALAR_FUNCTION(AliasFun),
61
+ DUCKDB_SCALAR_FUNCTION_ALIAS(ApplyFun),
62
+ DUCKDB_AGGREGATE_FUNCTION_SET(ApproxCountDistinctFun),
63
+ DUCKDB_AGGREGATE_FUNCTION_SET(ApproxQuantileFun),
64
+ DUCKDB_AGGREGATE_FUNCTION_SET(ArgMaxFun),
65
+ DUCKDB_AGGREGATE_FUNCTION_SET(ArgMinFun),
66
+ DUCKDB_AGGREGATE_FUNCTION_SET_ALIAS(ArgmaxFun),
67
+ DUCKDB_AGGREGATE_FUNCTION_SET_ALIAS(ArgminFun),
68
+ DUCKDB_AGGREGATE_FUNCTION_ALIAS(ArrayAggFun),
69
+ DUCKDB_SCALAR_FUNCTION_ALIAS(ArrayAggrFun),
70
+ DUCKDB_SCALAR_FUNCTION_ALIAS(ArrayAggregateFun),
71
+ DUCKDB_SCALAR_FUNCTION_ALIAS(ArrayApplyFun),
72
+ DUCKDB_SCALAR_FUNCTION_ALIAS(ArrayDistinctFun),
73
+ DUCKDB_SCALAR_FUNCTION_ALIAS(ArrayFilterFun),
74
+ DUCKDB_SCALAR_FUNCTION_SET_ALIAS(ArrayReverseSortFun),
75
+ DUCKDB_SCALAR_FUNCTION_ALIAS(ArraySliceFun),
76
+ DUCKDB_SCALAR_FUNCTION_SET_ALIAS(ArraySortFun),
77
+ DUCKDB_SCALAR_FUNCTION_ALIAS(ArrayTransformFun),
78
+ DUCKDB_SCALAR_FUNCTION_ALIAS(ArrayUniqueFun),
79
+ DUCKDB_SCALAR_FUNCTION(ASCIIFun),
80
+ DUCKDB_SCALAR_FUNCTION(AsinFun),
81
+ DUCKDB_SCALAR_FUNCTION(AtanFun),
82
+ DUCKDB_SCALAR_FUNCTION(Atan2Fun),
83
+ DUCKDB_AGGREGATE_FUNCTION_SET(AvgFun),
84
+ DUCKDB_SCALAR_FUNCTION_SET(BarFun),
85
+ DUCKDB_SCALAR_FUNCTION_ALIAS(Base64Fun),
86
+ DUCKDB_SCALAR_FUNCTION_SET(BinFun),
87
+ DUCKDB_AGGREGATE_FUNCTION_SET(BitAndFun),
88
+ DUCKDB_SCALAR_FUNCTION_SET(BitCountFun),
89
+ DUCKDB_AGGREGATE_FUNCTION_SET(BitOrFun),
90
+ DUCKDB_SCALAR_FUNCTION(BitPositionFun),
91
+ DUCKDB_AGGREGATE_FUNCTION_SET(BitXorFun),
92
+ DUCKDB_SCALAR_FUNCTION(BitStringFun),
93
+ DUCKDB_AGGREGATE_FUNCTION_SET(BitstringAggFun),
94
+ DUCKDB_AGGREGATE_FUNCTION(BoolAndFun),
95
+ DUCKDB_AGGREGATE_FUNCTION(BoolOrFun),
96
+ DUCKDB_SCALAR_FUNCTION(CardinalityFun),
97
+ DUCKDB_SCALAR_FUNCTION(CbrtFun),
98
+ DUCKDB_SCALAR_FUNCTION_SET(CeilFun),
99
+ DUCKDB_SCALAR_FUNCTION_SET_ALIAS(CeilingFun),
100
+ DUCKDB_SCALAR_FUNCTION_SET(CenturyFun),
101
+ DUCKDB_SCALAR_FUNCTION(ChrFun),
102
+ DUCKDB_AGGREGATE_FUNCTION(CorrFun),
103
+ DUCKDB_SCALAR_FUNCTION(CosFun),
104
+ DUCKDB_SCALAR_FUNCTION(CotFun),
105
+ DUCKDB_AGGREGATE_FUNCTION(CovarPopFun),
106
+ DUCKDB_AGGREGATE_FUNCTION(CovarSampFun),
107
+ DUCKDB_SCALAR_FUNCTION(CurrentDatabaseFun),
108
+ DUCKDB_SCALAR_FUNCTION(CurrentDateFun),
109
+ DUCKDB_SCALAR_FUNCTION(CurrentQueryFun),
110
+ DUCKDB_SCALAR_FUNCTION(CurrentSchemaFun),
111
+ DUCKDB_SCALAR_FUNCTION(CurrentSchemasFun),
112
+ DUCKDB_SCALAR_FUNCTION(CurrentSettingFun),
113
+ DUCKDB_SCALAR_FUNCTION(DamerauLevenshteinFun),
114
+ DUCKDB_SCALAR_FUNCTION_SET(DateDiffFun),
115
+ DUCKDB_SCALAR_FUNCTION_SET(DatePartFun),
116
+ DUCKDB_SCALAR_FUNCTION_SET(DateSubFun),
117
+ DUCKDB_SCALAR_FUNCTION_SET(DateTruncFun),
118
+ DUCKDB_SCALAR_FUNCTION_SET_ALIAS(DatediffFun),
119
+ DUCKDB_SCALAR_FUNCTION_SET_ALIAS(DatepartFun),
120
+ DUCKDB_SCALAR_FUNCTION_SET_ALIAS(DatesubFun),
121
+ DUCKDB_SCALAR_FUNCTION_SET_ALIAS(DatetruncFun),
122
+ DUCKDB_SCALAR_FUNCTION_SET(DayFun),
123
+ DUCKDB_SCALAR_FUNCTION_SET(DayNameFun),
124
+ DUCKDB_SCALAR_FUNCTION_SET(DayOfMonthFun),
125
+ DUCKDB_SCALAR_FUNCTION_SET(DayOfWeekFun),
126
+ DUCKDB_SCALAR_FUNCTION_SET(DayOfYearFun),
127
+ DUCKDB_SCALAR_FUNCTION_SET(DecadeFun),
128
+ DUCKDB_SCALAR_FUNCTION(DecodeFun),
129
+ DUCKDB_SCALAR_FUNCTION(DegreesFun),
130
+ DUCKDB_SCALAR_FUNCTION_ALIAS(Editdist3Fun),
131
+ DUCKDB_SCALAR_FUNCTION_ALIAS(ElementAtFun),
132
+ DUCKDB_SCALAR_FUNCTION(EncodeFun),
133
+ DUCKDB_AGGREGATE_FUNCTION_SET(EntropyFun),
134
+ DUCKDB_SCALAR_FUNCTION(EnumCodeFun),
135
+ DUCKDB_SCALAR_FUNCTION(EnumFirstFun),
136
+ DUCKDB_SCALAR_FUNCTION(EnumLastFun),
137
+ DUCKDB_SCALAR_FUNCTION(EnumRangeFun),
138
+ DUCKDB_SCALAR_FUNCTION(EnumRangeBoundaryFun),
139
+ DUCKDB_SCALAR_FUNCTION_SET(EpochFun),
140
+ DUCKDB_SCALAR_FUNCTION(EpochMsFun),
141
+ DUCKDB_SCALAR_FUNCTION_SET(EraFun),
142
+ DUCKDB_SCALAR_FUNCTION(ErrorFun),
143
+ DUCKDB_SCALAR_FUNCTION(EvenFun),
144
+ DUCKDB_SCALAR_FUNCTION(ExpFun),
145
+ DUCKDB_SCALAR_FUNCTION_ALIAS(FactorialFun),
146
+ DUCKDB_AGGREGATE_FUNCTION(FAvgFun),
147
+ DUCKDB_SCALAR_FUNCTION_ALIAS(FilterFun),
148
+ DUCKDB_SCALAR_FUNCTION(ListFlattenFun),
149
+ DUCKDB_SCALAR_FUNCTION_SET(FloorFun),
150
+ DUCKDB_SCALAR_FUNCTION(FormatFun),
151
+ DUCKDB_SCALAR_FUNCTION(FromBase64Fun),
152
+ DUCKDB_SCALAR_FUNCTION_ALIAS(FromBinaryFun),
153
+ DUCKDB_SCALAR_FUNCTION_ALIAS(FromHexFun),
154
+ DUCKDB_AGGREGATE_FUNCTION_ALIAS(FsumFun),
155
+ DUCKDB_SCALAR_FUNCTION(GammaFun),
156
+ DUCKDB_SCALAR_FUNCTION_SET_ALIAS(GcdFun),
157
+ DUCKDB_SCALAR_FUNCTION_ALIAS(GenRandomUuidFun),
158
+ DUCKDB_SCALAR_FUNCTION_SET(GenerateSeriesFun),
159
+ DUCKDB_SCALAR_FUNCTION(GetBitFun),
160
+ DUCKDB_SCALAR_FUNCTION(CurrentTimeFun),
161
+ DUCKDB_SCALAR_FUNCTION(GetCurrentTimestampFun),
162
+ DUCKDB_SCALAR_FUNCTION_SET(GreatestFun),
163
+ DUCKDB_SCALAR_FUNCTION_SET(GreatestCommonDivisorFun),
164
+ DUCKDB_AGGREGATE_FUNCTION_SET_ALIAS(GroupConcatFun),
165
+ DUCKDB_SCALAR_FUNCTION(HammingFun),
166
+ DUCKDB_SCALAR_FUNCTION(HashFun),
167
+ DUCKDB_SCALAR_FUNCTION_SET(HexFun),
168
+ DUCKDB_AGGREGATE_FUNCTION_SET(HistogramFun),
169
+ DUCKDB_SCALAR_FUNCTION_SET(HoursFun),
170
+ DUCKDB_SCALAR_FUNCTION(InstrFun),
171
+ DUCKDB_SCALAR_FUNCTION_SET(IsFiniteFun),
172
+ DUCKDB_SCALAR_FUNCTION_SET(IsInfiniteFun),
173
+ DUCKDB_SCALAR_FUNCTION_SET(IsNanFun),
174
+ DUCKDB_SCALAR_FUNCTION_SET(ISODayOfWeekFun),
175
+ DUCKDB_SCALAR_FUNCTION_SET(ISOYearFun),
176
+ DUCKDB_SCALAR_FUNCTION(JaccardFun),
177
+ DUCKDB_SCALAR_FUNCTION(JaroSimilarityFun),
178
+ DUCKDB_SCALAR_FUNCTION(JaroWinklerSimilarityFun),
179
+ DUCKDB_AGGREGATE_FUNCTION(KahanSumFun),
180
+ DUCKDB_AGGREGATE_FUNCTION(KurtosisFun),
181
+ DUCKDB_SCALAR_FUNCTION_SET(LastDayFun),
182
+ DUCKDB_SCALAR_FUNCTION_SET_ALIAS(LcmFun),
183
+ DUCKDB_SCALAR_FUNCTION_SET(LeastFun),
184
+ DUCKDB_SCALAR_FUNCTION_SET(LeastCommonMultipleFun),
185
+ DUCKDB_SCALAR_FUNCTION(LeftFun),
186
+ DUCKDB_SCALAR_FUNCTION(LeftGraphemeFun),
187
+ DUCKDB_SCALAR_FUNCTION(LevenshteinFun),
188
+ DUCKDB_SCALAR_FUNCTION(LogGammaFun),
189
+ DUCKDB_AGGREGATE_FUNCTION(ListFun),
190
+ DUCKDB_SCALAR_FUNCTION_ALIAS(ListAggrFun),
191
+ DUCKDB_SCALAR_FUNCTION(ListAggregateFun),
192
+ DUCKDB_SCALAR_FUNCTION_ALIAS(ListApplyFun),
193
+ DUCKDB_SCALAR_FUNCTION(ListDistinctFun),
194
+ DUCKDB_SCALAR_FUNCTION(ListFilterFun),
195
+ DUCKDB_SCALAR_FUNCTION_ALIAS(ListPackFun),
196
+ DUCKDB_SCALAR_FUNCTION_SET(ListReverseSortFun),
197
+ DUCKDB_SCALAR_FUNCTION(ListSliceFun),
198
+ DUCKDB_SCALAR_FUNCTION_SET(ListSortFun),
199
+ DUCKDB_SCALAR_FUNCTION(ListTransformFun),
200
+ DUCKDB_SCALAR_FUNCTION(ListUniqueFun),
201
+ DUCKDB_SCALAR_FUNCTION(ListValueFun),
202
+ DUCKDB_SCALAR_FUNCTION(LnFun),
203
+ DUCKDB_SCALAR_FUNCTION_ALIAS(LogFun),
204
+ DUCKDB_SCALAR_FUNCTION(Log10Fun),
205
+ DUCKDB_SCALAR_FUNCTION(Log2Fun),
206
+ DUCKDB_SCALAR_FUNCTION(LpadFun),
207
+ DUCKDB_SCALAR_FUNCTION_SET(LtrimFun),
208
+ DUCKDB_AGGREGATE_FUNCTION_SET(MadFun),
209
+ DUCKDB_SCALAR_FUNCTION_SET(MakeDateFun),
210
+ DUCKDB_SCALAR_FUNCTION(MakeTimeFun),
211
+ DUCKDB_SCALAR_FUNCTION(MakeTimestampFun),
212
+ DUCKDB_SCALAR_FUNCTION(MapFun),
213
+ DUCKDB_SCALAR_FUNCTION(MapEntriesFun),
214
+ DUCKDB_SCALAR_FUNCTION(MapExtractFun),
215
+ DUCKDB_SCALAR_FUNCTION(MapFromEntriesFun),
216
+ DUCKDB_SCALAR_FUNCTION(MapKeysFun),
217
+ DUCKDB_SCALAR_FUNCTION(MapValuesFun),
218
+ DUCKDB_AGGREGATE_FUNCTION_SET(MaxFun),
219
+ DUCKDB_AGGREGATE_FUNCTION_SET_ALIAS(MaxByFun),
220
+ DUCKDB_SCALAR_FUNCTION(MD5Fun),
221
+ DUCKDB_SCALAR_FUNCTION(MD5NumberFun),
222
+ DUCKDB_SCALAR_FUNCTION(MD5NumberLowerFun),
223
+ DUCKDB_SCALAR_FUNCTION(MD5NumberUpperFun),
224
+ DUCKDB_AGGREGATE_FUNCTION_SET_ALIAS(MeanFun),
225
+ DUCKDB_AGGREGATE_FUNCTION_SET(MedianFun),
226
+ DUCKDB_SCALAR_FUNCTION_SET(MicrosecondsFun),
227
+ DUCKDB_SCALAR_FUNCTION_SET(MillenniumFun),
228
+ DUCKDB_SCALAR_FUNCTION_SET(MillisecondsFun),
229
+ DUCKDB_AGGREGATE_FUNCTION_SET(MinFun),
230
+ DUCKDB_AGGREGATE_FUNCTION_SET_ALIAS(MinByFun),
231
+ DUCKDB_SCALAR_FUNCTION_SET(MinutesFun),
232
+ DUCKDB_SCALAR_FUNCTION_ALIAS(MismatchesFun),
233
+ DUCKDB_AGGREGATE_FUNCTION_SET(ModeFun),
234
+ DUCKDB_SCALAR_FUNCTION_SET(MonthFun),
235
+ DUCKDB_SCALAR_FUNCTION_SET(MonthNameFun),
236
+ DUCKDB_SCALAR_FUNCTION_SET(NextAfterFun),
237
+ DUCKDB_SCALAR_FUNCTION_ALIAS(NowFun),
238
+ DUCKDB_SCALAR_FUNCTION_ALIAS(OrdFun),
239
+ DUCKDB_SCALAR_FUNCTION(PiFun),
240
+ DUCKDB_SCALAR_FUNCTION_ALIAS(PositionFun),
241
+ DUCKDB_SCALAR_FUNCTION_ALIAS(PowFun),
242
+ DUCKDB_SCALAR_FUNCTION_ALIAS(PowerFun),
243
+ DUCKDB_SCALAR_FUNCTION(PrintfFun),
244
+ DUCKDB_AGGREGATE_FUNCTION(ProductFun),
245
+ DUCKDB_AGGREGATE_FUNCTION_SET_ALIAS(QuantileFun),
246
+ DUCKDB_AGGREGATE_FUNCTION_SET(QuantileContFun),
247
+ DUCKDB_AGGREGATE_FUNCTION_SET(QuantileDiscFun),
248
+ DUCKDB_SCALAR_FUNCTION_SET(QuarterFun),
249
+ DUCKDB_SCALAR_FUNCTION(RadiansFun),
250
+ DUCKDB_SCALAR_FUNCTION(RandomFun),
251
+ DUCKDB_SCALAR_FUNCTION_SET(ListRangeFun),
252
+ DUCKDB_SCALAR_FUNCTION_SET_ALIAS(RegexpSplitToArrayFun),
253
+ DUCKDB_AGGREGATE_FUNCTION(RegrAvgxFun),
254
+ DUCKDB_AGGREGATE_FUNCTION(RegrAvgyFun),
255
+ DUCKDB_AGGREGATE_FUNCTION(RegrCountFun),
256
+ DUCKDB_AGGREGATE_FUNCTION(RegrInterceptFun),
257
+ DUCKDB_AGGREGATE_FUNCTION(RegrR2Fun),
258
+ DUCKDB_AGGREGATE_FUNCTION(RegrSlopeFun),
259
+ DUCKDB_AGGREGATE_FUNCTION(RegrSXXFun),
260
+ DUCKDB_AGGREGATE_FUNCTION(RegrSXYFun),
261
+ DUCKDB_AGGREGATE_FUNCTION(RegrSYYFun),
262
+ DUCKDB_SCALAR_FUNCTION(RepeatFun),
263
+ DUCKDB_SCALAR_FUNCTION(ReplaceFun),
264
+ DUCKDB_AGGREGATE_FUNCTION_SET(ReservoirQuantileFun),
265
+ DUCKDB_SCALAR_FUNCTION(ReverseFun),
266
+ DUCKDB_SCALAR_FUNCTION(RightFun),
267
+ DUCKDB_SCALAR_FUNCTION(RightGraphemeFun),
268
+ DUCKDB_SCALAR_FUNCTION_SET(RoundFun),
269
+ DUCKDB_SCALAR_FUNCTION_ALIAS(RowFun),
270
+ DUCKDB_SCALAR_FUNCTION(RpadFun),
271
+ DUCKDB_SCALAR_FUNCTION_SET(RtrimFun),
272
+ DUCKDB_SCALAR_FUNCTION_SET(SecondsFun),
273
+ DUCKDB_AGGREGATE_FUNCTION(StandardErrorOfTheMeanFun),
274
+ DUCKDB_SCALAR_FUNCTION(SetBitFun),
275
+ DUCKDB_SCALAR_FUNCTION(SetseedFun),
276
+ DUCKDB_SCALAR_FUNCTION_SET(SignFun),
277
+ DUCKDB_SCALAR_FUNCTION_SET(SignBitFun),
278
+ DUCKDB_SCALAR_FUNCTION(SinFun),
279
+ DUCKDB_AGGREGATE_FUNCTION(SkewnessFun),
280
+ DUCKDB_SCALAR_FUNCTION_ALIAS(SplitFun),
281
+ DUCKDB_SCALAR_FUNCTION(SqrtFun),
282
+ DUCKDB_SCALAR_FUNCTION_ALIAS(StartsWithFun),
283
+ DUCKDB_SCALAR_FUNCTION(StatsFun),
284
+ DUCKDB_AGGREGATE_FUNCTION_ALIAS(StddevFun),
285
+ DUCKDB_AGGREGATE_FUNCTION(StdDevPopFun),
286
+ DUCKDB_AGGREGATE_FUNCTION(StdDevSampFun),
287
+ DUCKDB_SCALAR_FUNCTION_ALIAS(StrSplitFun),
288
+ DUCKDB_SCALAR_FUNCTION_SET_ALIAS(StrSplitRegexFun),
289
+ DUCKDB_SCALAR_FUNCTION_SET(StrfTimeFun),
290
+ DUCKDB_AGGREGATE_FUNCTION_SET(StringAggFun),
291
+ DUCKDB_SCALAR_FUNCTION(StringSplitFun),
292
+ DUCKDB_SCALAR_FUNCTION_SET(StringSplitRegexFun),
293
+ DUCKDB_SCALAR_FUNCTION_ALIAS(StringToArrayFun),
294
+ DUCKDB_SCALAR_FUNCTION_ALIAS(StrposFun),
295
+ DUCKDB_SCALAR_FUNCTION_SET(StrpTimeFun),
296
+ DUCKDB_SCALAR_FUNCTION(StructInsertFun),
297
+ DUCKDB_SCALAR_FUNCTION(StructPackFun),
298
+ DUCKDB_AGGREGATE_FUNCTION_SET(SumFun),
299
+ DUCKDB_AGGREGATE_FUNCTION_SET(SumNoOverflowFun),
300
+ DUCKDB_AGGREGATE_FUNCTION_ALIAS(SumkahanFun),
301
+ DUCKDB_SCALAR_FUNCTION(TanFun),
302
+ DUCKDB_SCALAR_FUNCTION_SET(TimeBucketFun),
303
+ DUCKDB_SCALAR_FUNCTION_SET(TimezoneFun),
304
+ DUCKDB_SCALAR_FUNCTION_SET(TimezoneHourFun),
305
+ DUCKDB_SCALAR_FUNCTION_SET(TimezoneMinuteFun),
306
+ DUCKDB_SCALAR_FUNCTION(ToBase64Fun),
307
+ DUCKDB_SCALAR_FUNCTION_SET_ALIAS(ToBinaryFun),
308
+ DUCKDB_SCALAR_FUNCTION(ToDaysFun),
309
+ DUCKDB_SCALAR_FUNCTION_SET_ALIAS(ToHexFun),
310
+ DUCKDB_SCALAR_FUNCTION(ToHoursFun),
311
+ DUCKDB_SCALAR_FUNCTION(ToMicrosecondsFun),
312
+ DUCKDB_SCALAR_FUNCTION(ToMillisecondsFun),
313
+ DUCKDB_SCALAR_FUNCTION(ToMinutesFun),
314
+ DUCKDB_SCALAR_FUNCTION(ToMonthsFun),
315
+ DUCKDB_SCALAR_FUNCTION(ToSecondsFun),
316
+ DUCKDB_SCALAR_FUNCTION(ToTimestampFun),
317
+ DUCKDB_SCALAR_FUNCTION(ToYearsFun),
318
+ DUCKDB_SCALAR_FUNCTION_ALIAS(TodayFun),
319
+ DUCKDB_SCALAR_FUNCTION_ALIAS(TransactionTimestampFun),
320
+ DUCKDB_SCALAR_FUNCTION(TranslateFun),
321
+ DUCKDB_SCALAR_FUNCTION_SET(TrimFun),
322
+ DUCKDB_SCALAR_FUNCTION_SET(TruncFun),
323
+ DUCKDB_SCALAR_FUNCTION_SET(TryStrpTimeFun),
324
+ DUCKDB_SCALAR_FUNCTION(CurrentTransactionIdFun),
325
+ DUCKDB_SCALAR_FUNCTION(TypeOfFun),
326
+ DUCKDB_SCALAR_FUNCTION(UnbinFun),
327
+ DUCKDB_SCALAR_FUNCTION(UnhexFun),
328
+ DUCKDB_SCALAR_FUNCTION(UnicodeFun),
329
+ DUCKDB_SCALAR_FUNCTION(UnionExtractFun),
330
+ DUCKDB_SCALAR_FUNCTION(UnionTagFun),
331
+ DUCKDB_SCALAR_FUNCTION(UnionValueFun),
332
+ DUCKDB_SCALAR_FUNCTION(UUIDFun),
333
+ DUCKDB_AGGREGATE_FUNCTION(VarPopFun),
334
+ DUCKDB_AGGREGATE_FUNCTION(VarSampFun),
335
+ DUCKDB_AGGREGATE_FUNCTION_ALIAS(VarianceFun),
336
+ DUCKDB_SCALAR_FUNCTION(VersionFun),
337
+ DUCKDB_SCALAR_FUNCTION_SET(WeekFun),
338
+ DUCKDB_SCALAR_FUNCTION_SET(WeekDayFun),
339
+ DUCKDB_SCALAR_FUNCTION_SET(WeekOfYearFun),
340
+ DUCKDB_SCALAR_FUNCTION_SET(BitwiseXorFun),
341
+ DUCKDB_SCALAR_FUNCTION_SET(YearFun),
342
+ DUCKDB_SCALAR_FUNCTION_SET(YearWeekFun),
343
+ DUCKDB_SCALAR_FUNCTION_SET(BitwiseOrFun),
344
+ DUCKDB_SCALAR_FUNCTION_SET(BitwiseNotFun),
345
+ FINAL_FUNCTION
346
+ };
347
+
348
+ StaticFunctionDefinition *StaticFunctionDefinition::GetFunctionList() {
349
+ return internal_functions;
350
+ }
351
+
352
+ } // namespace duckdb
@@ -1,5 +1,5 @@
1
+ #include "duckdb/core_functions/scalar/bit_functions.hpp"
1
2
  #include "duckdb/common/types/bit.hpp"
2
- #include "duckdb/function/scalar/bit_functions.hpp"
3
3
  #include "duckdb/common/types/cast_helpers.hpp"
4
4
 
5
5
  namespace duckdb {
@@ -7,7 +7,6 @@ namespace duckdb {
7
7
  //===--------------------------------------------------------------------===//
8
8
  // BitStringFunction
9
9
  //===--------------------------------------------------------------------===//
10
-
11
10
  static void BitStringFunction(DataChunk &args, ExpressionState &state, Vector &result) {
12
11
  BinaryExecutor::Execute<string_t, int32_t, string_t>(
13
12
  args.data[0], args.data[1], result, args.size(), [&](string_t input, int32_t n) {
@@ -28,10 +27,8 @@ static void BitStringFunction(DataChunk &args, ExpressionState &state, Vector &r
28
27
  });
29
28
  }
30
29
 
31
- void BitStringFun::RegisterFunction(BuiltinFunctions &set) {
32
- // bitstring creates a new bitstring from varchar with a fixed-length
33
- set.AddFunction(
34
- ScalarFunction("bitstring", {LogicalType::VARCHAR, LogicalType::INTEGER}, LogicalType::BIT, BitStringFunction));
30
+ ScalarFunction BitStringFun::GetFunction() {
31
+ return ScalarFunction({LogicalType::VARCHAR, LogicalType::INTEGER}, LogicalType::BIT, BitStringFunction);
35
32
  }
36
33
 
37
34
  //===--------------------------------------------------------------------===//
@@ -48,9 +45,9 @@ struct GetBitOperator {
48
45
  }
49
46
  };
50
47
 
51
- void GetBitFun::RegisterFunction(BuiltinFunctions &set) {
52
- set.AddFunction(ScalarFunction("get_bit", {LogicalType::BIT, LogicalType::INTEGER}, LogicalType::INTEGER,
53
- ScalarFunction::BinaryFunction<string_t, int32_t, int32_t, GetBitOperator>));
48
+ ScalarFunction GetBitFun::GetFunction() {
49
+ return ScalarFunction({LogicalType::BIT, LogicalType::INTEGER}, LogicalType::INTEGER,
50
+ ScalarFunction::BinaryFunction<string_t, int32_t, int32_t, GetBitOperator>);
54
51
  }
55
52
 
56
53
  //===--------------------------------------------------------------------===//
@@ -74,9 +71,9 @@ static void SetBitOperation(DataChunk &args, ExpressionState &state, Vector &res
74
71
  });
75
72
  }
76
73
 
77
- void SetBitFun::RegisterFunction(BuiltinFunctions &set) {
78
- set.AddFunction(ScalarFunction("set_bit", {LogicalType::BIT, LogicalType::INTEGER, LogicalType::INTEGER},
79
- LogicalType::BIT, SetBitOperation));
74
+ ScalarFunction SetBitFun::GetFunction() {
75
+ return ScalarFunction({LogicalType::BIT, LogicalType::INTEGER, LogicalType::INTEGER}, LogicalType::BIT,
76
+ SetBitOperation);
80
77
  }
81
78
 
82
79
  //===--------------------------------------------------------------------===//
@@ -92,9 +89,9 @@ struct BitPositionOperator {
92
89
  }
93
90
  };
94
91
 
95
- void BitPositionFun::RegisterFunction(BuiltinFunctions &set) {
96
- set.AddFunction(ScalarFunction("bit_position", {LogicalType::BIT, LogicalType::BIT}, LogicalType::INTEGER,
97
- ScalarFunction::BinaryFunction<string_t, string_t, int32_t, BitPositionOperator>));
92
+ ScalarFunction BitPositionFun::GetFunction() {
93
+ return ScalarFunction({LogicalType::BIT, LogicalType::BIT}, LogicalType::INTEGER,
94
+ ScalarFunction::BinaryFunction<string_t, string_t, int32_t, BitPositionOperator>);
98
95
  }
99
96
 
100
97
  } // namespace duckdb
@@ -1,4 +1,4 @@
1
- #include "duckdb/function/scalar/blob_functions.hpp"
1
+ #include "duckdb/core_functions/scalar/blob_functions.hpp"
2
2
  #include "duckdb/common/types/blob.hpp"
3
3
 
4
4
  namespace duckdb {
@@ -34,12 +34,12 @@ static void Base64DecodeFunction(DataChunk &args, ExpressionState &state, Vector
34
34
  UnaryExecutor::ExecuteString<string_t, string_t, Base64DecodeOperator>(args.data[0], result, args.size());
35
35
  }
36
36
 
37
- void Base64Fun::RegisterFunction(BuiltinFunctions &set) {
38
- // base64 encode
39
- ScalarFunction to_base64({LogicalType::BLOB}, LogicalType::VARCHAR, Base64EncodeFunction);
40
- set.AddFunction({"base64", "to_base64"}, to_base64); // to_base64 is a mysql alias
37
+ ScalarFunction ToBase64Fun::GetFunction() {
38
+ return ScalarFunction({LogicalType::BLOB}, LogicalType::VARCHAR, Base64EncodeFunction);
39
+ }
41
40
 
42
- set.AddFunction(ScalarFunction("from_base64", {LogicalType::VARCHAR}, LogicalType::BLOB, Base64DecodeFunction));
41
+ ScalarFunction FromBase64Fun::GetFunction() {
42
+ return ScalarFunction({LogicalType::VARCHAR}, LogicalType::BLOB, Base64DecodeFunction);
43
43
  }
44
44
 
45
45
  } // namespace duckdb
@@ -1,4 +1,4 @@
1
- #include "duckdb/function/scalar/blob_functions.hpp"
1
+ #include "duckdb/core_functions/scalar/blob_functions.hpp"
2
2
  #include "utf8proc_wrapper.hpp"
3
3
 
4
4
  namespace duckdb {
@@ -28,11 +28,12 @@ static void DecodeFunction(DataChunk &args, ExpressionState &state, Vector &resu
28
28
  StringVector::AddHeapReference(result, args.data[0]);
29
29
  }
30
30
 
31
- void EncodeFun::RegisterFunction(BuiltinFunctions &set) {
32
- // encode goes from varchar -> blob, this never fails
33
- set.AddFunction(ScalarFunction("encode", {LogicalType::VARCHAR}, LogicalType::BLOB, EncodeFunction));
34
- // decode goes from blob -> varchar, this fails if the varchar is not valid utf8
35
- set.AddFunction(ScalarFunction("decode", {LogicalType::BLOB}, LogicalType::VARCHAR, DecodeFunction));
31
+ ScalarFunction EncodeFun::GetFunction() {
32
+ return ScalarFunction({LogicalType::VARCHAR}, LogicalType::BLOB, EncodeFunction);
33
+ }
34
+
35
+ ScalarFunction DecodeFun::GetFunction() {
36
+ return ScalarFunction({LogicalType::BLOB}, LogicalType::VARCHAR, DecodeFunction);
36
37
  }
37
38
 
38
39
  } // namespace duckdb
@@ -1,4 +1,4 @@
1
- #include "duckdb/function/scalar/date_functions.hpp"
1
+ #include "duckdb/core_functions/scalar/date_functions.hpp"
2
2
  #include "duckdb/common/types/interval.hpp"
3
3
  #include "duckdb/common/types/time.hpp"
4
4
  #include "duckdb/common/types/timestamp.hpp"
@@ -38,12 +38,12 @@ static void AgeFunction(DataChunk &input, ExpressionState &state, Vector &result
38
38
  });
39
39
  }
40
40
 
41
- void AgeFun::RegisterFunction(BuiltinFunctions &set) {
41
+ ScalarFunctionSet AgeFun::GetFunctions() {
42
42
  ScalarFunctionSet age("age");
43
43
  age.AddFunction(ScalarFunction({LogicalType::TIMESTAMP}, LogicalType::INTERVAL, AgeFunctionStandard));
44
44
  age.AddFunction(
45
45
  ScalarFunction({LogicalType::TIMESTAMP, LogicalType::TIMESTAMP}, LogicalType::INTERVAL, AgeFunction));
46
- set.AddFunction(age);
46
+ return age;
47
47
  }
48
48
 
49
49
  } // namespace duckdb
@@ -1,4 +1,4 @@
1
- #include "duckdb/function/scalar/date_functions.hpp"
1
+ #include "duckdb/core_functions/scalar/date_functions.hpp"
2
2
 
3
3
  #include "duckdb/common/exception.hpp"
4
4
  #include "duckdb/common/types/timestamp.hpp"
@@ -33,22 +33,22 @@ static void CurrentTimestampFunction(DataChunk &input, ExpressionState &state, V
33
33
  result.Reference(val);
34
34
  }
35
35
 
36
- void CurrentTimeFun::RegisterFunction(BuiltinFunctions &set) {
37
- ScalarFunction current_time("get_current_time", {}, LogicalType::TIME, CurrentTimeFunction);
36
+ ScalarFunction CurrentTimeFun::GetFunction() {
37
+ ScalarFunction current_time({}, LogicalType::TIME, CurrentTimeFunction);
38
38
  current_time.side_effects = FunctionSideEffects::HAS_SIDE_EFFECTS;
39
- set.AddFunction(current_time);
39
+ return current_time;
40
40
  }
41
41
 
42
- void CurrentDateFun::RegisterFunction(BuiltinFunctions &set) {
42
+ ScalarFunction CurrentDateFun::GetFunction() {
43
43
  ScalarFunction current_date({}, LogicalType::DATE, CurrentDateFunction);
44
44
  current_date.side_effects = FunctionSideEffects::HAS_SIDE_EFFECTS;
45
- set.AddFunction({"today", "current_date"}, current_date);
45
+ return current_date;
46
46
  }
47
47
 
48
- void CurrentTimestampFun::RegisterFunction(BuiltinFunctions &set) {
48
+ ScalarFunction GetCurrentTimestampFun::GetFunction() {
49
49
  ScalarFunction current_timestamp({}, LogicalType::TIMESTAMP_TZ, CurrentTimestampFunction);
50
50
  current_timestamp.side_effects = FunctionSideEffects::HAS_SIDE_EFFECTS;
51
- set.AddFunction({"now", "get_current_timestamp", "transaction_timestamp"}, current_timestamp);
51
+ return current_timestamp;
52
52
  }
53
53
 
54
54
  } // namespace duckdb
@@ -1,4 +1,4 @@
1
- #include "duckdb/function/scalar/date_functions.hpp"
1
+ #include "duckdb/core_functions/scalar/date_functions.hpp"
2
2
  #include "duckdb/common/enums/date_part_specifier.hpp"
3
3
  #include "duckdb/common/exception.hpp"
4
4
  #include "duckdb/common/operator/subtract.hpp"
@@ -424,7 +424,7 @@ static void DateDiffFunction(DataChunk &args, ExpressionState &state, Vector &re
424
424
  }
425
425
  }
426
426
 
427
- void DateDiffFun::RegisterFunction(BuiltinFunctions &set) {
427
+ ScalarFunctionSet DateDiffFun::GetFunctions() {
428
428
  ScalarFunctionSet date_diff("date_diff");
429
429
  date_diff.AddFunction(ScalarFunction({LogicalType::VARCHAR, LogicalType::DATE, LogicalType::DATE},
430
430
  LogicalType::BIGINT, DateDiffFunction<date_t>));
@@ -432,10 +432,7 @@ void DateDiffFun::RegisterFunction(BuiltinFunctions &set) {
432
432
  LogicalType::BIGINT, DateDiffFunction<timestamp_t>));
433
433
  date_diff.AddFunction(ScalarFunction({LogicalType::VARCHAR, LogicalType::TIME, LogicalType::TIME},
434
434
  LogicalType::BIGINT, DateDiffFunction<dtime_t>));
435
- set.AddFunction(date_diff);
436
-
437
- date_diff.name = "datediff";
438
- set.AddFunction(date_diff);
435
+ return date_diff;
439
436
  }
440
437
 
441
438
  } // namespace duckdb