blob: 3b8e449d4c1029c47453f502b5394237b2cd9d73 [file] [log] [blame]
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[850],{3905:(e,t,n)=>{n.d(t,{Zo:()=>u,kt:()=>m});var a=n(67294);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function p(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},l=Object.keys(e);for(a=0;a<l.length;a++)n=l[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(a=0;a<l.length;a++)n=l[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var s=a.createContext({}),o=function(e){var t=a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},u=function(e){var t=o(e.components);return a.createElement(s.Provider,{value:t},e.children)},k="mdxType",c={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},d=a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,l=e.originalType,s=e.parentName,u=p(e,["components","mdxType","originalType","parentName"]),k=o(n),d=r,m=k["".concat(s,".").concat(d)]||k[d]||c[d]||l;return n?a.createElement(m,i(i({ref:t},u),{},{components:n})):a.createElement(m,i({ref:t},u))}));function m(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var l=n.length,i=new Array(l);i[0]=d;var p={};for(var s in t)hasOwnProperty.call(t,s)&&(p[s]=t[s]);p.originalType=e,p[k]="string"==typeof e?e:r,i[1]=p;for(var o=2;o<l;o++)i[o]=n[o];return a.createElement.apply(null,i)}return a.createElement.apply(null,n)}d.displayName="MDXCreateElement"},75152:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>u,contentTitle:()=>s,default:()=>m,frontMatter:()=>p,metadata:()=>o,toc:()=>k});var a=n(87462),r=n(63366),l=(n(67294),n(3905)),i=["components"],p={id:"sql-functions",title:"All Druid SQL functions",sidebar_label:"All functions"},s=void 0,o={unversionedId:"querying/sql-functions",id:"querying/sql-functions",title:"All Druid SQL functions",description:"\x3c!--",source:"@site/docs/29.0.1/querying/sql-functions.md",sourceDirName:"querying",slug:"/querying/sql-functions",permalink:"/docs/29.0.1/querying/sql-functions",draft:!1,tags:[],version:"current",frontMatter:{id:"sql-functions",title:"All Druid SQL functions",sidebar_label:"All functions"},sidebar:"docs",previous:{title:"JSON functions",permalink:"/docs/29.0.1/querying/sql-json-functions"},next:{title:"SQL query context",permalink:"/docs/29.0.1/querying/sql-query-context"}},u={},k=[{value:"ABS",id:"abs",level:2},{value:"ACOS",id:"acos",level:2},{value:"ANY_VALUE",id:"any_value",level:2},{value:"APPROX_COUNT_DISTINCT",id:"approx_count_distinct",level:2},{value:"APPROX_COUNT_DISTINCT_DS_HLL",id:"approx_count_distinct_ds_hll",level:2},{value:"APPROX_COUNT_DISTINCT_DS_THETA",id:"approx_count_distinct_ds_theta",level:2},{value:"APPROX_QUANTILE",id:"approx_quantile",level:2},{value:"APPROX_QUANTILE_DS",id:"approx_quantile_ds",level:2},{value:"APPROX_QUANTILE_FIXED_BUCKETS",id:"approx_quantile_fixed_buckets",level:2},{value:"ARRAY[]",id:"array",level:2},{value:"ARRAY_AGG",id:"array_agg",level:2},{value:"ARRAY_APPEND",id:"array_append",level:2},{value:"ARRAY_CONCAT",id:"array_concat",level:2},{value:"ARRAY_CONCAT_AGG",id:"array_concat_agg",level:2},{value:"ARRAY_CONTAINS",id:"array_contains",level:2},{value:"ARRAY_LENGTH",id:"array_length",level:2},{value:"ARRAY_OFFSET",id:"array_offset",level:2},{value:"ARRAY_OFFSET_OF",id:"array_offset_of",level:2},{value:"ARRAY_ORDINAL",id:"array_ordinal",level:2},{value:"ARRAY_ORDINAL_OF",id:"array_ordinal_of",level:2},{value:"ARRAY_OVERLAP",id:"array_overlap",level:2},{value:"ARRAY_PREPEND",id:"array_prepend",level:2},{value:"ARRAY_SLICE",id:"array_slice",level:2},{value:"ARRAY_TO_MV",id:"array_to_mv",level:2},{value:"ARRAY_TO_STRING",id:"array_to_string",level:2},{value:"ASIN",id:"asin",level:2},{value:"ATAN",id:"atan",level:2},{value:"ATAN2",id:"atan2",level:2},{value:"AVG",id:"avg",level:2},{value:"BIT_AND",id:"bit_and",level:2},{value:"BIT_OR",id:"bit_or",level:2},{value:"BIT_XOR",id:"bit_xor",level:2},{value:"BITWISE_AND",id:"bitwise_and",level:2},{value:"BITWISE_COMPLEMENT",id:"bitwise_complement",level:2},{value:"BITWISE_CONVERT_DOUBLE_TO_LONG_BITS",id:"bitwise_convert_double_to_long_bits",level:2},{value:"BITWISE_CONVERT_LONG_BITS_TO_DOUBLE",id:"bitwise_convert_long_bits_to_double",level:2},{value:"BITWISE_OR",id:"bitwise_or",level:2},{value:"BITWISE_SHIFT_LEFT",id:"bitwise_shift_left",level:2},{value:"BITWISE_SHIFT_RIGHT",id:"bitwise_shift_right",level:2},{value:"BITWISE_XOR",id:"bitwise_xor",level:2},{value:"BLOOM_FILTER",id:"bloom_filter",level:2},{value:"BLOOM_FILTER_TEST",id:"bloom_filter_test",level:2},{value:"BTRIM",id:"btrim",level:2},{value:"CASE",id:"case",level:2},{value:"CAST",id:"cast",level:2},{value:"CEIL (date and time)",id:"ceil-date-and-time",level:2},{value:"CEIL (numeric)",id:"ceil-numeric",level:2},{value:"CHAR_LENGTH",id:"char_length",level:2},{value:"CHARACTER_LENGTH",id:"character_length",level:2},{value:"COALESCE",id:"coalesce",level:2},{value:"CONCAT",id:"concat",level:2},{value:"CONTAINS_STRING",id:"contains_string",level:2},{value:"COS",id:"cos",level:2},{value:"COT",id:"cot",level:2},{value:"COUNT",id:"count",level:2},{value:"CURRENT_DATE",id:"current_date",level:2},{value:"CURRENT_TIMESTAMP",id:"current_timestamp",level:2},{value:"DATE_TRUNC",id:"date_trunc",level:2},{value:"DECODE_BASE64_COMPLEX",id:"decode_base64_complex",level:2},{value:"DECODE_BASE64_UTF8",id:"decode_base64_utf8",level:2},{value:"DEGREES",id:"degrees",level:2},{value:"DIV",id:"div",level:2},{value:"DS_CDF",id:"ds_cdf",level:2},{value:"DS_GET_QUANTILE",id:"ds_get_quantile",level:2},{value:"DS_GET_QUANTILES",id:"ds_get_quantiles",level:2},{value:"DS_HISTOGRAM",id:"ds_histogram",level:2},{value:"DS_HLL",id:"ds_hll",level:2},{value:"DS_QUANTILE_SUMMARY",id:"ds_quantile_summary",level:2},{value:"DS_QUANTILES_SKETCH",id:"ds_quantiles_sketch",level:2},{value:"DS_RANK",id:"ds_rank",level:2},{value:"DS_THETA",id:"ds_theta",level:2},{value:"DS_TUPLE_DOUBLES",id:"ds_tuple_doubles",level:2},{value:"DS_TUPLE_DOUBLES_INTERSECT",id:"ds_tuple_doubles_intersect",level:2},{value:"DS_TUPLE_DOUBLES_METRICS_SUM_ESTIMATE",id:"ds_tuple_doubles_metrics_sum_estimate",level:2},{value:"DS_TUPLE_DOUBLES_NOT",id:"ds_tuple_doubles_not",level:2},{value:"DS_TUPLE_DOUBLES_UNION",id:"ds_tuple_doubles_union",level:2},{value:"EARLIEST",id:"earliest",level:2},{value:"EARLIEST_BY",id:"earliest_by",level:2},{value:"EXP",id:"exp",level:2},{value:"EXTRACT",id:"extract",level:2},{value:"FLOOR (date and time)",id:"floor-date-and-time",level:2},{value:"FLOOR (numeric)",id:"floor-numeric",level:2},{value:"GREATEST",id:"greatest",level:2},{value:"GROUPING",id:"grouping",level:2},{value:"HLL_SKETCH_ESTIMATE",id:"hll_sketch_estimate",level:2},{value:"HLL_SKETCH_ESTIMATE_WITH_ERROR_BOUNDS",id:"hll_sketch_estimate_with_error_bounds",level:2},{value:"HLL_SKETCH_TO_STRING",id:"hll_sketch_to_string",level:2},{value:"HLL_SKETCH_UNION",id:"hll_sketch_union",level:2},{value:"HUMAN_READABLE_BINARY_BYTE_FORMAT",id:"human_readable_binary_byte_format",level:2},{value:"HUMAN_READABLE_DECIMAL_BYTE_FORMAT",id:"human_readable_decimal_byte_format",level:2},{value:"HUMAN_READABLE_DECIMAL_FORMAT",id:"human_readable_decimal_format",level:2},{value:"ICONTAINS_STRING",id:"icontains_string",level:2},{value:"IPV4_MATCH",id:"ipv4_match",level:2},{value:"IPV4_PARSE",id:"ipv4_parse",level:2},{value:"IPV4_STRINGIFY",id:"ipv4_stringify",level:2},{value:"IPV6_MATCH",id:"ipv6_match",level:2},{value:"JSON_KEYS",id:"json_keys",level:2},{value:"JSON_OBJECT",id:"json_object",level:2},{value:"JSON_PATHS",id:"json_paths",level:2},{value:"JSON_QUERY",id:"json_query",level:2},{value:"JSON_QUERY_ARRAY",id:"json_query_array",level:2},{value:"JSON_VALUE",id:"json_value",level:2},{value:"LATEST",id:"latest",level:2},{value:"LATEST_BY",id:"latest_by",level:2},{value:"LEAST",id:"least",level:2},{value:"LEFT",id:"left",level:2},{value:"LENGTH",id:"length",level:2},{value:"LN",id:"ln",level:2},{value:"LOG10",id:"log10",level:2},{value:"LOOKUP",id:"lookup",level:2},{value:"LOWER",id:"lower",level:2},{value:"LPAD",id:"lpad",level:2},{value:"LTRIM",id:"ltrim",level:2},{value:"MAX",id:"max",level:2},{value:"MILLIS_TO_TIMESTAMP",id:"millis_to_timestamp",level:2},{value:"MIN",id:"min",level:2},{value:"MOD",id:"mod",level:2},{value:"MV_APPEND",id:"mv_append",level:2},{value:"MV_CONCAT",id:"mv_concat",level:2},{value:"MV_CONTAINS",id:"mv_contains",level:2},{value:"MV_FILTER_NONE",id:"mv_filter_none",level:2},{value:"MV_FILTER_ONLY",id:"mv_filter_only",level:2},{value:"MV_LENGTH",id:"mv_length",level:2},{value:"MV_OFFSET",id:"mv_offset",level:2},{value:"MV_OFFSET_OF",id:"mv_offset_of",level:2},{value:"MV_ORDINAL",id:"mv_ordinal",level:2},{value:"MV_ORDINAL_OF",id:"mv_ordinal_of",level:2},{value:"MV_OVERLAP",id:"mv_overlap",level:2},{value:"MV_PREPEND",id:"mv_prepend",level:2},{value:"MV_SLICE",id:"mv_slice",level:2},{value:"MV_TO_STRING",id:"mv_to_string",level:2},{value:"NULLIF",id:"nullif",level:2},{value:"NVL",id:"nvl",level:2},{value:"PARSE_JSON",id:"parse_json",level:2},{value:"PARSE_LONG",id:"parse_long",level:2},{value:"POSITION",id:"position",level:2},{value:"POWER",id:"power",level:2},{value:"RADIANS",id:"radians",level:2},{value:"REGEXP_EXTRACT",id:"regexp_extract",level:2},{value:"REGEXP_LIKE",id:"regexp_like",level:2},{value:"REGEXP_REPLACE",id:"regexp_replace",level:2},{value:"REPEAT",id:"repeat",level:2},{value:"REPLACE",id:"replace",level:2},{value:"REVERSE",id:"reverse",level:2},{value:"RIGHT",id:"right",level:2},{value:"ROUND",id:"round",level:2},{value:"RPAD",id:"rpad",level:2},{value:"RTRIM",id:"rtrim",level:2},{value:"SAFE_DIVIDE",id:"safe_divide",level:2},{value:"SIN",id:"sin",level:2},{value:"SQRT",id:"sqrt",level:2},{value:"STDDEV",id:"stddev",level:2},{value:"STDDEV_POP",id:"stddev_pop",level:2},{value:"STDDEV_SAMP",id:"stddev_samp",level:2},{value:"STRING_AGG",id:"string_agg",level:2},{value:"STRING_TO_ARRAY",id:"string_to_array",level:2},{value:"STRING_FORMAT",id:"string_format",level:2},{value:"STRING_TO_MV",id:"string_to_mv",level:2},{value:"STRLEN",id:"strlen",level:2},{value:"STRPOS",id:"strpos",level:2},{value:"SUBSTR",id:"substr",level:2},{value:"SUBSTRING",id:"substring",level:2},{value:"SUM",id:"sum",level:2},{value:"TAN",id:"tan",level:2},{value:"TDIGEST_GENERATE_SKETCH",id:"tdigest_generate_sketch",level:2},{value:"TDIGEST_QUANTILE",id:"tdigest_quantile",level:2},{value:"TEXTCAT",id:"textcat",level:2},{value:"THETA_SKETCH_ESTIMATE",id:"theta_sketch_estimate",level:2},{value:"THETA_SKETCH_ESTIMATE_WITH_ERROR_BOUNDS",id:"theta_sketch_estimate_with_error_bounds",level:2},{value:"THETA_SKETCH_INTERSECT",id:"theta_sketch_intersect",level:2},{value:"THETA_SKETCH_NOT",id:"theta_sketch_not",level:2},{value:"THETA_SKETCH_UNION",id:"theta_sketch_union",level:2},{value:"TIME_CEIL",id:"time_ceil",level:2},{value:"TIME_EXTRACT",id:"time_extract",level:2},{value:"TIME_FLOOR",id:"time_floor",level:2},{value:"TIME_FORMAT",id:"time_format",level:2},{value:"TIME_IN_INTERVAL",id:"time_in_interval",level:2},{value:"TIME_PARSE",id:"time_parse",level:2},{value:"TIME_SHIFT",id:"time_shift",level:2},{value:"TIMESTAMP_TO_MILLIS",id:"timestamp_to_millis",level:2},{value:"TIMESTAMPADD",id:"timestampadd",level:2},{value:"TIMESTAMPDIFF",id:"timestampdiff",level:2},{value:"TO_JSON_STRING",id:"to_json_string",level:2},{value:"TRIM",id:"trim",level:2},{value:"TRUNC",id:"trunc",level:2},{value:"TRUNCATE",id:"truncate",level:2},{value:"TRY_PARSE_JSON",id:"try_parse_json",level:2},{value:"UNNEST",id:"unnest",level:2},{value:"UPPER",id:"upper",level:2},{value:"VAR_POP",id:"var_pop",level:2},{value:"VAR_SAMP",id:"var_samp",level:2},{value:"VARIANCE",id:"variance",level:2}],c={toc:k},d="wrapper";function m(e){var t=e.components,n=(0,r.Z)(e,i);return(0,l.kt)(d,(0,a.Z)({},c,n,{components:t,mdxType:"MDXLayout"}),(0,l.kt)("admonition",{type:"info"},(0,l.kt)("p",{parentName:"admonition"}," Apache Druid supports two query languages: Druid SQL and ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/"},"native queries"),".\nThis document describes the SQL language.")),(0,l.kt)("p",null,"This page provides a reference of all Druid SQL functions in alphabetical order.\nClick the linked function type for documentation on a particular function."),(0,l.kt)("h2",{id:"abs"},"ABS"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"ABS(<NUMERIC>)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#numeric-functions"},"Scalar, numeric")),(0,l.kt)("p",null,"Calculates the absolute value of a numeric expression."),(0,l.kt)("h2",{id:"acos"},"ACOS"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"ACOS(<NUMERIC>)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#numeric-functions"},"Scalar, numeric")),(0,l.kt)("p",null,"Calculates the arc cosine of a numeric expression."),(0,l.kt)("h2",{id:"any_value"},"ANY_VALUE"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"ANY_VALUE(expr, [maxBytesPerValue, [aggregateMultipleValues]])")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-aggregations"},"Aggregation")),(0,l.kt)("p",null,"Returns any value of the specified expression."),(0,l.kt)("h2",{id:"approx_count_distinct"},"APPROX_COUNT_DISTINCT"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"APPROX_COUNT_DISTINCT(expr)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-aggregations"},"Aggregation")),(0,l.kt)("p",null,"Counts distinct values of a regular column or a prebuilt sketch column."),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"APPROX_COUNT_DISTINCT_BUILTIN(expr)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-aggregations"},"Aggregation")),(0,l.kt)("p",null,"Counts distinct values of a string, numeric, or ",(0,l.kt)("inlineCode",{parentName:"p"},"hyperUnique")," column using Druid's built-in ",(0,l.kt)("inlineCode",{parentName:"p"},"cardinality")," or ",(0,l.kt)("inlineCode",{parentName:"p"},"hyperUnique")," aggregators."),(0,l.kt)("h2",{id:"approx_count_distinct_ds_hll"},"APPROX_COUNT_DISTINCT_DS_HLL"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"APPROX_COUNT_DISTINCT_DS_HLL(expr, [<NUMERIC>, <CHARACTER>])")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-aggregations"},"Aggregation")),(0,l.kt)("p",null,"Counts distinct values of an HLL sketch column or a regular column."),(0,l.kt)("h2",{id:"approx_count_distinct_ds_theta"},"APPROX_COUNT_DISTINCT_DS_THETA"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"APPROX_COUNT_DISTINCT_DS_THETA(expr, [<NUMERIC>])")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-aggregations"},"Aggregation")),(0,l.kt)("p",null,"Counts distinct values of a Theta sketch column or a regular column."),(0,l.kt)("h2",{id:"approx_quantile"},"APPROX_QUANTILE"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"APPROX_QUANTILE(expr, <NUMERIC>, [<NUMERIC>])")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-aggregations"},"Aggregation")),(0,l.kt)("p",null,"Deprecated in favor of ",(0,l.kt)("inlineCode",{parentName:"p"},"APPROX_QUANTILE_DS"),"."),(0,l.kt)("h2",{id:"approx_quantile_ds"},"APPROX_QUANTILE_DS"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"APPROX_QUANTILE_DS(expr, <NUMERIC>, [<NUMERIC>])")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-aggregations"},"Aggregation")),(0,l.kt)("p",null,"Computes approximate quantiles on a Quantiles sketch column or a regular numeric column."),(0,l.kt)("h2",{id:"approx_quantile_fixed_buckets"},"APPROX_QUANTILE_FIXED_BUCKETS"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"APPROX_QUANTILE_FIXED_BUCKETS(expr, <NUMERIC>, <NUMERIC>, <NUMERIC>, <NUMERIC>, [<CHARACTER>])")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-aggregations"},"Aggregation")),(0,l.kt)("p",null,"Computes approximate quantiles on fixed buckets histogram column or a regular numeric column."),(0,l.kt)("h2",{id:"array"},"ARRAY[]"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"ARRAY[expr1, expr2, ...]")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-array-functions"},"Array")),(0,l.kt)("p",null,"Constructs a SQL ARRAY literal from the expression arguments. The arguments must be of the same type."),(0,l.kt)("h2",{id:"array_agg"},"ARRAY_AGG"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"ARRAY_AGG([DISTINCT] expr, [<NUMERIC>])")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-aggregations"},"Aggregation")),(0,l.kt)("p",null,"Returns an array of all values of the specified expression."),(0,l.kt)("h2",{id:"array_append"},"ARRAY_APPEND"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"ARRAY_APPEND(arr1, expr)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-array-functions"},"Array")),(0,l.kt)("p",null,"Appends ",(0,l.kt)("inlineCode",{parentName:"p"},"expr")," to ",(0,l.kt)("inlineCode",{parentName:"p"},"arr"),", the resulting array type determined by the type of ",(0,l.kt)("inlineCode",{parentName:"p"},"arr1"),"."),(0,l.kt)("h2",{id:"array_concat"},"ARRAY_CONCAT"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"ARRAY_CONCAT(arr1, arr2)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-array-functions"},"Array")),(0,l.kt)("p",null,"Concatenates ",(0,l.kt)("inlineCode",{parentName:"p"},"arr2")," to ",(0,l.kt)("inlineCode",{parentName:"p"},"arr1"),". The resulting array type is determined by the type of ",(0,l.kt)("inlineCode",{parentName:"p"},"arr1"),".|"),(0,l.kt)("h2",{id:"array_concat_agg"},"ARRAY_CONCAT_AGG"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"ARRAY_CONCAT_AGG([DISTINCT] expr, [<NUMERIC>])")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-aggregations"},"Aggregation")),(0,l.kt)("p",null,"Concatenates array inputs into a single array."),(0,l.kt)("h2",{id:"array_contains"},"ARRAY_CONTAINS"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"ARRAY_CONTAINS(arr, expr)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-array-functions"},"Array")),(0,l.kt)("p",null,"If ",(0,l.kt)("inlineCode",{parentName:"p"},"expr")," is a scalar type, returns 1 if ",(0,l.kt)("inlineCode",{parentName:"p"},"arr")," contains ",(0,l.kt)("inlineCode",{parentName:"p"},"expr"),". If ",(0,l.kt)("inlineCode",{parentName:"p"},"expr")," is an array, returns 1 if ",(0,l.kt)("inlineCode",{parentName:"p"},"arr")," contains all elements of ",(0,l.kt)("inlineCode",{parentName:"p"},"expr"),". Otherwise returns 0."),(0,l.kt)("h2",{id:"array_length"},"ARRAY_LENGTH"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"ARRAY_LENGTH(arr)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-array-functions"},"Array")),(0,l.kt)("p",null,"Returns length of the array expression."),(0,l.kt)("h2",{id:"array_offset"},"ARRAY_OFFSET"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"ARRAY_OFFSET(arr, long)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-array-functions"},"Array")),(0,l.kt)("p",null,"Returns the array element at the 0-based index supplied, or null for an out of range index."),(0,l.kt)("h2",{id:"array_offset_of"},"ARRAY_OFFSET_OF"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"ARRAY_OFFSET_OF(arr, expr)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-array-functions"},"Array")),(0,l.kt)("p",null,"Returns the 0-based index of the first occurrence of ",(0,l.kt)("inlineCode",{parentName:"p"},"expr")," in the array. If no matching elements exist in the array, returns ",(0,l.kt)("inlineCode",{parentName:"p"},"null")," or ",(0,l.kt)("inlineCode",{parentName:"p"},"-1")," if ",(0,l.kt)("inlineCode",{parentName:"p"},"druid.generic.useDefaultValueForNull=true")," (deprecated legacy mode)."),(0,l.kt)("h2",{id:"array_ordinal"},"ARRAY_ORDINAL"),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-array-functions"},"Array")),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"ARRAY_ORDINAL(arr, long)")),(0,l.kt)("p",null,"Returns the array element at the 1-based index supplied, or null for an out of range index."),(0,l.kt)("h2",{id:"array_ordinal_of"},"ARRAY_ORDINAL_OF"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"ARRAY_ORDINAL_OF(arr, expr)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-array-functions"},"Array")),(0,l.kt)("p",null,"Returns the 1-based index of the first occurrence of ",(0,l.kt)("inlineCode",{parentName:"p"},"expr")," in the array. If no matching elements exist in the array, returns ",(0,l.kt)("inlineCode",{parentName:"p"},"null")," or ",(0,l.kt)("inlineCode",{parentName:"p"},"-1")," if ",(0,l.kt)("inlineCode",{parentName:"p"},"druid.generic.useDefaultValueForNull=true")," (deprecated legacy mode)."),(0,l.kt)("h2",{id:"array_overlap"},"ARRAY_OVERLAP"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"ARRAY_OVERLAP(arr1, arr2)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-array-functions"},"Array")),(0,l.kt)("p",null,"Returns 1 if ",(0,l.kt)("inlineCode",{parentName:"p"},"arr1")," and ",(0,l.kt)("inlineCode",{parentName:"p"},"arr2")," have any elements in common, else 0.|"),(0,l.kt)("h2",{id:"array_prepend"},"ARRAY_PREPEND"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"ARRAY_PREPEND(expr, arr)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-array-functions"},"Array")),(0,l.kt)("p",null,"Prepends ",(0,l.kt)("inlineCode",{parentName:"p"},"expr")," to ",(0,l.kt)("inlineCode",{parentName:"p"},"arr")," at the beginning, the resulting array type determined by the type of ",(0,l.kt)("inlineCode",{parentName:"p"},"arr"),"."),(0,l.kt)("h2",{id:"array_slice"},"ARRAY_SLICE"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"ARRAY_SLICE(arr, start, end)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-array-functions"},"Array")),(0,l.kt)("p",null,"Returns the subarray of ",(0,l.kt)("inlineCode",{parentName:"p"},"arr")," from the 0-based index ",(0,l.kt)("inlineCode",{parentName:"p"},"start")," (inclusive) to ",(0,l.kt)("inlineCode",{parentName:"p"},"end")," (exclusive). Returns ",(0,l.kt)("inlineCode",{parentName:"p"},"null"),", if ",(0,l.kt)("inlineCode",{parentName:"p"},"start")," is less than 0, greater than length of ",(0,l.kt)("inlineCode",{parentName:"p"},"arr"),", or greater than ",(0,l.kt)("inlineCode",{parentName:"p"},"end"),"."),(0,l.kt)("h2",{id:"array_to_mv"},"ARRAY_TO_MV"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"ARRAY_TO_MV(arr)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-array-functions"},"Array")),(0,l.kt)("p",null,"Converts an ",(0,l.kt)("inlineCode",{parentName:"p"},"ARRAY")," of any type into a multi-value string ",(0,l.kt)("inlineCode",{parentName:"p"},"VARCHAR"),"."),(0,l.kt)("h2",{id:"array_to_string"},"ARRAY_TO_STRING"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"ARRAY_TO_STRING(arr, str)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-array-functions"},"Array")),(0,l.kt)("p",null,"Joins all elements of ",(0,l.kt)("inlineCode",{parentName:"p"},"arr")," by the delimiter specified by ",(0,l.kt)("inlineCode",{parentName:"p"},"str"),"."),(0,l.kt)("h2",{id:"asin"},"ASIN"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"ASIN(<NUMERIC>)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#numeric-functions"},"Scalar, numeric")),(0,l.kt)("p",null,"Calculates the arc sine of a numeric expression."),(0,l.kt)("h2",{id:"atan"},"ATAN"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"ATAN(<NUMERIC>)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#numeric-functions"},"Scalar, numeric")),(0,l.kt)("p",null,"Calculates the arc tangent of a numeric expression."),(0,l.kt)("h2",{id:"atan2"},"ATAN2"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"ATAN2(<NUMERIC>, <NUMERIC>)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#numeric-functions"},"Scalar, numeric")),(0,l.kt)("p",null,"Calculates the arc tangent of the two arguments."),(0,l.kt)("h2",{id:"avg"},"AVG"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"AVG(<NUMERIC>)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-aggregations"},"Aggregation")),(0,l.kt)("p",null,"Calculates the average of a set of values."),(0,l.kt)("h2",{id:"bit_and"},"BIT_AND"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"BIT_AND(expr)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-aggregations"},"Aggregation")),(0,l.kt)("p",null,"Performs a bitwise AND operation on all input values."),(0,l.kt)("h2",{id:"bit_or"},"BIT_OR"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"BIT_OR(expr)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-aggregations"},"Aggregation")),(0,l.kt)("p",null,"Performs a bitwise OR operation on all input values."),(0,l.kt)("h2",{id:"bit_xor"},"BIT_XOR"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"BIT_XOR(expr)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-aggregations"},"Aggregation")),(0,l.kt)("p",null,"Performs a bitwise XOR operation on all input values."),(0,l.kt)("h2",{id:"bitwise_and"},"BITWISE_AND"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"BITWISE_AND(expr1, expr2)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#numeric-functions"},"Scalar, numeric")),(0,l.kt)("p",null,"Returns the bitwise AND between the two expressions, that is, ",(0,l.kt)("inlineCode",{parentName:"p"},"expr1 & expr2"),"."),(0,l.kt)("h2",{id:"bitwise_complement"},"BITWISE_COMPLEMENT"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"BITWISE_COMPLEMENT(expr)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#numeric-functions"},"Scalar, numeric")),(0,l.kt)("p",null,"Returns the bitwise NOT for the expression, that is, ",(0,l.kt)("inlineCode",{parentName:"p"},"~expr"),"."),(0,l.kt)("h2",{id:"bitwise_convert_double_to_long_bits"},"BITWISE_CONVERT_DOUBLE_TO_LONG_BITS"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"BITWISE_CONVERT_DOUBLE_TO_LONG_BITS(expr)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#numeric-functions"},"Scalar, numeric")),(0,l.kt)("p",null,"Converts the bits of an IEEE 754 floating-point double value to a long."),(0,l.kt)("h2",{id:"bitwise_convert_long_bits_to_double"},"BITWISE_CONVERT_LONG_BITS_TO_DOUBLE"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"BITWISE_CONVERT_LONG_BITS_TO_DOUBLE(expr)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#numeric-functions"},"Scalar, numeric")),(0,l.kt)("p",null,"Converts a long to the IEEE 754 floating-point double specified by the bits stored in the long."),(0,l.kt)("h2",{id:"bitwise_or"},"BITWISE_OR"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"BITWISE_OR(expr1, expr2)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#numeric-functions"},"Scalar, numeric")),(0,l.kt)("p",null,"Returns the bitwise OR between the two expressions, that is, ",(0,l.kt)("inlineCode",{parentName:"p"},"expr1 | expr2"),"."),(0,l.kt)("h2",{id:"bitwise_shift_left"},"BITWISE_SHIFT_LEFT"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"BITWISE_SHIFT_LEFT(expr1, expr2)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#numeric-functions"},"Scalar, numeric")),(0,l.kt)("p",null,"Returns a bitwise left shift of expr1, that is, ",(0,l.kt)("inlineCode",{parentName:"p"},"expr1 << expr2"),"."),(0,l.kt)("h2",{id:"bitwise_shift_right"},"BITWISE_SHIFT_RIGHT"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"BITWISE_SHIFT_RIGHT(expr1, expr2)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#numeric-functions"},"Scalar, numeric")),(0,l.kt)("p",null,"Returns a bitwise right shift of expr1, that is, ",(0,l.kt)("inlineCode",{parentName:"p"},"expr1 >> expr2"),"."),(0,l.kt)("h2",{id:"bitwise_xor"},"BITWISE_XOR"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"BITWISE_XOR(expr1, expr2)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#numeric-functions"},"Scalar, numeric")),(0,l.kt)("p",null,"Returns the bitwise exclusive OR between the two expressions, that is, ",(0,l.kt)("inlineCode",{parentName:"p"},"expr1 ^ expr2"),"."),(0,l.kt)("h2",{id:"bloom_filter"},"BLOOM_FILTER"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"BLOOM_FILTER(expr, <NUMERIC>)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-aggregations"},"Aggregation")),(0,l.kt)("p",null,"Computes a Bloom filter from values produced by the specified expression."),(0,l.kt)("h2",{id:"bloom_filter_test"},"BLOOM_FILTER_TEST"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"BLOOM_FILTER_TEST(expr, <STRING>)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#other-scalar-functions"},"Scalar, other")),(0,l.kt)("p",null,"Returns true if the expression is contained in a Base64-serialized Bloom filter."),(0,l.kt)("h2",{id:"btrim"},"BTRIM"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"BTRIM(<CHARACTER>, [<CHARACTER>])")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#string-functions"},"Scalar, string")),(0,l.kt)("p",null,"Trims characters from both the leading and trailing ends of an expression."),(0,l.kt)("h2",{id:"case"},"CASE"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"CASE expr WHEN value1 THEN result1 \\[ WHEN value2 THEN result2 ... \\] \\[ ELSE resultN \\] END")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#other-scalar-functions"},"Scalar, other")),(0,l.kt)("p",null,"Returns a result based on a given condition."),(0,l.kt)("h2",{id:"cast"},"CAST"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"CAST(value AS TYPE)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#other-scalar-functions"},"Scalar, other")),(0,l.kt)("p",null,"Converts a value into the specified data type."),(0,l.kt)("h2",{id:"ceil-date-and-time"},"CEIL (date and time)"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"CEIL(<TIMESTAMP> TO <TIME_UNIT>)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#date-and-time-functions"},"Scalar, date and time")),(0,l.kt)("p",null,"Rounds up a timestamp by a given time unit."),(0,l.kt)("h2",{id:"ceil-numeric"},"CEIL (numeric)"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"CEIL(<NUMERIC>)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#numeric-functions"},"Scalar, numeric")),(0,l.kt)("p",null,"Calculates the smallest integer value greater than or equal to the numeric expression."),(0,l.kt)("h2",{id:"char_length"},"CHAR_LENGTH"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"CHAR_LENGTH(expr)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#string-functions"},"Scalar, string")),(0,l.kt)("p",null,"Alias for ",(0,l.kt)("a",{parentName:"p",href:"#length"},(0,l.kt)("inlineCode",{parentName:"a"},"LENGTH")),"."),(0,l.kt)("h2",{id:"character_length"},"CHARACTER_LENGTH"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"CHARACTER_LENGTH(expr)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#string-functions"},"Scalar, string")),(0,l.kt)("p",null,"Alias for ",(0,l.kt)("a",{parentName:"p",href:"#length"},(0,l.kt)("inlineCode",{parentName:"a"},"LENGTH")),"."),(0,l.kt)("h2",{id:"coalesce"},"COALESCE"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"COALESCE(expr, expr, ...)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#other-scalar-functions"},"Scalar, other")),(0,l.kt)("p",null,"Returns the first non-null value."),(0,l.kt)("h2",{id:"concat"},"CONCAT"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"CONCAT(expr, expr...)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#string-functions"},"Scalar, string")),(0,l.kt)("p",null,"Concatenates a list of expressions."),(0,l.kt)("h2",{id:"contains_string"},"CONTAINS_STRING"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"CONTAINS_STRING(<CHARACTER>, <CHARACTER>)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#string-functions"},"Scalar, string")),(0,l.kt)("p",null,"Finds whether a string is in a given expression, case-sensitive."),(0,l.kt)("h2",{id:"cos"},"COS"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"COS(<NUMERIC>)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#numeric-functions"},"Scalar, numeric")),(0,l.kt)("p",null,"Calculates the trigonometric cosine of an angle expressed in radians."),(0,l.kt)("h2",{id:"cot"},"COT"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"COT(<NUMERIC>)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#numeric-functions"},"Scalar, numeric")),(0,l.kt)("p",null,"Calculates the trigonometric cotangent of an angle expressed in radians."),(0,l.kt)("h2",{id:"count"},"COUNT"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"COUNT([DISTINCT] expr)")),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"COUNT(*)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-aggregations"},"Aggregation")),(0,l.kt)("p",null,"Counts the number of rows."),(0,l.kt)("h2",{id:"current_date"},"CURRENT_DATE"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"CURRENT_DATE")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#date-and-time-functions"},"Scalar, date and time")),(0,l.kt)("p",null,"Returns the current date in the connection's time zone."),(0,l.kt)("h2",{id:"current_timestamp"},"CURRENT_TIMESTAMP"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"CURRENT_TIMESTAMP")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#date-and-time-functions"},"Scalar, date and time")),(0,l.kt)("p",null,"Returns the current timestamp in the connection's time zone."),(0,l.kt)("h2",{id:"date_trunc"},"DATE_TRUNC"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"DATE_TRUNC(<CHARACTER>, <TIMESTAMP>)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#date-and-time-functions"},"Scalar, date and time")),(0,l.kt)("p",null,"Rounds down a timestamp by a given time unit."),(0,l.kt)("h2",{id:"decode_base64_complex"},"DECODE_BASE64_COMPLEX"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"DECODE_BASE64_COMPLEX(dataType, expr)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#other-scalar-functions"},"Scalar, other")),(0,l.kt)("p",null,"Decodes a Base64-encoded string into a complex data type, where ",(0,l.kt)("inlineCode",{parentName:"p"},"dataType")," is the complex data type and ",(0,l.kt)("inlineCode",{parentName:"p"},"expr")," is the Base64-encoded string to decode."),(0,l.kt)("h2",{id:"decode_base64_utf8"},"DECODE_BASE64_UTF8"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"DECODE_BASE64_UTF8(expr)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#string-functions"},"Scalar, string")),(0,l.kt)("p",null,"Decodes a Base64-encoded string into a UTF-8 encoded string."),(0,l.kt)("h2",{id:"degrees"},"DEGREES"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"DEGREES(<NUMERIC>)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#numeric-functions"},"Scalar, numeric")),(0,l.kt)("p",null,"Converts an angle from radians to degrees."),(0,l.kt)("h2",{id:"div"},"DIV"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"DIV(x, y)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#numeric-functions"},"Scalar, numeric")),(0,l.kt)("p",null,"Returns the result of integer division of ",(0,l.kt)("inlineCode",{parentName:"p"},"x")," by ",(0,l.kt)("inlineCode",{parentName:"p"},"y"),"."),(0,l.kt)("h2",{id:"ds_cdf"},"DS_CDF"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"DS_CDF(expr, splitPoint0, splitPoint1, ...)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#sketch-functions"},"Scalar, sketch")),(0,l.kt)("p",null,"Returns a string representing an approximation to the Cumulative Distribution Function given the specified bin definition."),(0,l.kt)("h2",{id:"ds_get_quantile"},"DS_GET_QUANTILE"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"DS_GET_QUANTILE(expr, fraction)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#sketch-functions"},"Scalar, sketch")),(0,l.kt)("p",null,"Returns the quantile estimate corresponding to ",(0,l.kt)("inlineCode",{parentName:"p"},"fraction")," from a quantiles sketch."),(0,l.kt)("h2",{id:"ds_get_quantiles"},"DS_GET_QUANTILES"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"DS_GET_QUANTILES(expr, fraction0, fraction1, ...)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#sketch-functions"},"Scalar, sketch")),(0,l.kt)("p",null,"Returns a string representing an array of quantile estimates corresponding to a list of fractions from a quantiles sketch."),(0,l.kt)("h2",{id:"ds_histogram"},"DS_HISTOGRAM"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"DS_HISTOGRAM(expr, splitPoint0, splitPoint1, ...)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#sketch-functions"},"Scalar, sketch")),(0,l.kt)("p",null,"Returns a string representing an approximation to the histogram given the specified bin definition."),(0,l.kt)("h2",{id:"ds_hll"},"DS_HLL"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"DS_HLL(expr, [lgK, tgtHllType])")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-aggregations"},"Aggregation")),(0,l.kt)("p",null,"Creates an HLL sketch on a column containing HLL sketches or a regular column."),(0,l.kt)("h2",{id:"ds_quantile_summary"},"DS_QUANTILE_SUMMARY"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"DS_QUANTILE_SUMMARY(expr)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#sketch-functions"},"Scalar, sketch")),(0,l.kt)("p",null,"Returns a string summary of a quantiles sketch."),(0,l.kt)("h2",{id:"ds_quantiles_sketch"},"DS_QUANTILES_SKETCH"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"DS_QUANTILES_SKETCH(expr, [k])")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-aggregations"},"Aggregation")),(0,l.kt)("p",null,"Creates a Quantiles sketch on a column containing Quantiles sketches or a regular column."),(0,l.kt)("h2",{id:"ds_rank"},"DS_RANK"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"DS_RANK(expr, value)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#sketch-functions"},"Scalar, sketch")),(0,l.kt)("p",null,"Returns an approximate rank between 0 and 1 of a given value, in which the rank signifies the fraction of the distribution less than the given value."),(0,l.kt)("h2",{id:"ds_theta"},"DS_THETA"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"DS_THETA(expr, [size])")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-aggregations"},"Aggregation")),(0,l.kt)("p",null,"Creates a Theta sketch on a column containing Theta sketches or a regular column."),(0,l.kt)("h2",{id:"ds_tuple_doubles"},"DS_TUPLE_DOUBLES"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"DS_TUPLE_DOUBLES(expr, [nominalEntries])")),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"DS_TUPLE_DOUBLES(dimensionColumnExpr, metricColumnExpr, ..., [nominalEntries])")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-aggregations"},"Aggregation")),(0,l.kt)("p",null,"Creates a Tuple sketch which contains an array of double values as the Summary Object. If the last value of the array is a numeric literal, Druid assumes that the value is an override parameter for ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/development/extensions-core/datasketches-tuple"},"nominal entries"),"."),(0,l.kt)("h2",{id:"ds_tuple_doubles_intersect"},"DS_TUPLE_DOUBLES_INTERSECT"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"DS_TUPLE_DOUBLES_INTERSECT(expr, ..., [nominalEntries])")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#tuple-sketch-functions"},"Scalar, sketch")),(0,l.kt)("p",null,"Returns an intersection of Tuple sketches which each contain an array of double values as their Summary Objects. The values contained in the Summary Objects are summed when combined. If the last value of the array is a numeric literal, Druid assumes that the value is an override parameter for ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/development/extensions-core/datasketches-tuple"},"nominal entries"),"."),(0,l.kt)("h2",{id:"ds_tuple_doubles_metrics_sum_estimate"},"DS_TUPLE_DOUBLES_METRICS_SUM_ESTIMATE"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"DS_TUPLE_DOUBLES_METRICS_SUM_ESTIMATE(expr)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#tuple-sketch-functions"},"Scalar, sketch")),(0,l.kt)("p",null,"Computes approximate sums of the values contained within a Tuple sketch which contains an array of double values as the Summary Object."),(0,l.kt)("h2",{id:"ds_tuple_doubles_not"},"DS_TUPLE_DOUBLES_NOT"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"DS_TUPLE_DOUBLES_NOT(expr, ..., [nominalEntries])")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#tuple-sketch-functions"},"Scalar, sketch")),(0,l.kt)("p",null,"Returns a set difference of Tuple sketches which each contain an array of double values as their Summary Objects. The values contained in the Summary Object are preserved as is. If the last value of the array is a numeric literal, Druid assumes that the value is an override parameter for ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/development/extensions-core/datasketches-tuple"},"nominal entries"),"."),(0,l.kt)("h2",{id:"ds_tuple_doubles_union"},"DS_TUPLE_DOUBLES_UNION"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"DS_TUPLE_DOUBLES_UNION(expr, ..., [nominalEntries])")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#tuple-sketch-functions"},"Scalar, sketch")),(0,l.kt)("p",null,"Returns a union of Tuple sketches which each contain an array of double values as their Summary Objects. The values contained in the Summary Objects are summed when combined. If the last value of the array is a numeric literal, Druid assumes that the value is an override parameter for ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/development/extensions-core/datasketches-tuple"},"nominal entries"),"."),(0,l.kt)("h2",{id:"earliest"},"EARLIEST"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"EARLIEST(expr, [maxBytesPerValue])")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-aggregations"},"Aggregation")),(0,l.kt)("p",null,"Returns the value of a numeric or string expression corresponding to the earliest ",(0,l.kt)("inlineCode",{parentName:"p"},"__time")," value."),(0,l.kt)("h2",{id:"earliest_by"},"EARLIEST_BY"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"EARLIEST_BY(expr, timestampExpr, [maxBytesPerValue])")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-aggregations"},"Aggregation")),(0,l.kt)("p",null,"Returns the value of a numeric or string expression corresponding to the earliest time value from ",(0,l.kt)("inlineCode",{parentName:"p"},"timestampExpr"),"."),(0,l.kt)("h2",{id:"exp"},"EXP"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"EXP(<NUMERIC>)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#numeric-functions"},"Scalar, numeric")),(0,l.kt)("p",null,"Calculates ",(0,l.kt)("em",{parentName:"p"},"e")," raised to the power of the numeric expression."),(0,l.kt)("h2",{id:"extract"},"EXTRACT"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"EXTRACT(<TIME_UNIT> FROM <TIMESTAMP>)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#date-and-time-functions"},"Scalar, date and time")),(0,l.kt)("p",null,"Extracts the value of some unit of the timestamp, optionally from a certain time zone, and returns the number."),(0,l.kt)("h2",{id:"floor-date-and-time"},"FLOOR (date and time)"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"FLOOR(<TIMESTAMP> TO <TIME_UNIT>)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#date-and-time-functions"},"Scalar, date and time")),(0,l.kt)("p",null,"Rounds down a timestamp by a given time unit."),(0,l.kt)("h2",{id:"floor-numeric"},"FLOOR (numeric)"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"FLOOR(<NUMERIC>)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#numeric-functions"},"Scalar, numeric")),(0,l.kt)("p",null,"Calculates the largest integer value less than or equal to the numeric expression."),(0,l.kt)("h2",{id:"greatest"},"GREATEST"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"GREATEST([expr1, ...])")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#reduction-functions"},"Scalar, reduction")),(0,l.kt)("p",null,"Returns the maximum value from the provided arguments."),(0,l.kt)("h2",{id:"grouping"},"GROUPING"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"GROUPING(expr, expr...)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-aggregations"},"Aggregation")),(0,l.kt)("p",null,"Returns a number for each output row of a groupBy query, indicating whether the specified dimension is included for that row."),(0,l.kt)("h2",{id:"hll_sketch_estimate"},"HLL_SKETCH_ESTIMATE"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"HLL_SKETCH_ESTIMATE(expr, [round])")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#sketch-functions"},"Scalar, sketch")),(0,l.kt)("p",null,"Returns the distinct count estimate from an HLL sketch."),(0,l.kt)("h2",{id:"hll_sketch_estimate_with_error_bounds"},"HLL_SKETCH_ESTIMATE_WITH_ERROR_BOUNDS"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"HLL_SKETCH_ESTIMATE_WITH_ERROR_BOUNDS(expr, [numStdDev])")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#sketch-functions"},"Scalar, sketch")),(0,l.kt)("p",null,"Returns the distinct count estimate and error bounds from an HLL sketch."),(0,l.kt)("h2",{id:"hll_sketch_to_string"},"HLL_SKETCH_TO_STRING"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"HLL_SKETCH_TO_STRING(expr)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#sketch-functions"},"Scalar, sketch")),(0,l.kt)("p",null,"Returns a human-readable string representation of an HLL sketch."),(0,l.kt)("h2",{id:"hll_sketch_union"},"HLL_SKETCH_UNION"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"HLL_SKETCH_UNION([lgK, tgtHllType], expr0, expr1, ...)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#sketch-functions"},"Scalar, sketch")),(0,l.kt)("p",null,"Returns a union of HLL sketches."),(0,l.kt)("h2",{id:"human_readable_binary_byte_format"},"HUMAN_READABLE_BINARY_BYTE_FORMAT"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"HUMAN_READABLE_BINARY_BYTE_FORMAT(value[, precision])")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#numeric-functions"},"Scalar, numeric")),(0,l.kt)("p",null,"Converts an integer byte size into human-readable IEC format."),(0,l.kt)("h2",{id:"human_readable_decimal_byte_format"},"HUMAN_READABLE_DECIMAL_BYTE_FORMAT"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"HUMAN_READABLE_DECIMAL_BYTE_FORMAT(value[, precision])")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#numeric-functions"},"Scalar, numeric")),(0,l.kt)("p",null,"Converts a byte size into human-readable SI format."),(0,l.kt)("h2",{id:"human_readable_decimal_format"},"HUMAN_READABLE_DECIMAL_FORMAT"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"HUMAN_READABLE_DECIMAL_FORMAT(value[, precision])")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#numeric-functions"},"Scalar, numeric")),(0,l.kt)("p",null,"Converts a byte size into human-readable SI format with single-character units."),(0,l.kt)("h2",{id:"icontains_string"},"ICONTAINS_STRING"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"ICONTAINS_STRING(<expr>, str)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#string-functions"},"Scalar, string")),(0,l.kt)("p",null,"Finds whether a string is in a given expression, case-insensitive."),(0,l.kt)("h2",{id:"ipv4_match"},"IPV4_MATCH"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"IPV4_MATCH(address, subnet)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#ip-address-functions"},"Scalar, IP address")),(0,l.kt)("p",null,"Returns true if the IPv4 ",(0,l.kt)("inlineCode",{parentName:"p"},"address")," belongs to the ",(0,l.kt)("inlineCode",{parentName:"p"},"subnet")," literal, else false."),(0,l.kt)("h2",{id:"ipv4_parse"},"IPV4_PARSE"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"IPV4_PARSE(address)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#ip-address-functions"},"Scalar, IP address")),(0,l.kt)("p",null,"Parses ",(0,l.kt)("inlineCode",{parentName:"p"},"address")," into an IPv4 address stored as an integer."),(0,l.kt)("h2",{id:"ipv4_stringify"},"IPV4_STRINGIFY"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"IPV4_STRINGIFY(address)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#ip-address-functions"},"Scalar, IP address")),(0,l.kt)("p",null,"Converts ",(0,l.kt)("inlineCode",{parentName:"p"},"address")," into an IPv4 address in dot-decimal notation."),(0,l.kt)("h2",{id:"ipv6_match"},"IPV6_MATCH"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"IPV6_MATCH(address, subnet)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#ip-address-functions"},"Scalar, IP address")),(0,l.kt)("p",null,"Returns true if the IPv6 ",(0,l.kt)("inlineCode",{parentName:"p"},"address")," belongs to the ",(0,l.kt)("inlineCode",{parentName:"p"},"subnet")," literal, else false."),(0,l.kt)("h2",{id:"json_keys"},"JSON_KEYS"),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-json-functions"},"JSON")),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"JSON_KEYS(expr, path)")),(0,l.kt)("p",null,"Returns an array of field names from ",(0,l.kt)("inlineCode",{parentName:"p"},"expr")," at the specified ",(0,l.kt)("inlineCode",{parentName:"p"},"path"),"."),(0,l.kt)("h2",{id:"json_object"},"JSON_OBJECT"),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-json-functions"},"JSON")),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"JSON_OBJECT(KEY expr1 VALUE expr2[, KEY expr3 VALUE expr4, ...])")),(0,l.kt)("p",null,"Constructs a new ",(0,l.kt)("inlineCode",{parentName:"p"},"COMPLEX<json>")," object. The ",(0,l.kt)("inlineCode",{parentName:"p"},"KEY")," expressions must evaluate to string types. The ",(0,l.kt)("inlineCode",{parentName:"p"},"VALUE")," expressions can be composed of any input type, including other ",(0,l.kt)("inlineCode",{parentName:"p"},"COMPLEX<json>")," values. ",(0,l.kt)("inlineCode",{parentName:"p"},"JSON_OBJECT")," can accept colon-separated key-value pairs. The following syntax is equivalent: ",(0,l.kt)("inlineCode",{parentName:"p"},"JSON_OBJECT(expr1:expr2[, expr3:expr4, ...])"),"."),(0,l.kt)("h2",{id:"json_paths"},"JSON_PATHS"),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-json-functions"},"JSON")),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"JSON_PATHS(expr)")),(0,l.kt)("p",null,"Returns an array of all paths which refer to literal values in ",(0,l.kt)("inlineCode",{parentName:"p"},"expr")," in JSONPath format."),(0,l.kt)("h2",{id:"json_query"},"JSON_QUERY"),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-json-functions"},"JSON")),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"JSON_QUERY(expr, path)")),(0,l.kt)("p",null,"Extracts a ",(0,l.kt)("inlineCode",{parentName:"p"},"COMPLEX<json>")," value from ",(0,l.kt)("inlineCode",{parentName:"p"},"expr"),", at the specified ",(0,l.kt)("inlineCode",{parentName:"p"},"path"),"."),(0,l.kt)("h2",{id:"json_query_array"},"JSON_QUERY_ARRAY"),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-json-functions"},"JSON")),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"JSON_QUERY_ARRAY(expr, path)")),(0,l.kt)("p",null,"Extracts an ",(0,l.kt)("inlineCode",{parentName:"p"},"ARRAY<COMPLEX<json>>")," value from ",(0,l.kt)("inlineCode",{parentName:"p"},"expr")," at the specified ",(0,l.kt)("inlineCode",{parentName:"p"},"path"),". If value is not an ",(0,l.kt)("inlineCode",{parentName:"p"},"ARRAY"),", it gets translated into a single element ",(0,l.kt)("inlineCode",{parentName:"p"},"ARRAY")," containing the value at ",(0,l.kt)("inlineCode",{parentName:"p"},"path"),". The primary use of this function is to extract arrays of objects to use as inputs to other ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-array-functions"},"array functions"),"."),(0,l.kt)("h2",{id:"json_value"},"JSON_VALUE"),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-json-functions"},"JSON")),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"JSON_VALUE(expr, path [RETURNING sqlType])")),(0,l.kt)("p",null,"Extracts a literal value from ",(0,l.kt)("inlineCode",{parentName:"p"},"expr")," at the specified ",(0,l.kt)("inlineCode",{parentName:"p"},"path"),". If you specify ",(0,l.kt)("inlineCode",{parentName:"p"},"RETURNING")," and an SQL type name (such as ",(0,l.kt)("inlineCode",{parentName:"p"},"VARCHAR"),", ",(0,l.kt)("inlineCode",{parentName:"p"},"BIGINT"),", ",(0,l.kt)("inlineCode",{parentName:"p"},"DOUBLE"),", etc) the function plans the query using the suggested type. Otherwise, it attempts to infer the type based on the context. If it can't infer the type, it defaults to ",(0,l.kt)("inlineCode",{parentName:"p"},"VARCHAR"),"."),(0,l.kt)("h2",{id:"latest"},"LATEST"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"LATEST(expr, [maxBytesPerValue])")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-aggregations"},"Aggregation")),(0,l.kt)("p",null,"Returns the value of a numeric or string expression corresponding to the latest ",(0,l.kt)("inlineCode",{parentName:"p"},"__time")," value."),(0,l.kt)("h2",{id:"latest_by"},"LATEST_BY"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"LATEST_BY(expr, timestampExpr, [maxBytesPerValue])")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-aggregations"},"Aggregation")),(0,l.kt)("p",null,"Returns the value of a numeric or string expression corresponding to the latest time value from ",(0,l.kt)("inlineCode",{parentName:"p"},"timestampExpr"),"."),(0,l.kt)("h2",{id:"least"},"LEAST"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"LEAST([expr1, ...])")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#reduction-functions"},"Scalar, reduction")),(0,l.kt)("p",null,"Returns the minimum value from the provided arguments."),(0,l.kt)("h2",{id:"left"},"LEFT"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"LEFT(expr, [length])")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#string-functions"},"Scalar, string")),(0,l.kt)("p",null,"Returns the leftmost number of characters from an expression."),(0,l.kt)("h2",{id:"length"},"LENGTH"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"LENGTH(expr)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#string-functions"},"Scalar, string")),(0,l.kt)("p",null,"Returns the length of the expression in UTF-16 encoding."),(0,l.kt)("h2",{id:"ln"},"LN"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"LN(expr)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#numeric-functions"},"Scalar, numeric")),(0,l.kt)("p",null,"Calculates the natural logarithm of the numeric expression."),(0,l.kt)("h2",{id:"log10"},"LOG10"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"LOG10(expr)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#numeric-functions"},"Scalar, numeric")),(0,l.kt)("p",null,"Calculates the base-10 of the numeric expression."),(0,l.kt)("h2",{id:"lookup"},"LOOKUP"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"LOOKUP(<CHARACTER>, <CHARACTER>[, <CHARACTER>])")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#string-functions"},"Scalar, string")),(0,l.kt)("p",null,"Looks up the expression in a registered query-time lookup table."),(0,l.kt)("h2",{id:"lower"},"LOWER"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"LOWER(expr)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#string-functions"},"Scalar, string")),(0,l.kt)("p",null,"Returns the expression in lowercase."),(0,l.kt)("h2",{id:"lpad"},"LPAD"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"LPAD(<CHARACTER>, <INTEGER>, [<CHARACTER>])")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#string-functions"},"Scalar, string")),(0,l.kt)("p",null,"Returns the leftmost number of characters from an expression, optionally padded with the given characters."),(0,l.kt)("h2",{id:"ltrim"},"LTRIM"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"LTRIM(<CHARACTER>, [<CHARACTER>])")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#string-functions"},"Scalar, string")),(0,l.kt)("p",null,"Trims characters from the leading end of an expression."),(0,l.kt)("h2",{id:"max"},"MAX"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"MAX(expr)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-aggregations"},"Aggregation")),(0,l.kt)("p",null,"Returns the maximum value of a set of values."),(0,l.kt)("h2",{id:"millis_to_timestamp"},"MILLIS_TO_TIMESTAMP"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"MILLIS_TO_TIMESTAMP(millis_expr)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#date-and-time-functions"},"Scalar, date and time")),(0,l.kt)("p",null,"Converts a number of milliseconds since epoch into a timestamp."),(0,l.kt)("h2",{id:"min"},"MIN"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"MIN(expr)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-aggregations"},"Aggregation")),(0,l.kt)("p",null,"Returns the minimum value of a set of values."),(0,l.kt)("h2",{id:"mod"},"MOD"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"MOD(x, y)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#numeric-functions"},"Scalar, numeric")),(0,l.kt)("p",null,"Calculates x modulo y, or the remainder of x divided by y."),(0,l.kt)("h2",{id:"mv_append"},"MV_APPEND"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"MV_APPEND(arr1, expr)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-multivalue-string-functions"},"Multi-value string")),(0,l.kt)("p",null,"Adds the expression to the end of the array."),(0,l.kt)("h2",{id:"mv_concat"},"MV_CONCAT"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"MV_CONCAT(arr1, arr2)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-multivalue-string-functions"},"Multi-value string")),(0,l.kt)("p",null,"Concatenates two arrays."),(0,l.kt)("h2",{id:"mv_contains"},"MV_CONTAINS"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"MV_CONTAINS(arr, expr)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-multivalue-string-functions"},"Multi-value string")),(0,l.kt)("p",null,"Returns true if the expression is in the array, false otherwise."),(0,l.kt)("h2",{id:"mv_filter_none"},"MV_FILTER_NONE"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"MV_FILTER_NONE(expr, arr)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-multivalue-string-functions"},"Multi-value string")),(0,l.kt)("p",null,"Filters a multi-value expression to include no values contained in the array."),(0,l.kt)("h2",{id:"mv_filter_only"},"MV_FILTER_ONLY"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"MV_FILTER_ONLY(expr, arr)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-multivalue-string-functions"},"Multi-value string")),(0,l.kt)("p",null,"Filters a multi-value expression to include only values contained in the array."),(0,l.kt)("h2",{id:"mv_length"},"MV_LENGTH"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"MV_LENGTH(arr)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-multivalue-string-functions"},"Multi-value string")),(0,l.kt)("p",null,"Returns the length of an array expression."),(0,l.kt)("h2",{id:"mv_offset"},"MV_OFFSET"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"MV_OFFSET(arr, long)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-multivalue-string-functions"},"Multi-value string")),(0,l.kt)("p",null,"Returns the array element at the given zero-based index."),(0,l.kt)("h2",{id:"mv_offset_of"},"MV_OFFSET_OF"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"MV_OFFSET_OF(arr, expr)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-multivalue-string-functions"},"Multi-value string")),(0,l.kt)("p",null,"Returns the zero-based index of the first occurrence of a given expression in the array."),(0,l.kt)("h2",{id:"mv_ordinal"},"MV_ORDINAL"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"MV_ORDINAL(arr, long)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-multivalue-string-functions"},"Multi-value string")),(0,l.kt)("p",null,"Returns the array element at the given one-based index."),(0,l.kt)("h2",{id:"mv_ordinal_of"},"MV_ORDINAL_OF"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"MV_ORDINAL_OF(arr, expr)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-multivalue-string-functions"},"Multi-value string")),(0,l.kt)("p",null,"Returns the one-based index of the first occurrence of a given expression."),(0,l.kt)("h2",{id:"mv_overlap"},"MV_OVERLAP"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"MV_OVERLAP(arr1, arr2)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-multivalue-string-functions"},"Multi-value string")),(0,l.kt)("p",null,"Returns true if the two arrays have any elements in common, false otherwise."),(0,l.kt)("h2",{id:"mv_prepend"},"MV_PREPEND"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"MV_PREPEND(expr, arr)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-multivalue-string-functions"},"Multi-value string")),(0,l.kt)("p",null,"Adds the expression to the beginning of the array."),(0,l.kt)("h2",{id:"mv_slice"},"MV_SLICE"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"MV_SLICE(arr, start, end)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-multivalue-string-functions"},"Multi-value string")),(0,l.kt)("p",null,"Returns a slice of the array from the zero-based start and end indexes."),(0,l.kt)("h2",{id:"mv_to_string"},"MV_TO_STRING"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"MV_TO_STRING(arr, str)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-multivalue-string-functions"},"Multi-value string")),(0,l.kt)("p",null,"Joins all elements of the array together by the given delimiter."),(0,l.kt)("h2",{id:"nullif"},"NULLIF"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"NULLIF(value1, value2)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#other-scalar-functions"},"Scalar, other")),(0,l.kt)("p",null,"Returns NULL if two values are equal, else returns the first value."),(0,l.kt)("h2",{id:"nvl"},"NVL"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"NVL(e1, e2)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#other-scalar-functions"},"Scalar, other")),(0,l.kt)("p",null,"Returns ",(0,l.kt)("inlineCode",{parentName:"p"},"e2")," if ",(0,l.kt)("inlineCode",{parentName:"p"},"e1")," is null, else returns ",(0,l.kt)("inlineCode",{parentName:"p"},"e1"),"."),(0,l.kt)("h2",{id:"parse_json"},"PARSE_JSON"),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-json-functions"},"JSON")),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"PARSE_JSON(expr)")),(0,l.kt)("p",null,"Parses ",(0,l.kt)("inlineCode",{parentName:"p"},"expr")," into a ",(0,l.kt)("inlineCode",{parentName:"p"},"COMPLEX<json>")," object. This operator deserializes JSON values when processing them, translating stringified JSON into a nested structure. If the input is not a ",(0,l.kt)("inlineCode",{parentName:"p"},"VARCHAR")," or it is invalid JSON, this function will result in an error."),(0,l.kt)("h2",{id:"parse_long"},"PARSE_LONG"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"PARSE_LONG(<CHARACTER>, [<INTEGER>])")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#string-functions"},"Scalar, string")),(0,l.kt)("p",null,"Converts a string into a BIGINT with the given base or into a DECIMAL data type if the base is not specified."),(0,l.kt)("h2",{id:"position"},"POSITION"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"POSITION(<CHARACTER> IN <CHARACTER> [FROM <INTEGER>])")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#string-functions"},"Scalar, string")),(0,l.kt)("p",null,"Returns the one-based index position of a substring within an expression, optionally starting from a given one-based index."),(0,l.kt)("h2",{id:"power"},"POWER"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"POWER(expr, power)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#numeric-functions"},"Scalar, numeric")),(0,l.kt)("p",null,"Calculates a numerical expression raised to the specified power."),(0,l.kt)("h2",{id:"radians"},"RADIANS"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"RADIANS(expr)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#numeric-functions"},"Scalar, numeric")),(0,l.kt)("p",null,"Converts an angle from degrees to radians."),(0,l.kt)("h2",{id:"regexp_extract"},"REGEXP_EXTRACT"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"REGEXP_EXTRACT(<CHARACTER>, <CHARACTER>, [<INTEGER>])")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#string-functions"},"Scalar, string")),(0,l.kt)("p",null,"Applies a regular expression to the string expression and returns the _n_th match."),(0,l.kt)("h2",{id:"regexp_like"},"REGEXP_LIKE"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"REGEXP_LIKE(<CHARACTER>, <CHARACTER>)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#string-functions"},"Scalar, string")),(0,l.kt)("p",null,"Returns true or false signifying whether the regular expression finds a match in the string expression."),(0,l.kt)("h2",{id:"regexp_replace"},"REGEXP_REPLACE"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"REGEXP_REPLACE(<CHARACTER>, <CHARACTER>, <CHARACTER>)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#string-functions"},"Scalar, string")),(0,l.kt)("p",null,"Replaces all occurrences of a regular expression in a string expression with a replacement string. The replacement\nstring may refer to capture groups using ",(0,l.kt)("inlineCode",{parentName:"p"},"$1"),", ",(0,l.kt)("inlineCode",{parentName:"p"},"$2"),", etc."),(0,l.kt)("h2",{id:"repeat"},"REPEAT"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"REPEAT(<CHARACTER>, [<INTEGER>])")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#string-functions"},"Scalar, string")),(0,l.kt)("p",null,"Repeats the string expression an integer number of times."),(0,l.kt)("h2",{id:"replace"},"REPLACE"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"REPLACE(expr, pattern, replacement)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#string-functions"},"Scalar, string")),(0,l.kt)("p",null,"Replaces a pattern with another string in the given expression."),(0,l.kt)("h2",{id:"reverse"},"REVERSE"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"REVERSE(expr)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#string-functions"},"Scalar, string")),(0,l.kt)("p",null,"Reverses the given expression."),(0,l.kt)("h2",{id:"right"},"RIGHT"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"RIGHT(expr, [length])")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#string-functions"},"Scalar, string")),(0,l.kt)("p",null,"Returns the rightmost number of characters from an expression."),(0,l.kt)("h2",{id:"round"},"ROUND"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"ROUND(expr[, digits])")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#numeric-functions"},"Scalar, numeric")),(0,l.kt)("p",null,"Calculates the rounded value for a numerical expression."),(0,l.kt)("h2",{id:"rpad"},"RPAD"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"RPAD(<CHARACTER>, <INTEGER>, [<CHARACTER>])")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#string-functions"},"Scalar, string")),(0,l.kt)("p",null,"Returns the rightmost number of characters from an expression, optionally padded with the given characters."),(0,l.kt)("h2",{id:"rtrim"},"RTRIM"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"RTRIM(<CHARACTER>, [<CHARACTER>])")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#string-functions"},"Scalar, string")),(0,l.kt)("p",null,"Trims characters from the trailing end of an expression."),(0,l.kt)("h2",{id:"safe_divide"},"SAFE_DIVIDE"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"SAFE_DIVIDE(x, y)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#numeric-functions"},"Scalar, numeric")),(0,l.kt)("p",null,"Returns ",(0,l.kt)("inlineCode",{parentName:"p"},"x")," divided by ",(0,l.kt)("inlineCode",{parentName:"p"},"y"),", guarded on division by 0."),(0,l.kt)("h2",{id:"sin"},"SIN"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"SIN(expr)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#numeric-functions"},"Scalar, numeric")),(0,l.kt)("p",null,"Calculates the trigonometric sine of an angle expressed in radians."),(0,l.kt)("h2",{id:"sqrt"},"SQRT"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"SQRT(expr)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#numeric-functions"},"Scalar, numeric")),(0,l.kt)("p",null,"Calculates the square root of a numeric expression."),(0,l.kt)("h2",{id:"stddev"},"STDDEV"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"STDDEV(expr)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-aggregations"},"Aggregation")),(0,l.kt)("p",null,"Alias for ",(0,l.kt)("a",{parentName:"p",href:"#stddev_samp"},(0,l.kt)("inlineCode",{parentName:"a"},"STDDEV_SAMP")),"."),(0,l.kt)("h2",{id:"stddev_pop"},"STDDEV_POP"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"STDDEV_POP(expr)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-aggregations"},"Aggregation")),(0,l.kt)("p",null,"Calculates the population standard deviation of a set of values."),(0,l.kt)("h2",{id:"stddev_samp"},"STDDEV_SAMP"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"STDDEV_SAMP(expr)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-aggregations"},"Aggregation")),(0,l.kt)("p",null,"Calculates the sample standard deviation of a set of values."),(0,l.kt)("h2",{id:"string_agg"},"STRING_AGG"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"STRING_AGG(expr, separator, [size])")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-aggregations"},"Aggregation")),(0,l.kt)("p",null,"Collects all values of an expression into a single string."),(0,l.kt)("h2",{id:"string_to_array"},"STRING_TO_ARRAY"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"STRING_TO_ARRAY(str1, str2)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-array-functions"},"Array")),(0,l.kt)("p",null,"Splits ",(0,l.kt)("inlineCode",{parentName:"p"},"str1")," into an array on the delimiter specified by ",(0,l.kt)("inlineCode",{parentName:"p"},"str2"),", which is a regular expression."),(0,l.kt)("h2",{id:"string_format"},"STRING_FORMAT"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"STRING_FORMAT(pattern[, args...])")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#string-functions"},"Scalar, string")),(0,l.kt)("p",null,"Returns a string formatted in accordance to Java's String.format method."),(0,l.kt)("h2",{id:"string_to_mv"},"STRING_TO_MV"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"STRING_TO_MV(str1, str2)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-multivalue-string-functions"},"Multi-value string")),(0,l.kt)("p",null,"Splits ",(0,l.kt)("inlineCode",{parentName:"p"},"str1")," into an multi-value string on the delimiter specified by ",(0,l.kt)("inlineCode",{parentName:"p"},"str2"),", which is a regular expression."),(0,l.kt)("h2",{id:"strlen"},"STRLEN"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"STRLEN(expr)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#string-functions"},"Scalar, string")),(0,l.kt)("p",null,"Alias for ",(0,l.kt)("a",{parentName:"p",href:"#length"},(0,l.kt)("inlineCode",{parentName:"a"},"LENGTH")),"."),(0,l.kt)("h2",{id:"strpos"},"STRPOS"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"STRPOS(<CHARACTER>, <CHARACTER>)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#string-functions"},"Scalar, string")),(0,l.kt)("p",null,"Returns the one-based index position of a substring within an expression."),(0,l.kt)("h2",{id:"substr"},"SUBSTR"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"SUBSTR(<CHARACTER>, <INTEGER>, [<INTEGER>])")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#string-functions"},"Scalar, string")),(0,l.kt)("p",null,"Alias for ",(0,l.kt)("a",{parentName:"p",href:"#substring"},(0,l.kt)("inlineCode",{parentName:"a"},"SUBSTRING")),"."),(0,l.kt)("h2",{id:"substring"},"SUBSTRING"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"SUBSTRING(<CHARACTER>, <INTEGER>, [<INTEGER>])")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#string-functions"},"Scalar, string")),(0,l.kt)("p",null,"Returns a substring of the expression starting at a given one-based index."),(0,l.kt)("h2",{id:"sum"},"SUM"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"SUM(expr)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-aggregations"},"Aggregation")),(0,l.kt)("p",null,"Calculates the sum of a set of values."),(0,l.kt)("h2",{id:"tan"},"TAN"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"TAN(expr)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#numeric-functions"},"Scalar, numeric")),(0,l.kt)("p",null,"Calculates the trigonometric tangent of an angle expressed in radians."),(0,l.kt)("h2",{id:"tdigest_generate_sketch"},"TDIGEST_GENERATE_SKETCH"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"TDIGEST_GENERATE_SKETCH(expr, [compression])")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-aggregations"},"Aggregation")),(0,l.kt)("p",null,"Generates a T-digest sketch from values of the specified expression."),(0,l.kt)("h2",{id:"tdigest_quantile"},"TDIGEST_QUANTILE"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"TDIGEST_QUANTILE(expr, quantileFraction, [compression])")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-aggregations"},"Aggregation")),(0,l.kt)("p",null,"Returns the quantile for the specified fraction from a T-Digest sketch constructed from values of the expression."),(0,l.kt)("h2",{id:"textcat"},"TEXTCAT"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"TEXTCAT(<CHARACTER>, <CHARACTER>)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#string-functions"},"Scalar, string")),(0,l.kt)("p",null,"Concatenates two string expressions."),(0,l.kt)("h2",{id:"theta_sketch_estimate"},"THETA_SKETCH_ESTIMATE"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"THETA_SKETCH_ESTIMATE(expr)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#sketch-functions"},"Scalar, sketch")),(0,l.kt)("p",null,"Returns the distinct count estimate from a Theta sketch."),(0,l.kt)("h2",{id:"theta_sketch_estimate_with_error_bounds"},"THETA_SKETCH_ESTIMATE_WITH_ERROR_BOUNDS"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"THETA_SKETCH_ESTIMATE_WITH_ERROR_BOUNDS(expr, errorBoundsStdDev)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#sketch-functions"},"Scalar, sketch")),(0,l.kt)("p",null,"Returns the distinct count estimate and error bounds from a Theta sketch."),(0,l.kt)("h2",{id:"theta_sketch_intersect"},"THETA_SKETCH_INTERSECT"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"THETA_SKETCH_INTERSECT([size], expr0, expr1, ...)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#sketch-functions"},"Scalar, sketch")),(0,l.kt)("p",null,"Returns an intersection of Theta sketches."),(0,l.kt)("h2",{id:"theta_sketch_not"},"THETA_SKETCH_NOT"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"THETA_SKETCH_NOT([size], expr0, expr1, ...)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#sketch-functions"},"Scalar, sketch")),(0,l.kt)("p",null,"Returns a set difference of Theta sketches."),(0,l.kt)("h2",{id:"theta_sketch_union"},"THETA_SKETCH_UNION"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"THETA_SKETCH_UNION([size], expr0, expr1, ...)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#sketch-functions"},"Scalar, sketch")),(0,l.kt)("p",null,"Returns a union of Theta sketches."),(0,l.kt)("h2",{id:"time_ceil"},"TIME_CEIL"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"TIME_CEIL(<TIMESTAMP>, <period>, [<origin>, [<timezone>]])")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#date-and-time-functions"},"Scalar, date and time")),(0,l.kt)("p",null,"Rounds up a timestamp by a given time period, optionally from some reference time or timezone."),(0,l.kt)("h2",{id:"time_extract"},"TIME_EXTRACT"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"TIME_EXTRACT(<TIMESTAMP>, [<unit>, [<timezone>]])")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#date-and-time-functions"},"Scalar, date and time")),(0,l.kt)("p",null,"Extracts the value of some unit of the timestamp and returns the number."),(0,l.kt)("h2",{id:"time_floor"},"TIME_FLOOR"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"TIME_FLOOR(<TIMESTAMP>, <period>, [<origin>, [<timezone>]])")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#date-and-time-functions"},"Scalar, date and time")),(0,l.kt)("p",null,"Rounds down a timestamp by a given time period, optionally from some reference time or timezone."),(0,l.kt)("h2",{id:"time_format"},"TIME_FORMAT"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"TIME_FORMAT(<TIMESTAMP>, [<pattern>, [<timezone>]])")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#date-and-time-functions"},"Scalar, date and time")),(0,l.kt)("p",null,"Formats a timestamp as a string."),(0,l.kt)("h2",{id:"time_in_interval"},"TIME_IN_INTERVAL"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"TIME_IN_INTERVAL(<TIMESTAMP>, <CHARACTER>)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#date-and-time-functions"},"Scalar, date and time")),(0,l.kt)("p",null,"Returns whether a timestamp is contained within a particular interval, formatted as a string."),(0,l.kt)("h2",{id:"time_parse"},"TIME_PARSE"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"TIME_PARSE(<string_expr>, [<pattern>, [<timezone>]])")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#date-and-time-functions"},"Scalar, date and time")),(0,l.kt)("p",null,"Parses a string into a timestamp."),(0,l.kt)("h2",{id:"time_shift"},"TIME_SHIFT"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"TIME_SHIFT(<TIMESTAMP>, <period>, <step>, [<timezone>])")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#date-and-time-functions"},"Scalar, date and time")),(0,l.kt)("p",null,"Shifts a timestamp forwards or backwards by a given number of time units."),(0,l.kt)("h2",{id:"timestamp_to_millis"},"TIMESTAMP_TO_MILLIS"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"TIMESTAMP_TO_MILLIS(<TIMESTAMP>)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#date-and-time-functions"},"Scalar, date and time")),(0,l.kt)("p",null,"Returns the number of milliseconds since epoch for the given timestamp."),(0,l.kt)("h2",{id:"timestampadd"},"TIMESTAMPADD"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"TIMESTAMPADD(<unit>, <count>, <TIMESTAMP>)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#date-and-time-functions"},"Scalar, date and time")),(0,l.kt)("p",null,"Adds a certain amount of time to a given timestamp."),(0,l.kt)("h2",{id:"timestampdiff"},"TIMESTAMPDIFF"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"TIMESTAMPDIFF(<unit>, <TIMESTAMP>, <TIMESTAMP>)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#date-and-time-functions"},"Scalar, date and time")),(0,l.kt)("p",null,"Takes the difference between two timestamps, returning the results in the given units."),(0,l.kt)("h2",{id:"to_json_string"},"TO_JSON_STRING"),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-json-functions"},"JSON")),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"TO_JSON_STRING(expr)")),(0,l.kt)("p",null,"Serializes ",(0,l.kt)("inlineCode",{parentName:"p"},"expr")," into a JSON string."),(0,l.kt)("h2",{id:"trim"},"TRIM"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"TRIM([BOTH|LEADING|TRAILING] [<chars> FROM] expr)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#string-functions"},"Scalar, string")),(0,l.kt)("p",null,"Trims the leading or trailing characters of an expression."),(0,l.kt)("h2",{id:"trunc"},"TRUNC"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"TRUNC(expr[, digits])")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#numeric-functions"},"Scalar, numeric")),(0,l.kt)("p",null,"Alias for ",(0,l.kt)("a",{parentName:"p",href:"#truncate"},(0,l.kt)("inlineCode",{parentName:"a"},"TRUNCATE")),"."),(0,l.kt)("h2",{id:"truncate"},"TRUNCATE"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"TRUNCATE(expr[, digits])")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#numeric-functions"},"Scalar, numeric")),(0,l.kt)("p",null,"Truncates a numerical expression to a specific number of decimal digits."),(0,l.kt)("h2",{id:"try_parse_json"},"TRY_PARSE_JSON"),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-json-functions"},"JSON")),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"TRY_PARSE_JSON(expr)")),(0,l.kt)("p",null,"Parses ",(0,l.kt)("inlineCode",{parentName:"p"},"expr")," into a ",(0,l.kt)("inlineCode",{parentName:"p"},"COMPLEX<json>")," object. This operator deserializes JSON values when processing them, translating stringified JSON into a nested structure. If the input is not a ",(0,l.kt)("inlineCode",{parentName:"p"},"VARCHAR")," or it is invalid JSON, this function will result in a ",(0,l.kt)("inlineCode",{parentName:"p"},"NULL")," value."),(0,l.kt)("h2",{id:"unnest"},"UNNEST"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"UNNEST(source_expression) as table_alias_name(column_alias_name)")),(0,l.kt)("p",null,"Unnests a source expression that includes arrays into a target column with an aliased name. "),(0,l.kt)("p",null,"For more information, see ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql#unnest"},"UNNEST"),"."),(0,l.kt)("h2",{id:"upper"},"UPPER"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"UPPER(expr)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-scalar#string-functions"},"Scalar, string")),(0,l.kt)("p",null,"Returns the expression in uppercase."),(0,l.kt)("h2",{id:"var_pop"},"VAR_POP"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"VAR_POP(expr)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-aggregations"},"Aggregation")),(0,l.kt)("p",null,"Calculates the population variance of a set of values."),(0,l.kt)("h2",{id:"var_samp"},"VAR_SAMP"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"VAR_SAMP(expr)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-aggregations"},"Aggregation")),(0,l.kt)("p",null,"Calculates the sample variance of a set of values."),(0,l.kt)("h2",{id:"variance"},"VARIANCE"),(0,l.kt)("p",null,(0,l.kt)("inlineCode",{parentName:"p"},"VARIANCE(expr)")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Function type:")," ",(0,l.kt)("a",{parentName:"p",href:"/docs/29.0.1/querying/sql-aggregations"},"Aggregation")),(0,l.kt)("p",null,"Alias for ",(0,l.kt)("a",{parentName:"p",href:"#var_samp"},(0,l.kt)("inlineCode",{parentName:"a"},"VAR_SAMP")),"."))}m.isMDXComponent=!0}}]);