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, MAP, and STRUCT functions. It also supports higher-order Lambda functions. If these functions cannot meet your business requirements, you can use Java UDF to compile functions. StarRocks also provides Hive Bitmap UDFs. You can generate Bitmap data in Hive and then load Bitmap into StarRocks. You can also export the Bitmap data generated in StarRocks to Hive for other systems to use.
You can find a built-in function based on the following categories:
- Function list
- Aggregate functions
- Array functions
- Binary 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
- Struct functions
- Table functions
- Utility functions
- Dictionary functions
Aggregate functions
- any_value
- approx_count_distinct
- approx_top_k
- array_agg
- avg
- bitmap
- bitmap_agg
- corr
- covar_pop
- covar_samp
- count
- count_if
- group_concat
- grouping
- grouping_id
- hll_raw_agg
- hll_union
- hll_union_agg
- max
- max_by
- min
- min_by
- 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
- all_match
- any_match
- array_agg
- array_append
- array_avg
- array_concat
- array_contains
- array_contains_all
- array_contains_seq
- array_cum_sum
- array_difference
- array_distinct
- array_filter
- array_generate
- 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
- array_unique_agg
- cardinality
- element_at
- reverse
- unnest
- array_repeat
Binary functions
Bit functions
Bitmap functions
- base64_to_bitmap
- bitmap_agg
- bitmap_and
- bitmap_andnot
- bitmap_contains
- bitmap_count
- bitmap_from_binary
- 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_binary
- bitmap_to_string
- bitmap_union
- bitmap_union_count
- bitmap_union_int
- bitmap_xor
- intersect_count
- subdivide_bitmap
- sub_bitmap
- to_bitmap
- unnest_bitmap
Conditional functions
Cryptographic functions
- aes_encrypt
- aes_decrypt
- base64_decode_binary
- base64_decode_string
- from_base64
- md5
- md5sum
- md5sum_numeric
- sha2
- sm3
- to_base64
Date and time functions
- add_months
- adddate
- convert_tz
- current_date, curdate
- current_time, curtime
- current_timestamp
- date
- date_add, adddate
- date_diff
- date_format
- date_slice
- date_sub, subdate
- date_trunc
- datediff
- day
- dayofweek_iso
- dayname
- dayofmonth
- dayofweek
- dayofyear
- days_add
- days_diff
- days_sub
- from_days
- from_unixtime
- hour
- hours_add
- hours_diff
- hours_sub
- jodatime_format
- last_day
- makedate
- microseconds_add
- microseconds_sub
- milliseconds_diff
- minute
- minutes_add
- minutes_diff
- minutes_sub
- month
- monthname
- months_add
- months_diff
- months_sub
- next_day
- now
- previous_day
- quarter
- second
- seconds_add
- seconds_diff
- seconds_sub
- str2date
- str_to_date
- str_to_jodatime
- time_slice
- time_to_sec
- timediff
- timestamp
- timestampadd
- timestampdiff
- to_date
- to_days
- to_iso8601
- to_tera_date
- to_tera_timestamp
- unix_timestamp
- utc_timestamp
- week
- week_iso
- weekofyear
- weeks_add
- weeks_diff
- weeks_sub
- year
- yearweek
- 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