|
| 1 | +use std::sync::Arc; |
| 2 | + |
| 3 | +use datafusion::{ |
| 4 | + functions::{ |
| 5 | + core::*, crypto::*, datetime::*, encoding::*, math::*, regex::*, string::*, |
| 6 | + unicode::*, |
| 7 | + }, |
| 8 | + functions_nested::*, |
| 9 | + logical_expr::ScalarUDF, |
| 10 | +}; |
| 11 | + |
| 12 | +pub fn scalar_functions() -> Vec<Arc<ScalarUDF>> { |
| 13 | + vec![ |
| 14 | + // datefusion core |
| 15 | + nullif(), |
| 16 | + arrow_cast(), |
| 17 | + nvl(), |
| 18 | + nvl2(), |
| 19 | + overlay(), |
| 20 | + arrow_typeof(), |
| 21 | + named_struct(), |
| 22 | + get_field(), |
| 23 | + coalesce(), |
| 24 | + greatest(), |
| 25 | + least(), |
| 26 | + union_extract(), |
| 27 | + union_tag(), |
| 28 | + version(), |
| 29 | + r#struct(), |
| 30 | + // datafusion crypto |
| 31 | + digest(), |
| 32 | + md5(), |
| 33 | + sha224(), |
| 34 | + sha256(), |
| 35 | + sha384(), |
| 36 | + sha512(), |
| 37 | + // datafusion datetime |
| 38 | + current_date(), |
| 39 | + current_time(), |
| 40 | + date_bin(), |
| 41 | + date_part(), |
| 42 | + date_trunc(), |
| 43 | + date_diff(), |
| 44 | + from_unixtime(), |
| 45 | + make_date(), |
| 46 | + now(), |
| 47 | + to_char(), |
| 48 | + to_date(), |
| 49 | + to_local_time(), |
| 50 | + to_unixtime(), |
| 51 | + to_timestamp(), |
| 52 | + to_timestamp_seconds(), |
| 53 | + to_timestamp_millis(), |
| 54 | + to_timestamp_micros(), |
| 55 | + to_timestamp_nanos(), |
| 56 | + // datafusion encoding |
| 57 | + encode(), |
| 58 | + decode(), |
| 59 | + // datafusion math |
| 60 | + abs(), |
| 61 | + acos(), |
| 62 | + acosh(), |
| 63 | + asin(), |
| 64 | + asinh(), |
| 65 | + atan(), |
| 66 | + atan2(), |
| 67 | + atanh(), |
| 68 | + cbrt(), |
| 69 | + ceil(), |
| 70 | + cos(), |
| 71 | + cosh(), |
| 72 | + cot(), |
| 73 | + degrees(), |
| 74 | + exp(), |
| 75 | + factorial(), |
| 76 | + floor(), |
| 77 | + gcd(), |
| 78 | + isnan(), |
| 79 | + iszero(), |
| 80 | + lcm(), |
| 81 | + ln(), |
| 82 | + log(), |
| 83 | + log2(), |
| 84 | + log10(), |
| 85 | + nanvl(), |
| 86 | + pi(), |
| 87 | + power(), |
| 88 | + radians(), |
| 89 | + random(), |
| 90 | + signum(), |
| 91 | + sin(), |
| 92 | + sinh(), |
| 93 | + sqrt(), |
| 94 | + tan(), |
| 95 | + tanh(), |
| 96 | + round(), |
| 97 | + trunc(), |
| 98 | + // datafusion regex |
| 99 | + regexp_count(), |
| 100 | + regexp_match(), |
| 101 | + regexp_instr(), |
| 102 | + regexp_like(), |
| 103 | + regexp_replace(), |
| 104 | + // datafusion string |
| 105 | + ascii(), |
| 106 | + bit_length(), |
| 107 | + btrim(), |
| 108 | + chr(), |
| 109 | + concat(), |
| 110 | + concat_ws(), |
| 111 | + ends_with(), |
| 112 | + levenshtein(), |
| 113 | + lower(), |
| 114 | + ltrim(), |
| 115 | + octet_length(), |
| 116 | + repeat(), |
| 117 | + replace(), |
| 118 | + rtrim(), |
| 119 | + split_part(), |
| 120 | + starts_with(), |
| 121 | + to_hex(), |
| 122 | + upper(), |
| 123 | + uuid(), |
| 124 | + contains(), |
| 125 | + // datafusion unicode |
| 126 | + character_length(), |
| 127 | + find_in_set(), |
| 128 | + initcap(), |
| 129 | + left(), |
| 130 | + lpad(), |
| 131 | + reverse(), |
| 132 | + right(), |
| 133 | + rpad(), |
| 134 | + strpos(), |
| 135 | + substr(), |
| 136 | + substr_index(), |
| 137 | + translate(), |
| 138 | + // datafusion nested |
| 139 | + string::array_to_string_udf(), |
| 140 | + string::string_to_array_udf(), |
| 141 | + range::range_udf(), |
| 142 | + range::gen_series_udf(), |
| 143 | + dimension::array_dims_udf(), |
| 144 | + cardinality::cardinality_udf(), |
| 145 | + dimension::array_ndims_udf(), |
| 146 | + datafusion::functions_nested::concat::array_append_udf(), |
| 147 | + datafusion::functions_nested::concat::array_prepend_udf(), |
| 148 | + datafusion::functions_nested::concat::array_concat_udf(), |
| 149 | + except::array_except_udf(), |
| 150 | + extract::array_element_udf(), |
| 151 | + extract::array_pop_back_udf(), |
| 152 | + extract::array_pop_front_udf(), |
| 153 | + extract::array_slice_udf(), |
| 154 | + extract::array_any_value_udf(), |
| 155 | + make_array::make_array_udf(), |
| 156 | + array_has::array_has_udf(), |
| 157 | + array_has::array_has_all_udf(), |
| 158 | + array_has::array_has_any_udf(), |
| 159 | + empty::array_empty_udf(), |
| 160 | + length::array_length_udf(), |
| 161 | + distance::array_distance_udf(), |
| 162 | + flatten::flatten_udf(), |
| 163 | + min_max::array_max_udf(), |
| 164 | + min_max::array_min_udf(), |
| 165 | + sort::array_sort_udf(), |
| 166 | + datafusion::functions_nested::repeat::array_repeat_udf(), |
| 167 | + resize::array_resize_udf(), |
| 168 | + datafusion::functions_nested::reverse::array_reverse_udf(), |
| 169 | + set_ops::array_distinct_udf(), |
| 170 | + set_ops::array_intersect_udf(), |
| 171 | + set_ops::array_union_udf(), |
| 172 | + position::array_position_udf(), |
| 173 | + position::array_positions_udf(), |
| 174 | + remove::array_remove_udf(), |
| 175 | + remove::array_remove_all_udf(), |
| 176 | + remove::array_remove_n_udf(), |
| 177 | + datafusion::functions_nested::replace::array_replace_n_udf(), |
| 178 | + datafusion::functions_nested::replace::array_replace_all_udf(), |
| 179 | + datafusion::functions_nested::replace::array_replace_udf(), |
| 180 | + map::map_udf(), |
| 181 | + map_entries::map_entries_udf(), |
| 182 | + map_extract::map_extract_udf(), |
| 183 | + map_keys::map_keys_udf(), |
| 184 | + map_values::map_values_udf(), |
| 185 | + ] |
| 186 | +} |
0 commit comments