Malloy Documentation
search

Malloy supports Presto and Trino databases with two dialects which are closely related.

Useful Functions not in the database function library

hll_accumulate
hll_combine
hll_estimate
hll_export
hll_import
string_agg
string_agg_distinct
count_approx

Database Functions

Malloy code written for these dialects can, in addition to the Malloy Standard Functions, reference any of the listed functions here without needing to use Raw SQL Functions.

Refer to the appropriate database documentaion for information on individual functions.

approx_percentile
arbitrary
array_distinct
array_except
array_intersect
array_join
array_max
array_min
array_normalize
array_remove
array_sort
array_split_into_chunks
array_union
arrays_overlap
bitwise_and
bitwise_and_agg
bitwise_or
bitwise_or_agg
bitwise_xor_agg
bool_and
bool_or
cardinality
combinations
contains
corr
date_format
date_parse
element_at
flatten
from_unixtime
json_extract_scalar
max_by
min_by
ngrams
percent_rank
regexp_like
regexp_replace
repeat(STRING)
reverse
sequence
shuffle
slice
split
to_unixtime
trim_array
url_extract_fragment
url_extract_host
url_extract_parameter
url_extract_path
url_extract_port
url_extract_protocol
url_extract_query
variance

Presto Only

The following functions are only available on Presto connections

array_average
array_cum_sum
array_duplicates
array_intersect
array_has_duplicates
array_least_frequent
array_position array_sum
array_sort_desc
array_top_n
remove_nulls
reverse(ARRAY)