数学函数
- round
- bround
- floor
- ceil
- rand
- exp
- log
- pow
- sqrt
- bin
- hex
- unhex
- abs
- pmod
- sin
- asin
- cos
- acos
- tan
- atan
- degrees
- radians
- signum
- factorial
- cbrt
- shiftleft
- shiftright
- shiftrightunsigned
- greatest
- least
集合函数
- size
- array_contains
- sort_array
类型转换函数
日期函数
- from_unixtime
- unix_timestamp
- to_date
- year
- quarter
- month
- dayofmonth
- dayofyear
- hour
- minute
- second
- weekofyear
- datediff
- date_add
- date_sub
- from_utc_timestamp
- to_utc_timestamp
- current_date
- current_timestamp
- add_months
- last_day
- next_day
- trunc
- months_between
- date_format
条件函数
- nvl
- COALESCE
- when
- isnull
字符函数
- ascii
- base64
- concat
- concat_ws
- decode
- encode
- format_number
- get_json_object
- instr
- length
- locate
- lower
- lpad
- ltrim
- format_string 对应Hive中的 printf
- regexp_extract
- regexp_replace
- repeat
- reverse
- rpad
- rtrim
- split
- substring 对应Hive中的 substr
- substring_index
- translate
- trim
- unbase64
- upper
- initcap
- levenshtein
- soundex
聚合函数
- count
- sum
- avg
- min
- max
- variance
- var_samp
- stddev_pop
- stddev_samp
- covar_pop
- covar_samp
- corr
表生成函数
- explode
- posexplode
- json_tuple
窗口函数
- NTILE
- ROW_NUMBER
- RANK
- DENSE_RANK
- CUME_DIST
- PERCENT_RANK
- LAG
- LEAD
参考链接:
spark/sql/core/src/main/scala/org/apache/spark/sql/functions.scala