Project: Apache Spark (App Definition and Development / Streaming & Messaging)
File: sql-expression-schema.md

<!-- Automatically generated by ExpressionsSchemaSuite --> | Class name | Function name or alias | Query example | Output schema | | - | - | - | - | | org.apache.spark.sql.catalyst.expressions.Abs | abs | SELECT abs(-1) | struct<abs(-1):int> | | org.apache.spark.sql.catalyst.expressions.Acos | acos | SELECT acos(1) | struct<ACOS(1):double> | | org.apache.spark.sql.catalyst.expressions.Acosh | acosh | SELECT acosh(1) | struct<ACOSH(1):double> | | org.apache.spark.sql.catalyst.expressions.Add | + | SELECT 1 + 2 | struct<(1 + 2):int> | | org.apache.spark.sql.catalyst.expressions.AddMonths | addmonths | SELECT addmonths('2016-08-31', 1) | struct<add_months(2016-08-31, 1):date> | | org.apache.spark.sql.catalyst.expressions.AesDecrypt | aesdecrypt | SELECT aesdecrypt(unhex('83F16B2AA704794132802D248E6BFD4E380078182D1544813898AC97E709B28A94'), '0000111122223333') | struct<aes_decrypt(unhex(83F16B2AA704794132802D248E6BFD4E380078182D1544813898AC97E709B28A94), 0000111122223333, GCM, DEFAULT, ):binary> | | org.apache.spark.sql.catalyst.expressions.AesEncrypt | aesencrypt | SELECT hex(aesencrypt('Spark', '0000111122223333')) | struct<hex(aes_encrypt(Spark, 0000111122223333, GCM, DEFAULT, , )):string> | | org.apache.spark.sql.catalyst.expressions.And | and | SELECT true and true | struct<(true AND true):boolean> | | org.apache.spark.sql.catalyst.expressions.ArrayAggregate | aggregate | SELECT aggregate(array(1, 2, 3), 0, (acc, x) -> acc + x) | struct<aggregate(array(1, 2, 3), 0, lambdafunction((namedlambdavariable() + namedlambdavariable()), namedlambdavariable(), namedlambdavariable()), lambdafunction(namedlambdavariable(), namedlambdavariable())):int> | | org.apache.spark.sql.catalyst.expressions.ArrayAggregate | reduce | SELECT reduce(array(1, 2, 3), 0, (acc, x) -> acc + x) | struct<reduce(array(1, 2, 3), 0, lambdafunction((namedlambdavariable() + namedlambdavariable()), namedlambdavariable(), namedlambdavariable()), lambdafunction(namedlambdavariable(), namedlambdavariable())):int> | | org.apache.spark.sql.catalyst.expressions.ArrayAppend | arrayappend | SELECT arrayappend(array('b', 'd', 'c', 'a'), 'd') | struct<array_append(array(b, d, c, a), d):array<string>> | | org.apache.spark.sql.catalyst.expressions.ArrayCompact | arraycompact | SELECT arraycompact(array(1, 2, 3, null)) | struct<array_compact(array(1, 2, 3, NULL)):array<int>> | | org.apache.spark.sql.catalyst.expressions.ArrayContains | arraycontains | SELECT arraycontains(array(1, 2, 3), 2) | struct<array_contains(array(1, 2, 3), 2):boolean> | | org.apache.spark.sql.catalyst.expressions.ArrayDistinct | arraydistinct | SELECT arraydistinct(array(1, 2, 3, null, 3)) | struct<array_distinct(array(1, 2, 3, NULL, 3)):array<int>> | | org.apache.spark.sql.catalyst.expressions.ArrayExcept | arrayexcept | SELECT arrayexcept(array(1, 2, 3), array(1, 3, 5)) | struct<array_except(array(1, 2, 3), array(1, 3, 5)):array<int>> | | org.apache.spark.sql.catalyst.expressions.ArrayExists | exists | SELECT exists(array(1, 2, 3), x -> x % 2 == 0) | struct<exists(array(1, 2, 3), lambdafunction(((namedlambdavariable() % 2) = 0), namedlambdavariable())):boolean> | | org.apache.spark.sql.catalyst.expressions.ArrayFilter | filter | SELECT filter(array(1, 2, 3), x -> x % 2 == 1) | struct<filter(array(1, 2, 3), lambdafunction(((namedlambdavariable() % 2) = 1), namedlambdavariable())):array<int>> | | org.apache.spark.sql.catalyst.expressions.ArrayForAll | forall | SELECT forall(array(1, 2, 3), x -> x % 2 == 0) | struct<forall(array(1, 2, 3), lambdafunction(((namedlambdavariable() % 2) = 0), namedlambdavariable())):boolean> | | org.apache.spark.sql.catalyst.expressions.ArrayInsert | arrayinsert | SELECT arrayinsert(array(1, 2, 3, 4), 5, 5) | struct<array_insert(array(1, 2, 3, 4), 5, 5):array<int>> | | org.apache.spark.sql.catalyst.expressions.ArrayIntersect | arrayintersect | SELECT arrayintersect(array(1, 2, 3), array(1, 3, 5)) | struct<array_intersect(array(1, 2, 3), array(1, 3, 5)):array<int>> | | org.apache.spark.sql.catalyst.expressions.ArrayJoin | arrayjoin | SELECT arrayjoin(array('hello', 'world'), ' ') | struct<array_join(array(hello, world), ):string> | | org.apache.spark.sql.catalyst.expressions.ArrayMax | arraymax | SELECT arraymax(array(1, 20, null, 3)) | struct<array_max(array(1, 20, NULL, 3)):int> | | org.apache.spark.sql.catalyst.expressions.ArrayMin | arraymin | SELECT arraymin(array(1, 20, null, 3)) | struct<array_min(array(1, 20, NULL, 3)):int> | | org.apache.spark.sql.catalyst.expressions.ArrayPosition | arrayposition | SELECT arrayposition(array(312, 773, 708, 708), 708) | struct<array_position(array(312, 773, 708, 708), 708):bigint> | | org.apache.spark.sql.catalyst.expressions.ArrayPrepend | arrayprepend | SELECT arrayprepend(array('b', 'd', 'c', 'a'), 'd') | struct<array_prepend(array(b, d, c, a), d):array<string>> | | org.apache.spark.sql.catalyst.expressions.ArrayRemove | arrayremove | SELECT arrayremove(array(1, 2, 3, null, 3), 3) | struct<array_remove(array(1, 2, 3, NULL, 3), 3):array<int>> | | org.apache.spark.sql.catalyst.expressions.ArrayRepeat | arrayrepeat | SELECT arrayrepeat('123', 2) | struct<array_repeat(123, 2):array<string>> | | org.apache.spark.sql.catalyst.expressions.ArraySize | arraysize | SELECT arraysize(array('b', 'd', 'c', 'a')) | struct<array_size(array(b, d, c, a)):int> | |

| arraysort | SELECT arraysort(array(5, 6, 1), (left, right) -> case when left < right then -1 when left > right then 1 else 0 end) | struct<array_sort(array(5, 6, 1), lambdafunction(CASE WHEN (namedlambdavariable() < namedlambdavariable()) THEN -1 WHEN (namedlambdavariable() > namedlambdavariable()) THEN 1 ELSE 0 END, namedlambdavariable(), namedlambdavariable())):array<int>> | | org.apache.spark.sql.catalyst.expressions.ArrayTransform | transform | SELECT transform(array(1, 2, 3), x -> x + 1) | struct<transform(array(1, 2, 3), lambdafunction((namedlambdavariable() + 1), namedlambdavariable())):array<int>> | | org.apache.spark.sql.catalyst.expressions.ArrayUnion | arrayunion | SELECT arrayunion(array(1, 2, 3), array(1, 3, 5)) | struct<array_union(array(1, 2, 3), array(1, 3, 5)):array<int>> | | org.apache.spark.sql.catalyst.expressions.ArraysOverlap | arraysoverlap | SELECT arraysoverlap(array(1, 2, 3), array(3, 4, 5)) | struct<arrays_overlap(array(1, 2, 3), array(3, 4, 5)):boolean> | | org.apache.spark.sql.catalyst.expressions.ArraysZip | arrayszip | SELECT arrayszip(array(1, 2, 3), array(2, 3, 4)) | struct<arrays_zip(array(1, 2, 3), array(2, 3, 4)):array<struct<0:int,1:int>>> | | org.apache.spark.sql.catalyst.expressions.Ascii | ascii | SELECT ascii('222') | struct<ascii(222):int> | | org.apache.spark.sql.catalyst.expressions.Asin | asin | SELECT asin(0) | struct<ASIN(0):double> | | org.apache.spark.sql.catalyst.expressions.Asinh | asinh | SELECT asinh(0) | struct<ASINH(0):double> | | org.apache.spark.sql.catalyst.expressions.AssertTrue | asserttrue | SELECT asserttrue(0 < 1) | struct<assert_true((0 < 1), '(0 < 1)' is not true!):void> | | org.apache.spark.sql.catalyst.expressions.Atan | atan | SELECT atan(0) | struct<ATAN(0):double> | | org.apache.spark.sql.catalyst.expressions.Atan2 | atan2 | SELECT atan2(0, 0) | struct<ATAN2(0, 0):double> | | org.apache.spark.sql.catalyst.expressions.Atanh | atanh | SELECT atanh(0) | struct<ATANH(0):double> | | org.apache.spark.sql.catalyst.expressions.BRound | bround | SELECT bround(2.5, 0) | struct<bround(2.5, 0):decimal(2,0)> | | org.apache.spark.sql.catalyst.expressions.Base64 | base64 | SELECT base64('Spark SQL') | struct<base64(Spark SQL):string> | | org.apache.spark.sql.catalyst.expressions.Between | between | SELECT 0.5 between 0.1 AND 1.0 | struct<between(0.5, 0.1, 1.0):boolean> | | org.apache.spark.sql.catalyst.expressions.Bin | bin | SELECT bin(13) | struct<bin(13):string> | | org.apache.spark.sql.catalyst.expressions.BitLength | bitlength | SELECT bitlength('Spark SQL') | struct<bit_length(Spark SQL):int> | | org.apache.spark.sql.catalyst.expressions.BitmapBitPosition | bitmapbitposition | SELECT bitmapbitposition(1) | struct<bitmapbitposition(1):bigint> | | org.apache.spark.sql.catalyst.expressions.BitmapBucketNumber | bitmapbucketnumber | SELECT bitmapbucketnumber(123) | struct<bitmapbucketnumber(123):bigint> | | org.apache.spark.sql.catalyst.expressions.BitmapConstructAgg | bitmapconstructagg | SELECT substring(hex(bitmapconstructagg(bitmapbitposition(col))), 0, 6) FROM VALUES (1), (2), (3) AS tab(col) | struct<substring(hex(bitmapconstructagg(bitmapbitposition(col))), 0, 6):string> | | org.apache.spark.sql.catalyst.expressions.BitmapCount | bitmapcount | SELECT bitmapcount(X '1010') | struct<bitmap_count(X'1010'):bigint> | | org.apache.spark.sql.catalyst.expressions.BitmapOrAgg | bitmaporagg | SELECT substring(hex(bitmaporagg(col)), 0, 6) FROM VALUES (X '10'), (X '20'), (X '40') AS tab(col) | struct<substring(hex(bitmaporagg(col)), 0, 6):string> | | org.apache.spark.sql.catalyst.expressions.BitwiseAnd | & | SELECT 3 & 5 | struct<(3 & 5):int> | | org.apache.spark.sql.catalyst.expressions.BitwiseCount | bitcount | SELECT bitcount(0) | struct<bit_count(0):int> | | org.apache.spark.sql.catalyst.expressions.BitwiseGet | bitget | SELECT bitget(11, 0) | struct<bit_get(11, 0):tinyint> | | org.apache.spark.sql.catalyst.expressions.BitwiseGet | getbit | SELECT getbit(11, 0) | struct<getbit(11, 0):tinyint> | | org.apache.spark.sql.catalyst.expressions.BitwiseNot | ~ | SELECT ~ 0 | struct<~0:int> | | org.apache.spark.sql.catalyst.expressions.BitwiseOr | &#124; | SELECT 3 &#124; 5 | struct<(3 &#124; 5):int> | | org.apache.spark.sql.catalyst.expressions.BitwiseXor | ^ | SELECT 3 ^ 5 | struct<(3 ^ 5):int> | | org.apache.spark.sql.catalyst.expressions.CallMethodViaReflection | javamethod | SELECT javamethod('java.util.UUID', 'randomUUID') | struct<java_method(java.util.UUID, randomUUID):string> | | org.apache.spark.sql.catalyst.expressions.CallMethodViaReflection | reflect | SELECT reflect('java.util.UUID', 'randomUUID') | struct<reflect(java.util.UUID, randomUUID):string> | | org.apache.spark.sql.catalyst.expressions.CaseWhen | when | SELECT CASE WHEN 1 > 0 THEN 1 WHEN 2 > 0 THEN 2.0 ELSE 1.2 END | struct<CASE WHEN (1 > 0) THEN 1 WHEN (2 > 0) THEN 2.0 ELSE 1.2 END:decimal(11,1)> | | org.apache.spark.sql.catalyst.expressions.Cast | bigint | N/A | N/A | | org.apache.spark.sql.catalyst.expressions.Cast | binary | N/A | N/A | | org.apache.spark.sql.catalyst.expressions.Cast | boolean | N/A | N/A | | org.apache.spark.sql.catalyst.expressions.Cast | cast | SELECT cast('10' as int) | struct<CAST(10 AS INT):int> | | org.apache.spark.sql.catalyst.expressions.Cast | date | N/A | N/A | | org.apache.spark.sql.catalyst.expressions.Cast | decimal | N/A | N/A | | org.apache.spark.sql.catalyst.expressions.Cast | double | N/A | N/A | | org.apache.spark.sql.catalyst.expressions.Cast | float | N/A | N/A | | org.apache.spark.sql.catalyst.expressions.Cast | int | N/A | N/A | | org.apache.spark.sql.catalyst.expressions.Cast | smallint | N/A | N/A | | org.apache.spark.sql.catalyst.expressions.Cast | string | N/A | N/A | | org.apache.spark.sql.catalyst.expressions.Cast | timestamp | N/A | N/A | |

| tinyint | N/A | N/A | | org.apache.spark.sql.catalyst.expressions.Cbrt | cbrt | SELECT cbrt(27.0) | struct<CBRT(27.0):double> | | org.apache.spark.sql.catalyst.expressions.CeilExpressionBuilder | ceil | SELECT ceil(-0.1) | struct<CEIL(-0.1):decimal(1,0)> | | org.apache.spark.sql.catalyst.expressions.CeilExpressionBuilder | ceiling | SELECT ceiling(-0.1) | struct<ceiling(-0.1):decimal(1,0)> | | org.apache.spark.sql.catalyst.expressions.Chr | char | SELECT char(65) | struct<char(65):string> | | org.apache.spark.sql.catalyst.expressions.Chr | chr | SELECT chr(65) | struct<chr(65):string> | | org.apache.spark.sql.catalyst.expressions.Coalesce | coalesce | SELECT coalesce(NULL, 1, NULL) | struct<coalesce(NULL, 1, NULL):int> | | org.apache.spark.sql.catalyst.expressions.CollateExpressionBuilder | collate | SELECT COLLATION('Spark SQL' collate UTF8BINARYLCASE) | struct<collation(collate(Spark SQL)):string> | | org.apache.spark.sql.catalyst.expressions.Collation | collation | SELECT collation('Spark SQL') | struct<collation(Spark SQL):string> | | org.apache.spark.sql.catalyst.expressions.Concat | concat | SELECT concat('Spark', 'SQL') | struct<concat(Spark, SQL):string> | | org.apache.spark.sql.catalyst.expressions.ConcatWs | concatws | SELECT concatws(' ', 'Spark', 'SQL') | struct<concat_ws( , Spark, SQL):string> | | org.apache.spark.sql.catalyst.expressions.ContainsExpressionBuilder | contains | SELECT contains('Spark SQL', 'Spark') | struct<contains(Spark SQL, Spark):boolean> | | org.apache.spark.sql.catalyst.expressions.Conv | conv | SELECT conv('100', 2, 10) | struct<conv(100, 2, 10):string> | | org.apache.spark.sql.catalyst.expressions.ConvertTimezone | converttimezone | SELECT converttimezone('Europe/Brussels', 'America/LosAngeles', timestampntz'2021-12-06 00:00:00') | struct<converttimezone(Europe/Brussels, America/LosAngeles, TIMESTAMPNTZ '2021-12-06 00:00:00'):timestampntz> | | org.apache.spark.sql.catalyst.expressions.Cos | cos | SELECT cos(0) | struct<COS(0):double> | | org.apache.spark.sql.catalyst.expressions.Cosh | cosh | SELECT cosh(0) | struct<COSH(0):double> | | org.apache.spark.sql.catalyst.expressions.Cot | cot | SELECT cot(1) | struct<COT(1):double> | | org.apache.spark.sql.catalyst.expressions.Crc32 | crc32 | SELECT crc32('Spark') | struct<crc32(Spark):bigint> | | org.apache.spark.sql.catalyst.expressions.CreateArray | array | SELECT array(1, 2, 3) | struct<array(1, 2, 3):array<int>> | | org.apache.spark.sql.catalyst.expressions.CreateMap | map | SELECT map(1.0, '2', 3.0, '4') | struct<map(1.0, 2, 3.0, 4):map<decimal(2,1),string>> | | org.apache.spark.sql.catalyst.expressions.CreateNamedStruct | namedstruct | SELECT namedstruct("a", 1, "b", 2, "c", 3) | struct<named_struct(a, 1, b, 2, c, 3):struct<a:int,b:int,c:int>> | | org.apache.spark.sql.catalyst.expressions.CreateNamedStruct | struct | SELECT struct(1, 2, 3) | struct<struct(1, 2, 3):struct<col1:int,col2:int,col3:int>> | | org.apache.spark.sql.catalyst.expressions.Csc | csc | SELECT csc(1) | struct<CSC(1):double> | | org.apache.spark.sql.catalyst.expressions.CsvToStructs | fromcsv | SELECT fromcsv('1, 0.8', 'a INT, b DOUBLE') | struct<from_csv(1, 0.8):struct<a:int,b:double>> | | org.apache.spark.sql.catalyst.expressions.CumeDist | cumedist | SELECT a, b, cumedist() OVER (PARTITION BY a ORDER BY b) FROM VALUES ('A1', 2), ('A1', 1), ('A2', 3), ('A1', 1) tab(a, b) | struct<a:string,b:int,cume_dist() OVER (PARTITION BY a ORDER BY b ASC NULLS FIRST RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW):double> | | org.apache.spark.sql.catalyst.expressions.CurDateExpressionBuilder | curdate | SELECT curdate() | struct<current_date():date> | | org.apache.spark.sql.catalyst.expressions.CurrentCatalog | currentcatalog | SELECT currentcatalog() | struct<current_catalog():string> | | org.apache.spark.sql.catalyst.expressions.CurrentDatabase | currentdatabase | SELECT currentdatabase() | struct<current_schema():string> | | org.apache.spark.sql.catalyst.expressions.CurrentDatabase | currentschema | SELECT currentschema() | struct<current_schema():string> | | org.apache.spark.sql.catalyst.expressions.CurrentDate | currentdate | SELECT currentdate() | struct<current_date():date> | | org.apache.spark.sql.catalyst.expressions.CurrentTimeZone | currenttimezone | SELECT currenttimezone() | struct<current_timezone():string> | | org.apache.spark.sql.catalyst.expressions.CurrentTimestamp | currenttimestamp | SELECT currenttimestamp() | struct<current_timestamp():timestamp> | | org.apache.spark.sql.catalyst.expressions.CurrentUser | currentuser | SELECT currentuser() | struct<current_user():string> | | org.apache.spark.sql.catalyst.expressions.CurrentUser | sessionuser | SELECT sessionuser() | struct<session_user():string> | | org.apache.spark.sql.catalyst.expressions.CurrentUser | user | SELECT user() | struct<user():string> | | org.apache.spark.sql.catalyst.expressions.DateAdd | dateadd | SELECT dateadd('2016-07-30', 1) | struct<date_add(2016-07-30, 1):date> | | org.apache.spark.sql.catalyst.expressions.DateAdd | dateadd | SELECT dateadd('2016-07-30', 1) | struct<date_add(2016-07-30, 1):date> | | org.apache.spark.sql.catalyst.expressions.DateDiff | datediff | SELECT datediff('2009-07-31', '2009-07-30') | struct<date_diff(2009-07-31, 2009-07-30):int> | | org.apache.spark.sql.catalyst.expressions.DateDiff | datediff | SELECT datediff('2009-07-31', '2009-07-30') | struct<datediff(2009-07-31, 2009-07-30):int> | | org.apache.spark.sql.catalyst.expressions.DateFormatClass | dateformat | SELECT dateformat('2016-04-08', 'y') | struct<date_format(2016-04-08, y):string> | | org.apache.spark.sql.catalyst.expressions.DateFromUnixDate | datefromunixdate | SELECT datefromunixdate(1) | struct<datefromunix_date(1):date> | | org.apache.spark.sql.catalyst.expressions.DatePartExpressionBuilder | datepart | SELECT datepart('YEAR', TIMESTAMP '2019-08-12 01:00:00.123456') | struct<date_part(YEAR, TIMESTAMP '2019-08-12 01:00:00.123456'):int> | | org.apache.spark.sql.catalyst.expressions.DatePartExpressionBuilder | datepart | SELECT datepart('YEAR', TIMESTAMP '2019-08-12 01:00:00.123456') | struct<datepart(YEAR FROM TIMESTAMP '2019-08-12 01:00:00.123456'):int> | | org.apache.spark.sql.catalyst.expressions.DateSub | datesub | SELECT datesub('2016-07-30', 1) | struct<date_sub(2016-07-30, 1):date> | | org.apache.spark.sql.catalyst.expressions.DayName | dayname | SELECT dayname(DATE('2008-02-20')) | struct<dayname(2008-02-20):string> | | org.apache.spark.sql.catalyst.expressions.DayOfMonth | day | SELECT day('2009-07-30') | struct<day(2009-07-30):int> | |

| dayofmonth | SELECT dayofmonth('2009-07-30') | struct<dayofmonth(2009-07-30):int> | | org.apache.spark.sql.catalyst.expressions.DayOfWeek | dayofweek | SELECT dayofweek('2009-07-30') | struct<dayofweek(2009-07-30):int> | | org.apache.spark.sql.catalyst.expressions.DayOfYear | dayofyear | SELECT dayofyear('2016-04-09') | struct<dayofyear(2016-04-09):int> | | org.apache.spark.sql.catalyst.expressions.Decode | decode | SELECT decode(encode('abc', 'utf-8'), 'utf-8') | struct<decode(encode(abc, utf-8), utf-8):string> | | org.apache.spark.sql.catalyst.expressions.DenseRank | denserank | SELECT a, b, denserank(b) OVER (PARTITION BY a ORDER BY b) FROM VALUES ('A1', 2), ('A1', 1), ('A2', 3), ('A1', 1) tab(a, b) | struct<a:string,b:int,DENSE_RANK() OVER (PARTITION BY a ORDER BY b ASC NULLS FIRST ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW):int> | | org.apache.spark.sql.catalyst.expressions.Divide | / | SELECT 3 / 2 | struct<(3 / 2):double> | | org.apache.spark.sql.catalyst.expressions.ElementAt | elementat | SELECT elementat(array(1, 2, 3), 2) | struct<element_at(array(1, 2, 3), 2):int> | | org.apache.spark.sql.catalyst.expressions.Elt | elt | SELECT elt(1, 'scala', 'java') | struct<elt(1, scala, java):string> | | org.apache.spark.sql.catalyst.expressions.Encode | encode | SELECT encode('abc', 'utf-8') | struct<encode(abc, utf-8):binary> | | org.apache.spark.sql.catalyst.expressions.EndsWithExpressionBuilder | endswith | SELECT endswith('Spark SQL', 'SQL') | struct<endswith(Spark SQL, SQL):boolean> | | org.apache.spark.sql.catalyst.expressions.EqualNull | equalnull | SELECT equalnull(3, 3) | struct<equal_null(3, 3):boolean> | | org.apache.spark.sql.catalyst.expressions.EqualNullSafe | <=> | SELECT 2 <=> 2 | struct<(2 <=> 2):boolean> | | org.apache.spark.sql.catalyst.expressions.EqualTo | = | SELECT 2 = 2 | struct<(2 = 2):boolean> | | org.apache.spark.sql.catalyst.expressions.EqualTo | == | SELECT 2 == 2 | struct<(2 = 2):boolean> | | org.apache.spark.sql.catalyst.expressions.EulerNumber | e | SELECT e() | struct<E():double> | | org.apache.spark.sql.catalyst.expressions.Exp | exp | SELECT exp(0) | struct<EXP(0):double> | | org.apache.spark.sql.catalyst.expressions.ExplodeExpressionBuilder | explode | SELECT explode(array(10, 20)) | struct<col:int> | | org.apache.spark.sql.catalyst.expressions.ExplodeExpressionBuilder | explodeouter | SELECT explodeouter(array(10, 20)) | struct<col:int> | | org.apache.spark.sql.catalyst.expressions.Expm1 | expm1 | SELECT expm1(0) | struct<EXPM1(0):double> | | org.apache.spark.sql.catalyst.expressions.Extract | extract | SELECT extract(YEAR FROM TIMESTAMP '2019-08-12 01:00:00.123456') | struct<extract(YEAR FROM TIMESTAMP '2019-08-12 01:00:00.123456'):int> | | org.apache.spark.sql.catalyst.expressions.Factorial | factorial | SELECT factorial(5) | struct<factorial(5):bigint> | | org.apache.spark.sql.catalyst.expressions.FindInSet | findinset | SELECT findinset('ab','abc,b,ab,c,def') | struct<findinset(ab, abc,b,ab,c,def):int> | | org.apache.spark.sql.catalyst.expressions.Flatten | flatten | SELECT flatten(array(array(1, 2), array(3, 4))) | struct<flatten(array(array(1, 2), array(3, 4))):array<int>> | | org.apache.spark.sql.catalyst.expressions.FloorExpressionBuilder | floor | SELECT floor(-0.1) | struct<FLOOR(-0.1):decimal(1,0)> | | org.apache.spark.sql.catalyst.expressions.FormatNumber | formatnumber | SELECT formatnumber(12332.123456, 4) | struct<format_number(12332.123456, 4):string> | | org.apache.spark.sql.catalyst.expressions.FormatString | formatstring | SELECT formatstring("Hello World %d %s", 100, "days") | struct<format_string(Hello World %d %s, 100, days):string> | | org.apache.spark.sql.catalyst.expressions.FormatString | printf | SELECT printf("Hello World %d %s", 100, "days") | struct<printf(Hello World %d %s, 100, days):string> | | org.apache.spark.sql.catalyst.expressions.FromUTCTimestamp | fromutctimestamp | SELECT fromutctimestamp('2016-08-31', 'Asia/Seoul') | struct<fromutctimestamp(2016-08-31, Asia/Seoul):timestamp> | | org.apache.spark.sql.catalyst.expressions.FromUnixTime | fromunixtime | SELECT fromunixtime(0, 'yyyy-MM-dd HH:mm:ss') | struct<from_unixtime(0, yyyy-MM-dd HH:mm:ss):string> | | org.apache.spark.sql.catalyst.expressions.Get | get | SELECT get(array(1, 2, 3), 0) | struct<get(array(1, 2, 3), 0):int> | | org.apache.spark.sql.catalyst.expressions.GetJsonObject | getjsonobject | SELECT getjsonobject('{"a":"b"}', '$.a') | struct<getjsonobject({"a":"b"}, $.a):string> | | org.apache.spark.sql.catalyst.expressions.GreaterThan | > | SELECT 2 > 1 | struct<(2 > 1):boolean> | | org.apache.spark.sql.catalyst.expressions.GreaterThanOrEqual | >= | SELECT 2 >= 1 | struct<(2 >= 1):boolean> | | org.apache.spark.sql.catalyst.expressions.Greatest | greatest | SELECT greatest(10, 9, 2, 4, 3) | struct<greatest(10, 9, 2, 4, 3):int> | | org.apache.spark.sql.catalyst.expressions.Grouping | grouping | SELECT name, grouping(name), sum(age) FROM VALUES (2, 'Alice'), (5, 'Bob') people(age, name) GROUP BY cube(name) | struct<name:string,grouping(name):tinyint,sum(age):bigint> | | org.apache.spark.sql.catalyst.expressions.GroupingID | groupingid | SELECT name, groupingid(), sum(age), avg(height) FROM VALUES (2, 'Alice', 165), (5, 'Bob', 180) people(age, name, height) GROUP BY cube(name, height) | struct<name:string,grouping_id():bigint,sum(age):bigint,avg(height):double> | | org.apache.spark.sql.catalyst.expressions.Hex | hex | SELECT hex(17) | struct<hex(17):string> | | org.apache.spark.sql.catalyst.expressions.HllSketchEstimate | hllsketchestimate | SELECT hllsketchestimate(hllsketchagg(col)) FROM VALUES (1), (1), (2), (2), (3) tab(col) | struct<hllsketchestimate(hllsketchagg(col, 12)):bigint> | |

| hllunion | SELECT hllsketchestimate(hllunion(hllsketchagg(col1), hllsketchagg(col2))) FROM VALUES (1, 4), (1, 4), (2, 5), (2, 5), (3, 6) tab(col1, col2) | struct<hllsketchestimate(hllunion(hllsketchagg(col1, 12), hllsketch_agg(col2, 12), false)):bigint> | | org.apache.spark.sql.catalyst.expressions.Hour | hour | SELECT hour('2009-07-30 12:58:59') | struct<hour(2009-07-30 12:58:59):int> | | org.apache.spark.sql.catalyst.expressions.Hypot | hypot | SELECT hypot(3, 4) | struct<HYPOT(3, 4):double> | | org.apache.spark.sql.catalyst.expressions.ILike | ilike | SELECT ilike('Spark', 'Park') | struct<ilike(Spark, Park):boolean> | | org.apache.spark.sql.catalyst.expressions.If | if | SELECT if(1 < 2, 'a', 'b') | struct<(IF((1 < 2), a, b)):string> | | org.apache.spark.sql.catalyst.expressions.In | in | SELECT 1 in(1, 2, 3) | struct<(1 IN (1, 2, 3)):boolean> | | org.apache.spark.sql.catalyst.expressions.InitCap | initcap | SELECT initcap('sPark sql') | struct<initcap(sPark sql):string> | | org.apache.spark.sql.catalyst.expressions.Inline | inline | SELECT inline(array(struct(1, 'a'), struct(2, 'b'))) | struct<col1:int,col2:string> | | org.apache.spark.sql.catalyst.expressions.Inline | inlineouter | SELECT inlineouter(array(struct(1, 'a'), struct(2, 'b'))) | struct<col1:int,col2:string> | | org.apache.spark.sql.catalyst.expressions.InputFileBlockLength | inputfileblocklength | SELECT inputfileblocklength() | struct<inputfileblock_length():bigint> | | org.apache.spark.sql.catalyst.expressions.InputFileBlockStart | inputfileblockstart | SELECT inputfileblockstart() | struct<inputfileblock_start():bigint> | | org.apache.spark.sql.catalyst.expressions.InputFileName | inputfilename | SELECT inputfilename() | struct<inputfilename():string> | | org.apache.spark.sql.catalyst.expressions.IntegralDivide | div | SELECT 3 div 2 | struct<(3 div 2):bigint> | | org.apache.spark.sql.catalyst.expressions.IsNaN | isnan | SELECT isnan(cast('NaN' as double)) | struct<isnan(CAST(NaN AS DOUBLE)):boolean> | | org.apache.spark.sql.catalyst.expressions.IsNotNull | isnotnull | SELECT isnotnull(1) | struct<(1 IS NOT NULL):boolean> | | org.apache.spark.sql.catalyst.expressions.IsNull | isnull | SELECT isnull(1) | struct<(1 IS NULL):boolean> | | org.apache.spark.sql.catalyst.expressions.JsonObjectKeys | jsonobjectkeys | SELECT jsonobjectkeys('{}') | struct<jsonobjectkeys({}):array<string>> | | org.apache.spark.sql.catalyst.expressions.JsonToStructs | fromjson | SELECT fromjson('{"a":1, "b":0.8}', 'a INT, b DOUBLE') | struct<from_json({"a":1, "b":0.8}):struct<a:int,b:double>> | | org.apache.spark.sql.catalyst.expressions.JsonTuple | jsontuple | SELECT jsontuple('{"a":1, "b":2}', 'a', 'b') | struct<c0:string,c1:string> | | org.apache.spark.sql.catalyst.expressions.LPadExpressionBuilder | lpad | SELECT lpad('hi', 5, '??') | struct<lpad(hi, 5, ??):string> | | org.apache.spark.sql.catalyst.expressions.Lag | lag | SELECT a, b, lag(b) OVER (PARTITION BY a ORDER BY b) FROM VALUES ('A1', 2), ('A1', 1), ('A2', 3), ('A1', 1) tab(a, b) | struct<a:string,b:int,lag(b, 1, NULL) OVER (PARTITION BY a ORDER BY b ASC NULLS FIRST ROWS BETWEEN -1 FOLLOWING AND -1 FOLLOWING):int> | | org.apache.spark.sql.catalyst.expressions.LastDay | lastday | SELECT lastday('2009-01-12') | struct<last_day(2009-01-12):date> | | org.apache.spark.sql.catalyst.expressions.Lead | lead | SELECT a, b, lead(b) OVER (PARTITION BY a ORDER BY b) FROM VALUES ('A1', 2), ('A1', 1), ('A2', 3), ('A1', 1) tab(a, b) | struct<a:string,b:int,lead(b, 1, NULL) OVER (PARTITION BY a ORDER BY b ASC NULLS FIRST ROWS BETWEEN 1 FOLLOWING AND 1 FOLLOWING):int> | | org.apache.spark.sql.catalyst.expressions.Least | least | SELECT least(10, 9, 2, 4, 3) | struct<least(10, 9, 2, 4, 3):int> | | org.apache.spark.sql.catalyst.expressions.Left | left | SELECT left('Spark SQL', 3) | struct<left(Spark SQL, 3):string> | | org.apache.spark.sql.catalyst.expressions.Length | charlength | SELECT charlength('Spark SQL ') | struct<char_length(Spark SQL ):int> | | org.apache.spark.sql.catalyst.expressions.Length | characterlength | SELECT characterlength('Spark SQL ') | struct<character_length(Spark SQL ):int> | | org.apache.spark.sql.catalyst.expressions.Length | len | SELECT len('Spark SQL ') | struct<len(Spark SQL ):int> | | org.apache.spark.sql.catalyst.expressions.Length | length | SELECT length('Spark SQL ') | struct<length(Spark SQL ):int> | | org.apache.spark.sql.catalyst.expressions.LengthOfJsonArray | jsonarraylength | SELECT jsonarraylength('[1,2,3,4]') | struct<jsonarraylength([1,2,3,4]):int> | | org.apache.spark.sql.catalyst.expressions.LessThan | < | SELECT 1 < 2 | struct<(1 < 2):boolean> | | org.apache.spark.sql.catalyst.expressions.LessThanOrEqual | <= | SELECT 2 <= 2 | struct<(2 <= 2):boolean> | | org.apache.spark.sql.catalyst.expressions.Levenshtein | levenshtein | SELECT levenshtein('kitten', 'sitting') | struct<levenshtein(kitten, sitting):int> | | org.apache.spark.sql.catalyst.expressions.Like | like | SELECT like('Spark', 'park') | struct<Spark LIKE park:boolean> | | org.apache.spark.sql.catalyst.expressions.LocalTimestamp | localtimestamp | SELECT localtimestamp() | struct<localtimestamp():timestamp_ntz> | | org.apache.spark.sql.catalyst.expressions.Log | ln | SELECT ln(1) | struct<ln(1):double> | | org.apache.spark.sql.catalyst.expressions.Log10 | log10 | SELECT log10(10) | struct<LOG10(10):double> | | org.apache.spark.sql.catalyst.expressions.Log1p | log1p | SELECT log1p(0) | struct<LOG1P(0):double> | | org.apache.spark.sql.catalyst.expressions.Log2 | log2 | SELECT log2(2) | struct<LOG2(2):double> | |

| log | SELECT log(10, 100) | struct<LOG(10, 100):double> | | org.apache.spark.sql.catalyst.expressions.Lower | lcase | SELECT lcase('SparkSql') | struct<lcase(SparkSql):string> | | org.apache.spark.sql.catalyst.expressions.Lower | lower | SELECT lower('SparkSql') | struct<lower(SparkSql):string> | | org.apache.spark.sql.catalyst.expressions.Luhncheck | luhncheck | SELECT luhncheck('8112189876') | struct<luhn_check(8112189876):boolean> | | org.apache.spark.sql.catalyst.expressions.MakeDTInterval | makedtinterval | SELECT makedtinterval(1, 12, 30, 01.001001) | struct<makedtinterval(1, 12, 30, 1.001001):interval day to second> | | org.apache.spark.sql.catalyst.expressions.MakeDate | makedate | SELECT makedate(2013, 7, 15) | struct<make_date(2013, 7, 15):date> | | org.apache.spark.sql.catalyst.expressions.MakeInterval | makeinterval | SELECT makeinterval(100, 11, 1, 1, 12, 30, 01.001001) | struct<make_interval(100, 11, 1, 1, 12, 30, 1.001001):interval> | | org.apache.spark.sql.catalyst.expressions.MakeTimestamp | maketimestamp | SELECT maketimestamp(2014, 12, 28, 6, 30, 45.887) | struct<make_timestamp(2014, 12, 28, 6, 30, 45.887):timestamp> | | org.apache.spark.sql.catalyst.expressions.MakeTimestampLTZExpressionBuilder | maketimestampltz | SELECT maketimestampltz(2014, 12, 28, 6, 30, 45.887) | struct<maketimestampltz(2014, 12, 28, 6, 30, 45.887):timestamp> | | org.apache.spark.sql.catalyst.expressions.MakeTimestampNTZExpressionBuilder | maketimestampntz | SELECT maketimestampntz(2014, 12, 28, 6, 30, 45.887) | struct<maketimestampntz(2014, 12, 28, 6, 30, 45.887):timestamp_ntz> | | org.apache.spark.sql.catalyst.expressions.MakeYMInterval | makeyminterval | SELECT makeyminterval(1, 2) | struct<makeyminterval(1, 2):interval year to month> | | org.apache.spark.sql.catalyst.expressions.MapConcat | mapconcat | SELECT mapconcat(map(1, 'a', 2, 'b'), map(3, 'c')) | struct<map_concat(map(1, a, 2, b), map(3, c)):map<int,string>> | | org.apache.spark.sql.catalyst.expressions.MapContainsKey | mapcontainskey | SELECT mapcontainskey(map(1, 'a', 2, 'b'), 1) | struct<mapcontainskey(map(1, a, 2, b), 1):boolean> | | org.apache.spark.sql.catalyst.expressions.MapEntries | mapentries | SELECT mapentries(map(1, 'a', 2, 'b')) | struct<map_entries(map(1, a, 2, b)):array<struct<key:int,value:string>>> | | org.apache.spark.sql.catalyst.expressions.MapFilter | mapfilter | SELECT mapfilter(map(1, 0, 2, 2, 3, -1), (k, v) -> k > v) | struct<map_filter(map(1, 0, 2, 2, 3, -1), lambdafunction((namedlambdavariable() > namedlambdavariable()), namedlambdavariable(), namedlambdavariable())):map<int,int>> | | org.apache.spark.sql.catalyst.expressions.MapFromArrays | mapfromarrays | SELECT mapfromarrays(array(1.0, 3.0), array('2', '4')) | struct<mapfromarrays(array(1.0, 3.0), array(2, 4)):map<decimal(2,1),string>> | | org.apache.spark.sql.catalyst.expressions.MapFromEntries | mapfromentries | SELECT mapfromentries(array(struct(1, 'a'), struct(2, 'b'))) | struct<mapfromentries(array(struct(1, a), struct(2, b))):map<int,string>> | | org.apache.spark.sql.catalyst.expressions.MapKeys | mapkeys | SELECT mapkeys(map(1, 'a', 2, 'b')) | struct<map_keys(map(1, a, 2, b)):array<int>> | | org.apache.spark.sql.catalyst.expressions.MapValues | mapvalues | SELECT mapvalues(map(1, 'a', 2, 'b')) | struct<map_values(map(1, a, 2, b)):array<string>> | | org.apache.spark.sql.catalyst.expressions.MapZipWith | mapzipwith | SELECT mapzipwith(map(1, 'a', 2, 'b'), map(1, 'x', 2, 'y'), (k, v1, v2) -> concat(v1, v2)) | struct<mapzipwith(map(1, a, 2, b), map(1, x, 2, y), lambdafunction(concat(namedlambdavariable(), namedlambdavariable()), namedlambdavariable(), namedlambdavariable(), namedlambdavariable())):map<int,string>> | | org.apache.spark.sql.catalyst.expressions.MaskExpressionBuilder | mask | SELECT mask('abcd-EFGH-8765-4321') | struct<mask(abcd-EFGH-8765-4321, X, x, n, NULL):string> | | org.apache.spark.sql.catalyst.expressions.Md5 | md5 | SELECT md5('Spark') | struct<md5(Spark):string> | | org.apache.spark.sql.catalyst.expressions.MicrosToTimestamp | timestampmicros | SELECT timestampmicros(1230219000123123) | struct<timestamp_micros(1230219000123123):timestamp> | | org.apache.spark.sql.catalyst.expressions.MillisToTimestamp | timestampmillis | SELECT timestampmillis(1230219000123) | struct<timestamp_millis(1230219000123):timestamp> | | org.apache.spark.sql.catalyst.expressions.Minute | minute | SELECT minute('2009-07-30 12:58:59') | struct<minute(2009-07-30 12:58:59):int> | | org.apache.spark.sql.catalyst.expressions.MonotonicallyIncreasingID | monotonicallyincreasingid | SELECT monotonicallyincreasingid() | struct<monotonicallyincreasingid():bigint> | | org.apache.spark.sql.catalyst.expressions.Month | month | SELECT month('2016-07-30') | struct<month(2016-07-30):int> | | org.apache.spark.sql.catalyst.expressions.MonthName | monthname | SELECT monthname('2008-02-20') | struct<monthname(2008-02-20):string> | | org.apache.spark.sql.catalyst.expressions.MonthsBetween | monthsbetween | SELECT monthsbetween('1997-02-28 10:30:00', '1996-10-30') | struct<months_between(1997-02-28 10:30:00, 1996-10-30, true):double> | | org.apache.spark.sql.catalyst.expressions.Multiply | | SELECT 2 3 | struct<(2 * 3):int> | | org.apache.spark.sql.catalyst.expressions.Murmur3Hash | hash | SELECT hash('Spark', array(123), 2) | struct<hash(Spark, array(123), 2):int> | | org.apache.spark.sql.catalyst.expressions.NTile | ntile | SELECT a, b, ntile(2) OVER (PARTITION BY a ORDER BY b) FROM VALUES ('A1', 2), ('A1', 1), ('A2', 3), ('A1', 1) tab(a, b) | struct<a:string,b:int,ntile(2) OVER (PARTITION BY a ORDER BY b ASC NULLS FIRST ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW):int> | | org.apache.spark.sql.catalyst.expressions.NaNvl | nanvl | SELECT nanvl(cast('NaN' as double), 123) | struct<nanvl(CAST(NaN AS DOUBLE), 123):double> | | org.apache.spark.sql.catalyst.expressions.NextDay | nextday | SELECT nextday('2015-01-14', 'TU') | struct<next_day(2015-01-14, TU):date> | | org.apache.spark.sql.catalyst.expressions.Not | ! | SELECT ! true | struct<(NOT true):boolean> | | org.apache.spark.sql.catalyst.expressions.Not | not | SELECT not true | struct<(NOT true):boolean> | |

| now | SELECT now() | struct<now():timestamp> | | org.apache.spark.sql.catalyst.expressions.NthValue | nthvalue | SELECT a, b, nthvalue(b, 2) OVER (PARTITION BY a ORDER BY b) FROM VALUES ('A1', 2), ('A1', 1), ('A2', 3), ('A1', 1) tab(a, b) | struct<a:string,b:int,nth_value(b, 2) OVER (PARTITION BY a ORDER BY b ASC NULLS FIRST RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW):int> | | org.apache.spark.sql.catalyst.expressions.NullIf | nullif | SELECT nullif(2, 2) | struct<nullif(2, 2):int> | | org.apache.spark.sql.catalyst.expressions.Nvl | ifnull | SELECT ifnull(NULL, array('2')) | struct<ifnull(NULL, array(2)):array<string>> | | org.apache.spark.sql.catalyst.expressions.Nvl | nvl | SELECT nvl(NULL, array('2')) | struct<nvl(NULL, array(2)):array<string>> | | org.apache.spark.sql.catalyst.expressions.Nvl2 | nvl2 | SELECT nvl2(NULL, 2, 1) | struct<nvl2(NULL, 2, 1):int> | | org.apache.spark.sql.catalyst.expressions.OctetLength | octetlength | SELECT octetlength('Spark SQL') | struct<octet_length(Spark SQL):int> | | org.apache.spark.sql.catalyst.expressions.Or | or | SELECT true or false | struct<(true OR false):boolean> | | org.apache.spark.sql.catalyst.expressions.Overlay | overlay | SELECT overlay('Spark SQL' PLACING '' FROM 6) | struct<overlay(Spark SQL, , 6, -1):string> | | org.apache.spark.sql.catalyst.expressions.ParseToDate | todate | SELECT todate('2009-07-30 04:17:52') | struct<to_date(2009-07-30 04:17:52):date> | | org.apache.spark.sql.catalyst.expressions.ParseToTimestamp | totimestamp | SELECT totimestamp('2016-12-31 00:12:00') | struct<to_timestamp(2016-12-31 00:12:00):timestamp> | | org.apache.spark.sql.catalyst.expressions.ParseToTimestampLTZExpressionBuilder | totimestampltz | SELECT totimestampltz('2016-12-31 00:12:00') | struct<totimestampltz(2016-12-31 00:12:00):timestamp> | | org.apache.spark.sql.catalyst.expressions.ParseToTimestampNTZExpressionBuilder | totimestampntz | SELECT totimestampntz('2016-12-31 00:12:00') | struct<totimestampntz(2016-12-31 00:12:00):timestamp_ntz> | | org.apache.spark.sql.catalyst.expressions.ParseUrl | parseurl | SELECT parseurl('http://spark.apache.org/path?query=1', 'HOST') | struct<parse_url(http://spark.apache.org/path?query=1, HOST):string> | | org.apache.spark.sql.catalyst.expressions.PercentRank | percentrank | SELECT a, b, percentrank(b) OVER (PARTITION BY a ORDER BY b) FROM VALUES ('A1', 2), ('A1', 1), ('A2', 3), ('A1', 1) tab(a, b) | struct<a:string,b:int,PERCENT_RANK() OVER (PARTITION BY a ORDER BY b ASC NULLS FIRST ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW):double> | | org.apache.spark.sql.catalyst.expressions.Pi | pi | SELECT pi() | struct<PI():double> | | org.apache.spark.sql.catalyst.expressions.Pmod | pmod | SELECT pmod(10, 3) | struct<pmod(10, 3):int> | | org.apache.spark.sql.catalyst.expressions.PosExplode | posexplode | SELECT posexplode(array(10,20)) | struct<pos:int,col:int> | | org.apache.spark.sql.catalyst.expressions.PosExplode | posexplodeouter | SELECT posexplodeouter(array(10,20)) | struct<pos:int,col:int> | | org.apache.spark.sql.catalyst.expressions.Pow | pow | SELECT pow(2, 3) | struct<pow(2, 3):double> | | org.apache.spark.sql.catalyst.expressions.Pow | power | SELECT power(2, 3) | struct<POWER(2, 3):double> | | org.apache.spark.sql.catalyst.expressions.Quarter | quarter | SELECT quarter('2016-08-31') | struct<quarter(2016-08-31):int> | | org.apache.spark.sql.catalyst.expressions.RLike | regexp | SELECT regexp('%SystemDrive%\Users\John', '%SystemDrive%\\Users.') | struct<REGEXP(%SystemDrive%UsersJohn, %SystemDrive%\Users.):boolean> | | org.apache.spark.sql.catalyst.expressions.RLike | regexplike | SELECT regexplike('%SystemDrive%\Users\John', '%SystemDrive%\\Users.') | struct<REGEXP_LIKE(%SystemDrive%UsersJohn, %SystemDrive%\Users.):boolean> | | org.apache.spark.sql.catalyst.expressions.RLike | rlike | SELECT rlike('%SystemDrive%\Users\John', '%SystemDrive%\\Users.') | struct<RLIKE(%SystemDrive%UsersJohn, %SystemDrive%\Users.):boolean> | | org.apache.spark.sql.catalyst.expressions.RPadExpressionBuilder | rpad | SELECT rpad('hi', 5, '??') | struct<rpad(hi, 5, ??):string> | | org.apache.spark.sql.catalyst.expressions.RaiseErrorExpressionBuilder | raiseerror | SELECT raiseerror('custom error message') | struct<raiseerror(USERRAISED_EXCEPTION, map(errorMessage, custom error message)):void> | | org.apache.spark.sql.catalyst.expressions.Rand | rand | SELECT rand() | struct<rand():double> | | org.apache.spark.sql.catalyst.expressions.Rand | random | SELECT random() | struct<rand():double> | | org.apache.spark.sql.catalyst.expressions.Randn | randn | SELECT randn() | struct<randn():double> | | org.apache.spark.sql.catalyst.expressions.Rank | rank | SELECT a, b, rank(b) OVER (PARTITION BY a ORDER BY b) FROM VALUES ('A1', 2), ('A1', 1), ('A2', 3), ('A1', 1) tab(a, b) | struct<a:string,b:int,RANK() OVER (PARTITION BY a ORDER BY b ASC NULLS FIRST ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW):int> | | org.apache.spark.sql.catalyst.expressions.RegExpCount | regexpcount | SELECT regexpcount('Steven Jones and Stephen Smith are the best players', 'Ste(v&#124;ph)en') | struct<regexp_count(Steven Jones and Stephen Smith are the best players, Ste(v&#124;ph)en):int> | | org.apache.spark.sql.catalyst.expressions.RegExpExtract | regexpextract | SELECT regexpextract('100-200', '(\\d+)-(\\d+)', 1) | struct<regexp_extract(100-200, (\d+)-(\d+), 1):string> | | org.apache.spark.sql.catalyst.expressions.RegExpExtractAll | regexpextractall | SELECT regexpextractall('100-200, 300-400', '(\\d+)-(\\d+)', 1) | struct<regexpextractall(100-200, 300-400, (\d+)-(\d+), 1):array<string>> | | org.apache.spark.sql.catalyst.expressions.RegExpInStr | regexpinstr | SELECT regexpinstr(r"\abc", r"^\\abc$") | struct<regexp_instr(\abc, ^\\abc$, 0):int> | | org.apache.spark.sql.catalyst.expressions.RegExpReplace | regexpreplace | SELECT regexpreplace('100-200', '(\\d+)', 'num') | struct<regexp_replace(100-200, (\d+), num, 1):string> | |

| regexpsubstr | SELECT regexpsubstr('Steven Jones and Stephen Smith are the best players', 'Ste(v&#124;ph)en') | struct<regexp_substr(Steven Jones and Stephen Smith are the best players, Ste(v&#124;ph)en):string> | | org.apache.spark.sql.catalyst.expressions.Remainder | % | SELECT 2 % 1.8 | struct<(2 % 1.8):decimal(2,1)> | | org.apache.spark.sql.catalyst.expressions.Remainder | mod | SELECT 2 % 1.8 | struct<(2 % 1.8):decimal(2,1)> | | org.apache.spark.sql.catalyst.expressions.Reverse | reverse | SELECT reverse('Spark SQL') | struct<reverse(Spark SQL):string> | | org.apache.spark.sql.catalyst.expressions.Right | right | SELECT right('Spark SQL', 3) | struct<right(Spark SQL, 3):string> | | org.apache.spark.sql.catalyst.expressions.Rint | rint | SELECT rint(12.3456) | struct<rint(12.3456):double> | | org.apache.spark.sql.catalyst.expressions.Round | round | SELECT round(2.5, 0) | struct<round(2.5, 0):decimal(2,0)> | | org.apache.spark.sql.catalyst.expressions.RowNumber | rownumber | SELECT a, b, rownumber() OVER (PARTITION BY a ORDER BY b) FROM VALUES ('A1', 2), ('A1', 1), ('A2', 3), ('A1', 1) tab(a, b) | struct<a:string,b:int,row_number() OVER (PARTITION BY a ORDER BY b ASC NULLS FIRST ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW):int> | | org.apache.spark.sql.catalyst.expressions.SchemaOfCsv | schemaofcsv | SELECT schemaofcsv('1,abc') | struct<schemaofcsv(1,abc):string> | | org.apache.spark.sql.catalyst.expressions.SchemaOfJson | schemaofjson | SELECT schemaofjson('[{"col":0}]') | struct<schemaofjson([{"col":0}]):string> | | org.apache.spark.sql.catalyst.expressions.SchemaOfXml | schemaofxml | SELECT schemaofxml('<p><a>1</a></p>') | struct<schemaofxml(<p><a>1</a></p>):string> | | org.apache.spark.sql.catalyst.expressions.Sec | sec | SELECT sec(0) | struct<SEC(0):double> | | org.apache.spark.sql.catalyst.expressions.Second | second | SELECT second('2009-07-30 12:58:59') | struct<second(2009-07-30 12:58:59):int> | | org.apache.spark.sql.catalyst.expressions.SecondsToTimestamp | timestampseconds | SELECT timestampseconds(1230219000) | struct<timestamp_seconds(1230219000):timestamp> | | org.apache.spark.sql.catalyst.expressions.Sentences | sentences | SELECT sentences('Hi there! Good morning.') | struct<sentences(Hi there! Good morning., , ):array<array<string>>> | | org.apache.spark.sql.catalyst.expressions.Sequence | sequence | SELECT sequence(1, 5) | struct<sequence(1, 5):array<int>> | | org.apache.spark.sql.catalyst.expressions.SessionWindow | sessionwindow | SELECT a, sessionwindow.start, sessionwindow.end, count(*) as cnt FROM VALUES ('A1', '2021-01-01 00:00:00'), ('A1', '2021-01-01 00:04:30'), ('A1', '2021-01-01 00:10:00'), ('A2', '2021-01-01 00:01:00') AS tab(a, b) GROUP by a, sessionwindow(b, '5 minutes') ORDER BY a, start | struct<a:string,start:timestamp,end:timestamp,cnt:bigint> | | org.apache.spark.sql.catalyst.expressions.Sha1 | sha | SELECT sha('Spark') | struct<sha(Spark):string> | | org.apache.spark.sql.catalyst.expressions.Sha1 | sha1 | SELECT sha1('Spark') | struct<sha1(Spark):string> | | org.apache.spark.sql.catalyst.expressions.Sha2 | sha2 | SELECT sha2('Spark', 256) | struct<sha2(Spark, 256):string> | | org.apache.spark.sql.catalyst.expressions.ShiftLeft | shiftleft | SELECT shiftleft(2, 1) | struct<shiftleft(2, 1):int> | | org.apache.spark.sql.catalyst.expressions.ShiftRight | shiftright | SELECT shiftright(4, 1) | struct<shiftright(4, 1):int> | | org.apache.spark.sql.catalyst.expressions.ShiftRightUnsigned | shiftrightunsigned | SELECT shiftrightunsigned(4, 1) | struct<shiftrightunsigned(4, 1):int> | | org.apache.spark.sql.catalyst.expressions.Shuffle | shuffle | SELECT shuffle(array(1, 20, 3, 5)) | struct<shuffle(array(1, 20, 3, 5)):array<int>> | | org.apache.spark.sql.catalyst.expressions.Signum | sign | SELECT sign(40) | struct<sign(40):double> | | org.apache.spark.sql.catalyst.expressions.Signum | signum | SELECT signum(40) | struct<SIGNUM(40):double> | | org.apache.spark.sql.catalyst.expressions.Sin | sin | SELECT sin(0) | struct<SIN(0):double> | | org.apache.spark.sql.catalyst.expressions.Sinh | sinh | SELECT sinh(0) | struct<SINH(0):double> | | org.apache.spark.sql.catalyst.expressions.Size | cardinality | SELECT cardinality(array('b', 'd', 'c', 'a')) | struct<cardinality(array(b, d, c, a)):int> | | org.apache.spark.sql.catalyst.expressions.Size | size | SELECT size(array('b', 'd', 'c', 'a')) | struct<size(array(b, d, c, a)):int> | | org.apache.spark.sql.catalyst.expressions.Slice | slice | SELECT slice(array(1, 2, 3, 4), 2, 2) | struct<slice(array(1, 2, 3, 4), 2, 2):array<int>> | | org.apache.spark.sql.catalyst.expressions.SortArray | sortarray | SELECT sortarray(array('b', 'd', null, 'c', 'a'), true) | struct<sort_array(array(b, d, NULL, c, a), true):array<string>> | | org.apache.spark.sql.catalyst.expressions.SoundEx | soundex | SELECT soundex('Miller') | struct<soundex(Miller):string> | | org.apache.spark.sql.catalyst.expressions.SparkPartitionID | sparkpartitionid | SELECT sparkpartitionid() | struct<SPARKPARTITIONID():int> | | org.apache.spark.sql.catalyst.expressions.SparkVersion | version | SELECT version() | struct<version():string> | | org.apache.spark.sql.catalyst.expressions.SplitPart | splitpart | SELECT splitpart('11.12.13', '.', 3) | struct<split_part(11.12.13, ., 3):string> | | org.apache.spark.sql.catalyst.expressions.Sqrt | sqrt | SELECT sqrt(4) | struct<SQRT(4):double> | | org.apache.spark.sql.catalyst.expressions.Stack | stack | SELECT stack(2, 1, 2, 3) | struct<col0:int,col1:int> | | org.apache.spark.sql.catalyst.expressions.StartsWithExpressionBuilder | startswith | SELECT startswith('Spark SQL', 'Spark') | struct<startswith(Spark SQL, Spark):boolean> | | org.apache.spark.sql.catalyst.expressions.StringInstr | instr | SELECT instr('SparkSQL', 'SQL') | struct<instr(SparkSQL, SQL):int> | | org.apache.spark.sql.catalyst.expressions.StringLocate | locate | SELECT locate('bar', 'foobarbar') | struct<locate(bar, foobarbar, 1):int> | |

| position | SELECT position('bar', 'foobarbar') | struct<position(bar, foobarbar, 1):int> | | org.apache.spark.sql.catalyst.expressions.StringRepeat | repeat | SELECT repeat('123', 2) | struct<repeat(123, 2):string> | | org.apache.spark.sql.catalyst.expressions.StringReplace | replace | SELECT replace('ABCabc', 'abc', 'DEF') | struct<replace(ABCabc, abc, DEF):string> | | org.apache.spark.sql.catalyst.expressions.StringSpace | space | SELECT concat(space(2), '1') | struct<concat(space(2), 1):string> | | org.apache.spark.sql.catalyst.expressions.StringSplit | split | SELECT split('oneAtwoBthreeC', '[ABC]') | struct<split(oneAtwoBthreeC, [ABC], -1):array<string>> | | org.apache.spark.sql.catalyst.expressions.StringToMap | strtomap | SELECT strtomap('a:1,b:2,c:3', ',', ':') | struct<strtomap(a:1,b:2,c:3, ,, :):map<string,string>> | | org.apache.spark.sql.catalyst.expressions.StringTranslate | translate | SELECT translate('AaBbCc', 'abc', '123') | struct<translate(AaBbCc, abc, 123):string> | | org.apache.spark.sql.catalyst.expressions.StringTrim | trim | SELECT trim(' SparkSQL ') | struct<trim( SparkSQL ):string> | | org.apache.spark.sql.catalyst.expressions.StringTrimBoth | btrim | SELECT btrim(' SparkSQL ') | struct<btrim( SparkSQL ):string> | | org.apache.spark.sql.catalyst.expressions.StringTrimLeft | ltrim | SELECT ltrim(' SparkSQL ') | struct<ltrim( SparkSQL ):string> | | org.apache.spark.sql.catalyst.expressions.StringTrimRight | rtrim | SELECT rtrim(' SparkSQL ') | struct<rtrim( SparkSQL ):string> | | org.apache.spark.sql.catalyst.expressions.StructsToCsv | tocsv | SELECT tocsv(namedstruct('a', 1, 'b', 2)) | struct<tocsv(named_struct(a, 1, b, 2)):string> | | org.apache.spark.sql.catalyst.expressions.StructsToJson | tojson | SELECT tojson(namedstruct('a', 1, 'b', 2)) | struct<tojson(named_struct(a, 1, b, 2)):string> | | org.apache.spark.sql.catalyst.expressions.StructsToXml | toxml | SELECT toxml(namedstruct('a', 1, 'b', 2)) | struct<toxml(named_struct(a, 1, b, 2)):string> | | org.apache.spark.sql.catalyst.expressions.Substring | substr | SELECT substr('Spark SQL', 5) | struct<substr(Spark SQL, 5, 2147483647):string> | | org.apache.spark.sql.catalyst.expressions.Substring | substring | SELECT substring('Spark SQL', 5) | struct<substring(Spark SQL, 5, 2147483647):string> | | org.apache.spark.sql.catalyst.expressions.SubstringIndex | substringindex | SELECT substringindex('www.apache.org', '.', 2) | struct<substring_index(www.apache.org, ., 2):string> | | org.apache.spark.sql.catalyst.expressions.Subtract | - | SELECT 2 - 1 | struct<(2 - 1):int> | | org.apache.spark.sql.catalyst.expressions.Tan | tan | SELECT tan(0) | struct<TAN(0):double> | | org.apache.spark.sql.catalyst.expressions.Tanh | tanh | SELECT tanh(0) | struct<TANH(0):double> | | org.apache.spark.sql.catalyst.expressions.TimeWindow | window | SELECT a, window.start, window.end, count(*) as cnt FROM VALUES ('A1', '2021-01-01 00:00:00'), ('A1', '2021-01-01 00:04:30'), ('A1', '2021-01-01 00:06:00'), ('A2', '2021-01-01 00:01:00') AS tab(a, b) GROUP by a, window(b, '5 minutes') ORDER BY a, start | struct<a:string,start:timestamp,end:timestamp,cnt:bigint> | | org.apache.spark.sql.catalyst.expressions.ToBinary | tobinary | SELECT tobinary('abc', 'utf-8') | struct<to_binary(abc, utf-8):binary> | | org.apache.spark.sql.catalyst.expressions.ToCharacterBuilder | tochar | SELECT tochar(454, '999') | struct<to_char(454, 999):string> | | org.apache.spark.sql.catalyst.expressions.ToCharacterBuilder | tovarchar | SELECT tovarchar(454, '999') | struct<to_char(454, 999):string> | | org.apache.spark.sql.catalyst.expressions.ToDegrees | degrees | SELECT degrees(3.141592653589793) | struct<DEGREES(3.141592653589793):double> | | org.apache.spark.sql.catalyst.expressions.ToNumber | tonumber | SELECT tonumber('454', '999') | struct<to_number(454, 999):decimal(3,0)> | | org.apache.spark.sql.catalyst.expressions.ToRadians | radians | SELECT radians(180) | struct<RADIANS(180):double> | | org.apache.spark.sql.catalyst.expressions.ToUTCTimestamp | toutctimestamp | SELECT toutctimestamp('2016-08-31', 'Asia/Seoul') | struct<toutctimestamp(2016-08-31, Asia/Seoul):timestamp> | | org.apache.spark.sql.catalyst.expressions.ToUnixTimestamp | tounixtimestamp | SELECT tounixtimestamp('2016-04-08', 'yyyy-MM-dd') | struct<tounixtimestamp(2016-04-08, yyyy-MM-dd):bigint> | | org.apache.spark.sql.catalyst.expressions.TransformKeys | transformkeys | SELECT transformkeys(mapfromarrays(array(1, 2, 3), array(1, 2, 3)), (k, v) -> k + 1) | struct<transformkeys(mapfrom_arrays(array(1, 2, 3), array(1, 2, 3)), lambdafunction((namedlambdavariable() + 1), namedlambdavariable(), namedlambdavariable())):map<int,int>> | | org.apache.spark.sql.catalyst.expressions.TransformValues | transformvalues | SELECT transformvalues(mapfromarrays(array(1, 2, 3), array(1, 2, 3)), (k, v) -> v + 1) | struct<transformvalues(mapfrom_arrays(array(1, 2, 3), array(1, 2, 3)), lambdafunction((namedlambdavariable() + 1), namedlambdavariable(), namedlambdavariable())):map<int,int>> | | org.apache.spark.sql.catalyst.expressions.TruncDate | trunc | SELECT trunc('2019-08-04', 'week') | struct<trunc(2019-08-04, week):date> | | org.apache.spark.sql.catalyst.expressions.TruncTimestamp | datetrunc | SELECT datetrunc('YEAR', '2015-03-05T09:32:05.359') | struct<date_trunc(YEAR, 2015-03-05T09:32:05.359):timestamp> | | org.apache.spark.sql.catalyst.expressions.TryAdd | tryadd | SELECT tryadd(1, 2) | struct<try_add(1, 2):int> | | org.apache.spark.sql.catalyst.expressions.TryAesDecrypt | tryaesdecrypt | SELECT tryaesdecrypt(unhex('6E7CA17BBB468D3084B5744BCA729FB7B2B7BCB8E4472847D02670489D95FA97DBBA7D3210'), '0000111122223333', 'GCM') | struct<tryaesdecrypt(unhex(6E7CA17BBB468D3084B5744BCA729FB7B2B7BCB8E4472847D02670489D95FA97DBBA7D3210), 0000111122223333, GCM, DEFAULT, ):binary> | | org.apache.spark.sql.catalyst.expressions.TryDivide | trydivide | SELECT trydivide(3, 2) | struct<try_divide(3, 2):double> | | org.apache.spark.sql.catalyst.expressions.TryElementAt | tryelementat | SELECT tryelementat(array(1, 2, 3), 2) | struct<tryelementat(array(1, 2, 3), 2):int> | | org.apache.spark.sql.catalyst.expressions.TryMultiply | trymultiply | SELECT trymultiply(2, 3) | struct<try_multiply(2, 3):int> | | org.apache.spark.sql.catalyst.expressions.TryReflect | tryreflect | SELECT tryreflect('java.util.UUID', 'randomUUID') | struct<try_reflect(java.util.UUID, randomUUID):string> | |

| tryremainder | SELECT tryremainder(3, 2) | struct<try_remainder(3, 2):int> | | org.apache.spark.sql.catalyst.expressions.TrySubtract | trysubtract | SELECT trysubtract(2, 1) | struct<try_subtract(2, 1):int> | | org.apache.spark.sql.catalyst.expressions.TryToBinary | trytobinary | SELECT trytobinary('abc', 'utf-8') | struct<trytobinary(abc, utf-8):binary> | | org.apache.spark.sql.catalyst.expressions.TryToNumber | trytonumber | SELECT trytonumber('454', '999') | struct<trytonumber(454, 999):decimal(3,0)> | | org.apache.spark.sql.catalyst.expressions.TryToTimestampExpressionBuilder | trytotimestamp | SELECT trytotimestamp('2016-12-31 00:12:00') | struct<trytotimestamp(2016-12-31 00:12:00):timestamp> | | org.apache.spark.sql.catalyst.expressions.TypeOf | typeof | SELECT typeof(1) | struct<typeof(1):string> | | org.apache.spark.sql.catalyst.expressions.UnBase64 | unbase64 | SELECT unbase64('U3BhcmsgU1FM') | struct<unbase64(U3BhcmsgU1FM):binary> | | org.apache.spark.sql.catalyst.expressions.UnaryMinus | negative | SELECT negative(1) | struct<negative(1):int> | | org.apache.spark.sql.catalyst.expressions.UnaryPositive | positive | SELECT positive(1) | struct<(+ 1):int> | | org.apache.spark.sql.catalyst.expressions.Unhex | unhex | SELECT decode(unhex('537061726B2053514C'), 'UTF-8') | struct<decode(unhex(537061726B2053514C), UTF-8):string> | | org.apache.spark.sql.catalyst.expressions.UnixDate | unixdate | SELECT unixdate(DATE("1970-01-02")) | struct<unix_date(1970-01-02):int> | | org.apache.spark.sql.catalyst.expressions.UnixMicros | unixmicros | SELECT unixmicros(TIMESTAMP('1970-01-01 00:00:01Z')) | struct<unix_micros(1970-01-01 00:00:01Z):bigint> | | org.apache.spark.sql.catalyst.expressions.UnixMillis | unixmillis | SELECT unixmillis(TIMESTAMP('1970-01-01 00:00:01Z')) | struct<unix_millis(1970-01-01 00:00:01Z):bigint> | | org.apache.spark.sql.catalyst.expressions.UnixSeconds | unixseconds | SELECT unixseconds(TIMESTAMP('1970-01-01 00:00:01Z')) | struct<unix_seconds(1970-01-01 00:00:01Z):bigint> | | org.apache.spark.sql.catalyst.expressions.UnixTimestamp | unixtimestamp | SELECT unixtimestamp() | struct<unixtimestamp(currenttimestamp(), yyyy-MM-dd HH:mm:ss):bigint> | | org.apache.spark.sql.catalyst.expressions.Upper | ucase | SELECT ucase('SparkSql') | struct<ucase(SparkSql):string> | | org.apache.spark.sql.catalyst.expressions.Upper | upper | SELECT upper('SparkSql') | struct<upper(SparkSql):string> | | org.apache.spark.sql.catalyst.expressions.UrlDecode | urldecode | SELECT urldecode('https%3A%2F%2Fspark.apache.org') | struct<url_decode(https%3A%2F%2Fspark.apache.org):string> | | org.apache.spark.sql.catalyst.expressions.UrlEncode | urlencode | SELECT urlencode('https://spark.apache.org') | struct<url_encode(https://spark.apache.org):string> | | org.apache.spark.sql.catalyst.expressions.Uuid | uuid | SELECT uuid() | struct<uuid():string> | | org.apache.spark.sql.catalyst.expressions.WeekDay | weekday | SELECT weekday('2009-07-30') | struct<weekday(2009-07-30):int> | | org.apache.spark.sql.catalyst.expressions.WeekOfYear | weekofyear | SELECT weekofyear('2008-02-20') | struct<weekofyear(2008-02-20):int> | | org.apache.spark.sql.catalyst.expressions.WidthBucket | widthbucket | SELECT widthbucket(5.3, 0.2, 10.6, 5) | struct<width_bucket(5.3, 0.2, 10.6, 5):bigint> | | org.apache.spark.sql.catalyst.expressions.WindowTime | windowtime | SELECT a, window.start as start, window.end as end, windowtime(window), cnt FROM (SELECT a, window, count(*) as cnt FROM VALUES ('A1', '2021-01-01 00:00:00'), ('A1', '2021-01-01 00:04:30'), ('A1', '2021-01-01 00:06:00'), ('A2', '2021-01-01 00:01:00') AS tab(a, b) GROUP by a, window(b, '5 minutes') ORDER BY a, window.start) | struct<a:string,start:timestamp,end:timestamp,window_time(window):timestamp,cnt:bigint> | | org.apache.spark.sql.catalyst.expressions.XmlToStructs | fromxml | SELECT fromxml('<p><a>1</a><b>0.8</b></p>', 'a INT, b DOUBLE') | struct<from_xml(<p><a>1</a><b>0.8</b></p>):struct<a:int,b:double>> | | org.apache.spark.sql.catalyst.expressions.XxHash64 | xxhash64 | SELECT xxhash64('Spark', array(123), 2) | struct<xxhash64(Spark, array(123), 2):bigint> | | org.apache.spark.sql.catalyst.expressions.Year | year | SELECT year('2016-07-30') | struct<year(2016-07-30):int> | | org.apache.spark.sql.catalyst.expressions.ZipWith | zipwith | SELECT zipwith(array(1, 2, 3), array('a', 'b', 'c'), (x, y) -> (y, x)) | struct<zipwith(array(1, 2, 3), array(a, b, c), lambdafunction(namedstruct(y, namedlambdavariable(), x, namedlambdavariable()), namedlambdavariable(), namedlambdavariable())):array<struct<y:string,x:int>>> | | org.apache.spark.sql.catalyst.expressions.aggregate.AnyValue | anyvalue | SELECT anyvalue(col) FROM VALUES (10), (5), (20) AS tab(col) | struct<any_value(col):int> | | org.apache.spark.sql.catalyst.expressions.aggregate.ApproximatePercentile | approxpercentile | SELECT approxpercentile(col, array(0.5, 0.4, 0.1), 100) FROM VALUES (0), (1), (2), (10) AS tab(col) | struct<approx_percentile(col, array(0.5, 0.4, 0.1), 100):array<int>> | | org.apache.spark.sql.catalyst.expressions.aggregate.ApproximatePercentile | percentileapprox | SELECT percentileapprox(col, array(0.5, 0.4, 0.1), 100) FROM VALUES (0), (1), (2), (10) AS tab(col) | struct<percentile_approx(col, array(0.5, 0.4, 0.1), 100):array<int>> | | org.apache.spark.sql.catalyst.expressions.aggregate.Average | avg | SELECT avg(col) FROM VALUES (1), (2), (3) AS tab(col) | struct<avg(col):double> | | org.apache.spark.sql.catalyst.expressions.aggregate.Average | mean | SELECT mean(col) FROM VALUES (1), (2), (3) AS tab(col) | struct<mean(col):double> | | org.apache.spark.sql.catalyst.expressions.aggregate.BitAndAgg | bitand | SELECT bitand(col) FROM VALUES (3), (5) AS tab(col) | struct<bit_and(col):int> | | org.apache.spark.sql.catalyst.expressions.aggregate.BitOrAgg | bitor | SELECT bitor(col) FROM VALUES (3), (5) AS tab(col) | struct<bit_or(col):int> | | org.apache.spark.sql.catalyst.expressions.aggregate.BitXorAgg | bitxor | SELECT bitxor(col) FROM VALUES (3), (5) AS tab(col) | struct<bit_xor(col):int> | | org.apache.spark.sql.catalyst.expressions.aggregate.BoolAnd | booland | SELECT booland(col) FROM VALUES (true), (true), (true) AS tab(col) | struct<bool_and(col):boolean> | | org.apache.spark.sql.catalyst.expressions.aggregate.BoolAnd | every | SELECT every(col) FROM VALUES (true), (true), (true) AS tab(col) | struct<every(col):boolean> | | org.apache.spark.sql.catalyst.expressions.aggregate.BoolOr | any | SELECT any(col) FROM VALUES (true), (false), (false) AS tab(col) | struct<any(col):boolean> | |

| boolor | SELECT boolor(col) FROM VALUES (true), (false), (false) AS tab(col) | struct<bool_or(col):boolean> | | org.apache.spark.sql.catalyst.expressions.aggregate.BoolOr | some | SELECT some(col) FROM VALUES (true), (false), (false) AS tab(col) | struct<some(col):boolean> | | org.apache.spark.sql.catalyst.expressions.aggregate.CollectList | arrayagg | SELECT arrayagg(col) FROM VALUES (1), (2), (1) AS tab(col) | struct<collect_list(col):array<int>> | | org.apache.spark.sql.catalyst.expressions.aggregate.CollectList | collectlist | SELECT collectlist(col) FROM VALUES (1), (2), (1) AS tab(col) | struct<collect_list(col):array<int>> | | org.apache.spark.sql.catalyst.expressions.aggregate.CollectSet | collectset | SELECT collectset(col) FROM VALUES (1), (2), (1) AS tab(col) | struct<collect_set(col):array<int>> | | org.apache.spark.sql.catalyst.expressions.aggregate.Corr | corr | SELECT corr(c1, c2) FROM VALUES (3, 2), (3, 3), (6, 4) as tab(c1, c2) | struct<corr(c1, c2):double> | | org.apache.spark.sql.catalyst.expressions.aggregate.Count | count | SELECT count(*) FROM VALUES (NULL), (5), (5), (20) AS tab(col) | struct<count(1):bigint> | | org.apache.spark.sql.catalyst.expressions.aggregate.CountIf | countif | SELECT countif(col % 2 = 0) FROM VALUES (NULL), (0), (1), (2), (3) AS tab(col) | struct<count_if(((col % 2) = 0)):bigint> | | org.apache.spark.sql.catalyst.expressions.aggregate.CountMinSketchAggExpressionBuilder | countminsketch | SELECT hex(countminsketch(col, 0.5d, 0.5d, 1)) FROM VALUES (1), (2), (1) AS tab(col) | struct<hex(countminsketch(col, 0.5, 0.5, 1)):string> | | org.apache.spark.sql.catalyst.expressions.aggregate.CovPopulation | covarpop | SELECT covarpop(c1, c2) FROM VALUES (1,1), (2,2), (3,3) AS tab(c1, c2) | struct<covar_pop(c1, c2):double> | | org.apache.spark.sql.catalyst.expressions.aggregate.CovSample | covarsamp | SELECT covarsamp(c1, c2) FROM VALUES (1,1), (2,2), (3,3) AS tab(c1, c2) | struct<covar_samp(c1, c2):double> | | org.apache.spark.sql.catalyst.expressions.aggregate.First | first | SELECT first(col) FROM VALUES (10), (5), (20) AS tab(col) | struct<first(col):int> | | org.apache.spark.sql.catalyst.expressions.aggregate.First | firstvalue | SELECT firstvalue(col) FROM VALUES (10), (5), (20) AS tab(col) | struct<first_value(col):int> | | org.apache.spark.sql.catalyst.expressions.aggregate.HistogramNumeric | histogramnumeric | SELECT histogramnumeric(col, 5) FROM VALUES (0), (1), (2), (10) AS tab(col) | struct<histogram_numeric(col, 5):array<struct<x:int,y:double>>> | | org.apache.spark.sql.catalyst.expressions.aggregate.HllSketchAgg | hllsketchagg | SELECT hllsketchestimate(hllsketchagg(col, 12)) FROM VALUES (1), (1), (2), (2), (3) tab(col) | struct<hllsketchestimate(hllsketchagg(col, 12)):bigint> | | org.apache.spark.sql.catalyst.expressions.aggregate.HllUnionAgg | hllunionagg | SELECT hllsketchestimate(hllunionagg(sketch, true)) FROM (SELECT hllsketchagg(col) as sketch FROM VALUES (1) tab(col) UNION ALL SELECT hllsketchagg(col, 20) as sketch FROM VALUES (1) tab(col)) | struct<hllsketchestimate(hllunionagg(sketch, true)):bigint> | | org.apache.spark.sql.catalyst.expressions.aggregate.HyperLogLogPlusPlus | approxcountdistinct | SELECT approxcountdistinct(col1) FROM VALUES (1), (1), (2), (2), (3) tab(col1) | struct<approxcountdistinct(col1):bigint> | | org.apache.spark.sql.catalyst.expressions.aggregate.Kurtosis | kurtosis | SELECT kurtosis(col) FROM VALUES (-10), (-20), (100), (1000) AS tab(col) | struct<kurtosis(col):double> | | org.apache.spark.sql.catalyst.expressions.aggregate.Last | last | SELECT last(col) FROM VALUES (10), (5), (20) AS tab(col) | struct<last(col):int> | | org.apache.spark.sql.catalyst.expressions.aggregate.Last | lastvalue | SELECT lastvalue(col) FROM VALUES (10), (5), (20) AS tab(col) | struct<last_value(col):int> | | org.apache.spark.sql.catalyst.expressions.aggregate.Max | max | SELECT max(col) FROM VALUES (10), (50), (20) AS tab(col) | struct<max(col):int> | | org.apache.spark.sql.catalyst.expressions.aggregate.MaxBy | maxby | SELECT maxby(x, y) FROM VALUES ('a', 10), ('b', 50), ('c', 20) AS tab(x, y) | struct<max_by(x, y):string> | | org.apache.spark.sql.catalyst.expressions.aggregate.Median | median | SELECT median(col) FROM VALUES (0), (10) AS tab(col) | struct<median(col):double> | | org.apache.spark.sql.catalyst.expressions.aggregate.Min | min | SELECT min(col) FROM VALUES (10), (-1), (20) AS tab(col) | struct<min(col):int> | | org.apache.spark.sql.catalyst.expressions.aggregate.MinBy | minby | SELECT minby(x, y) FROM VALUES ('a', 10), ('b', 50), ('c', 20) AS tab(x, y) | struct<min_by(x, y):string> | | org.apache.spark.sql.catalyst.expressions.aggregate.ModeBuilder | mode | SELECT mode(col) FROM VALUES (0), (10), (10) AS tab(col) | struct<mode(col):int> | | org.apache.spark.sql.catalyst.expressions.aggregate.Percentile | percentile | SELECT percentile(col, 0.3) FROM VALUES (0), (10) AS tab(col) | struct<percentile(col, 0.3, 1):double> | | org.apache.spark.sql.catalyst.expressions.aggregate.PercentileContBuilder | percentilecont | SELECT percentilecont(0.25) WITHIN GROUP (ORDER BY col) FROM VALUES (0), (10) AS tab(col) | struct<percentile_cont(0.25) WITHIN GROUP (ORDER BY col):double> | | org.apache.spark.sql.catalyst.expressions.aggregate.PercentileDiscBuilder | percentiledisc | SELECT percentiledisc(0.25) WITHIN GROUP (ORDER BY col) FROM VALUES (0), (10) AS tab(col) | struct<percentile_disc(0.25) WITHIN GROUP (ORDER BY col):double> | |

| regravgx | SELECT regravgx(y, x) FROM VALUES (1, 2), (2, 2), (2, 3), (2, 4) AS tab(y, x) | struct<regr_avgx(y, x):double> | | org.apache.spark.sql.catalyst.expressions.aggregate.RegrAvgY | regravgy | SELECT regravgy(y, x) FROM VALUES (1, 2), (2, 2), (2, 3), (2, 4) AS tab(y, x) | struct<regr_avgy(y, x):double> | | org.apache.spark.sql.catalyst.expressions.aggregate.RegrCount | regrcount | SELECT regrcount(y, x) FROM VALUES (1, 2), (2, 2), (2, 3), (2, 4) AS tab(y, x) | struct<regr_count(y, x):bigint> | | org.apache.spark.sql.catalyst.expressions.aggregate.RegrIntercept | regrintercept | SELECT regrintercept(y, x) FROM VALUES (1,1), (2,2), (3,3) AS tab(y, x) | struct<regr_intercept(y, x):double> | | org.apache.spark.sql.catalyst.expressions.aggregate.RegrR2 | regrr2 | SELECT regrr2(y, x) FROM VALUES (1, 2), (2, 2), (2, 3), (2, 4) AS tab(y, x) | struct<regr_r2(y, x):double> | | org.apache.spark.sql.catalyst.expressions.aggregate.RegrSXX | regrsxx | SELECT regrsxx(y, x) FROM VALUES (1, 2), (2, 2), (2, 3), (2, 4) AS tab(y, x) | struct<regr_sxx(y, x):double> | | org.apache.spark.sql.catalyst.expressions.aggregate.RegrSXY | regrsxy | SELECT regrsxy(y, x) FROM VALUES (1, 2), (2, 2), (2, 3), (2, 4) AS tab(y, x) | struct<regr_sxy(y, x):double> | | org.apache.spark.sql.catalyst.expressions.aggregate.RegrSYY | regrsyy | SELECT regrsyy(y, x) FROM VALUES (1, 2), (2, 2), (2, 3), (2, 4) AS tab(y, x) | struct<regr_syy(y, x):double> | | org.apache.spark.sql.catalyst.expressions.aggregate.RegrSlope | regrslope | SELECT regrslope(y, x) FROM VALUES (1,1), (2,2), (3,3) AS tab(y, x) | struct<regr_slope(y, x):double> | | org.apache.spark.sql.catalyst.expressions.aggregate.Skewness | skewness | SELECT skewness(col) FROM VALUES (-10), (-20), (100), (1000) AS tab(col) | struct<skewness(col):double> | | org.apache.spark.sql.catalyst.expressions.aggregate.StddevPop | stddevpop | SELECT stddevpop(col) FROM VALUES (1), (2), (3) AS tab(col) | struct<stddev_pop(col):double> | | org.apache.spark.sql.catalyst.expressions.aggregate.StddevSamp | std | SELECT std(col) FROM VALUES (1), (2), (3) AS tab(col) | struct<std(col):double> | | org.apache.spark.sql.catalyst.expressions.aggregate.StddevSamp | stddev | SELECT stddev(col) FROM VALUES (1), (2), (3) AS tab(col) | struct<stddev(col):double> | | org.apache.spark.sql.catalyst.expressions.aggregate.StddevSamp | stddevsamp | SELECT stddevsamp(col) FROM VALUES (1), (2), (3) AS tab(col) | struct<stddev_samp(col):double> | | org.apache.spark.sql.catalyst.expressions.aggregate.Sum | sum | SELECT sum(col) FROM VALUES (5), (10), (15) AS tab(col) | struct<sum(col):bigint> | | org.apache.spark.sql.catalyst.expressions.aggregate.TryAverageExpressionBuilder | tryavg | SELECT tryavg(col) FROM VALUES (1), (2), (3) AS tab(col) | struct<try_avg(col):double> | | org.apache.spark.sql.catalyst.expressions.aggregate.TrySumExpressionBuilder | trysum | SELECT trysum(col) FROM VALUES (5), (10), (15) AS tab(col) | struct<try_sum(col):bigint> | | org.apache.spark.sql.catalyst.expressions.aggregate.VariancePop | varpop | SELECT varpop(col) FROM VALUES (1), (2), (3) AS tab(col) | struct<var_pop(col):double> | | org.apache.spark.sql.catalyst.expressions.aggregate.VarianceSamp | varsamp | SELECT varsamp(col) FROM VALUES (1), (2), (3) AS tab(col) | struct<var_samp(col):double> | | org.apache.spark.sql.catalyst.expressions.aggregate.VarianceSamp | variance | SELECT variance(col) FROM VALUES (1), (2), (3) AS tab(col) | struct<variance(col):double> | | org.apache.spark.sql.catalyst.expressions.variant.IsVariantNull | isvariantnull | SELECT isvariantnull(parsejson('null')) | struct<isvariantnull(parsejson(null)):boolean> | | org.apache.spark.sql.catalyst.expressions.variant.ParseJsonExpressionBuilder | parsejson | SELECT parsejson('{"a":1,"b":0.8}') | struct<parse_json({"a":1,"b":0.8}):variant> | | org.apache.spark.sql.catalyst.expressions.variant.SchemaOfVariant | schemaofvariant | SELECT schemaofvariant(parsejson('null')) | struct<schemaofvariant(parsejson(null)):string> | | org.apache.spark.sql.catalyst.expressions.variant.SchemaOfVariantAgg | schemaofvariantagg | SELECT schemaofvariantagg(parsejson(j)) FROM VALUES ('1'), ('2'), ('3') AS tab(j) | struct<schemaofvariantagg(parse_json(j)):string> | | org.apache.spark.sql.catalyst.expressions.variant.TryParseJsonExpressionBuilder | tryparsejson | SELECT tryparsejson('{"a":1,"b":0.8}') | struct<tryparsejson({"a":1,"b":0.8}):variant> | | org.apache.spark.sql.catalyst.expressions.variant.TryVariantGetExpressionBuilder | tryvariantget | SELECT tryvariantget(parsejson('{"a": 1}'), '$.a', 'int') | struct<tryvariantget(parsejson({"a": 1}), $.a):int> | | org.apache.spark.sql.catalyst.expressions.variant.VariantGetExpressionBuilder | variantget | SELECT variantget(parsejson('{"a": 1}'), '$.a', 'int') | struct<variantget(parse_json({"a": 1}), $.a):int> | | org.apache.spark.sql.catalyst.expressions.xml.XPathBoolean | xpathboolean | SELECT xpathboolean('<a><b>1</b></a>','a/b') | struct<xpath_boolean(<a><b>1</b></a>, a/b):boolean> | | org.apache.spark.sql.catalyst.expressions.xml.XPathDouble | xpathdouble | SELECT xpathdouble('<a><b>1</b><b>2</b></a>', 'sum(a/b)') | struct<xpath_double(<a><b>1</b><b>2</b></a>, sum(a/b)):double> | | org.apache.spark.sql.catalyst.expressions.xml.XPathDouble | xpathnumber | SELECT xpathnumber('<a><b>1</b><b>2</b></a>', 'sum(a/b)') | struct<xpath_number(<a><b>1</b><b>2</b></a>, sum(a/b)):double> | | org.apache.spark.sql.catalyst.expressions.xml.XPathFloat | xpathfloat | SELECT xpathfloat('<a><b>1</b><b>2</b></a>', 'sum(a/b)') | struct<xpath_float(<a><b>1</b><b>2</b></a>, sum(a/b)):float> | | org.apache.spark.sql.catalyst.expressions.xml.XPathInt | xpathint | SELECT xpathint('<a><b>1</b><b>2</b></a>', 'sum(a/b)') | struct<xpath_int(<a><b>1</b><b>2</b></a>, sum(a/b)):int> | | org.apache.spark.sql.catalyst.expressions.xml.XPathList | xpath | SELECT xpath('<a><b>b1</b><b>b2</b><b>b3</b><c>c1</c><c>c2</c></a>','a/b/text()') | struct<xpath(<a><b>b1</b><b>b2</b><b>b3</b><c>c1</c><c>c2</c></a>, a/b/text()):array<string>> | | org.apache.spark.sql.catalyst.expressions.xml.XPathLong | xpathlong | SELECT xpathlong('<a><b>1</b><b>2</b></a>', 'sum(a/b)') | struct<xpath_long(<a><b>1</b><b>2</b></a>, sum(a/b)):bigint> | | org.apache.spark.sql.catalyst.expressions.xml.XPathShort | xpathshort | SELECT xpathshort('<a><b>1</b><b>2</b></a>', 'sum(a/b)') | struct<xpath_short(<a><b>1</b><b>2</b></a>, sum(a/b)):smallint> | | org.apache.spark.sql.catalyst.expressions.xml.XPathString | xpathstring | SELECT xpathstring('<a><b>b</b><c>cc</c></a>','a/c') | struct<xpath_string(<a><b>b</b><c>cc</c></a>, a/c):string> |