Function list
StarRocks offers a rich set of functions to facilitate data queries and analysis. In addition to commonly used functions, StarRocks supports semi-structured functions such as ARRAY, JSON, and MAP functions. It also supports higher-order Lambda functions. If these functions cannot meet your business requirements, you can use Java UDF to compile functions.
You can find a function based on the following categories:
- Function list
- Aggregate functions
- Array functions
- Bit functions
- Bitmap functions
- Conditional functions
- Cryptographic functions
- Date and time functions
- Geographic functions
- Hash functions
- JSON functions
- String functions
- Map functions
- Math functions
- Pattern matching functions
- Percentile functions
- Scalar functions
- Table functions
- Utility functions
Aggregate functions
- any_value
- approx_count_distinct
- array_agg
- avg
- bitmap
- bitmap_agg
- corr
- covar_pop
- covar_samp
- count
- group_concat
- grouping
- grouping_id
- group_concat
- hll_empty
- hll_hash
- hll_raw_agg
- hll_union
- hll_union_agg
- max
- max_by
- min
- multi_distinct_sum
- multi_distinct_count
- percentile_approx
- percentile_cont
- percentile_disc
- retention
- stddev,stddev_pop
- stddev_samp
- sum
- variance, variance_pop, var_pop
- var_samp
- window_funnel
Array functions
- array_agg
- array_append
- array_avg
- array_concat
- array_contains
- array_contains_all
- array_cum_sum
- array_difference
- array_distinct
- array_filter
- array_intersect
- array_join
- array_length
- array_map
- array_max
- array_min
- array_position
- array_remove
- array_slice
- array_sort
- array_sortby
- array_sum
- arrays_overlap
- array_to_bitmap
- reverse
- unnest
Bit functions
Bitmap functions
- base64_to_bitmap
- bitmap_agg
- bitmap_and
- bitmap_andnot
- bitmap_contains
- bitmap_count
- bitmap_from_string
- bitmap_empty
- bitmap_has_any
- bitmap_hash
- bitmap_intersect
- bitmap_max
- bitmap_min
- bitmap_or
- bitmap_remove
- bitmap_to_array
- bitmap_to_base64
- bitmap_to_string
- bitmap_union
- bitmap_union_count
- bitmap_union_int
- bitmap_xor
- intersect_count
- sub_bitmap
- to_bitmap
- subdivide_bitmap
- sub_bitmap
- to_bitmap
Conditional functions
Cryptographic functions
Date and time functions
- add_months
- adddate, days_ad
- convert_tz
- current_date,curdate
- current_time,curtime
- current_timestamp
- date
- date_add
- date_format
- date_slice
- date_sub, subdate
- date_trunc
- datediff
- day
- dayname
- dayofmonth
- dayofweek
- dayofyear
- days_add
- days_diff
- days_sub
- from_days
- from_unixtime
- hour
- hours_add
- hours_diff
- hours_sub
- microseconds_add
- microseconds_sub
- minute
- minutes_add
- minutes_diff
- minutes_sub
- month
- monthname
- months_add
- months_diff
- months_sub
- now
- quarter
- second
- seconds_add
- seconds_diff
- seconds_sub
- str_to_date
- str2date
- time_slice
- time_to_sec
- timediff
- days_diff
- timestamp
- timestampadd
- timestampdiff
- to_date
- to_days
- unix_timestamp
- utc_timestamp
- week
- weekofyear
- weeks_add
- weeks_diff
- weeks_sub
- year
- years_add
- years_diff
- years_sub
Geographic functions
- ST_AsText, ST_AsWKT
- st_circle
- st_contains
- st_distance_sphere
- st_geometryfromtext
- st_linefromtext, ST_LineStringFromText
- st_point
- st_polygon
- st_x
- st_y
Hash functions
JSON functions
- json_array
- json_object
- parse_json
- Arrow function
- cast
- get_json_double
- get_json_int
- get_json_strin,get_json_object
- json_each
- json_exists
- json_length
- json_keys
- json_query
- json_string
String functions
- append_trailing_char_if_absent
- ascii
- char
- char_length
- character_length
- concat
- concat_ws
- ends_with
- find_in_set
- group_concat
- hex
- instr
- lcase
- left
- length
- locate
- lower
- lpad
- ltrim
- money_format
- null_or_empty
- parse_url
- repeat
- reverse
- right
- rpad
- rtrim
- space
- split
- split_part
- starts_with
- strleft
- strright
- substr, substring
- trim
- ucase
- unhex
- upper
Map functions
Math functions
- abs
- acos
- asin
- atan
- atan2
- bin
- ceil, dceil
- ceiling
- conv
- cos
- cosine_similarity
- cosine_similarity_norm
- cot
- degrees
- divide
- e
- expexp, dexp
- floor, dfloor
- fmod
- greatest
- least
- ln, dlog1, log
- log
- log2
- log10, dlog10
- mod
- multiply
- negative
- pi
- pmod
- positive
- pow, power, dpow, fpow
- radians
- rand, random
- round, dround
- sign
- sin
- sqrt, dsqrt
- square
- tan
- truncate