From 9914c998f7d98ea82828daf2cffc1565014131c6 Mon Sep 17 00:00:00 2001 From: sperlingxx Date: Thu, 21 Apr 2022 13:06:30 +0800 Subject: [PATCH 1/5] init --- .../nvidia/spark/rapids/GpuOverrides.scala | 14 ++++ .../sql/rapids/collectionOperations.scala | 74 ++++++++++++++++++- 2 files changed, 84 insertions(+), 4 deletions(-) diff --git a/sql-plugin/src/main/scala/com/nvidia/spark/rapids/GpuOverrides.scala b/sql-plugin/src/main/scala/com/nvidia/spark/rapids/GpuOverrides.scala index 0fe567eab03..02c1901173f 100644 --- a/sql-plugin/src/main/scala/com/nvidia/spark/rapids/GpuOverrides.scala +++ b/sql-plugin/src/main/scala/com/nvidia/spark/rapids/GpuOverrides.scala @@ -2768,6 +2768,20 @@ object GpuOverrides extends Logging { override def convertToGpu(child: Expression): GpuExpression = GpuArrayMax(child) }), + expr[ArrayRepeat]( + "Returns the array containing the given input value (left) count (right) times", + ExprChecks.binaryProject( + TypeSig.ARRAY.nested(TypeSig.commonCudfTypes + TypeSig.DECIMAL_128 + TypeSig.NULL + + TypeSig.ARRAY + TypeSig.STRUCT), + TypeSig.ARRAY.nested(TypeSig.all), + ("left", (TypeSig.commonCudfTypes + TypeSig.DECIMAL_128 + TypeSig.NULL + + TypeSig.ARRAY + TypeSig.STRUCT).nested(), TypeSig.all), + ("right", TypeSig.integral, TypeSig.integral)), + (in, conf, p, r) => new BinaryExprMeta[ArrayRepeat](in, conf, p, r) { + override def convertToGpu(lhs: Expression, rhs: Expression): GpuExpression = + GpuArrayRepeat(lhs, rhs) + } + ), expr[CreateNamedStruct]( "Creates a struct with the given field names and values", CreateNamedStructCheck, diff --git a/sql-plugin/src/main/scala/org/apache/spark/sql/rapids/collectionOperations.scala b/sql-plugin/src/main/scala/org/apache/spark/sql/rapids/collectionOperations.scala index ce0ae6794dc..13019b07015 100644 --- a/sql-plugin/src/main/scala/org/apache/spark/sql/rapids/collectionOperations.scala +++ b/sql-plugin/src/main/scala/org/apache/spark/sql/rapids/collectionOperations.scala @@ -17,18 +17,15 @@ package org.apache.spark.sql.rapids import java.util.Optional - import scala.collection.mutable.ArrayBuffer - import ai.rapids.cudf -import ai.rapids.cudf.{BinaryOp, ColumnVector, ColumnView, DType, GroupByAggregation, GroupByOptions, Scalar, SegmentedReductionAggregation, Table} +import ai.rapids.cudf.{BinaryOp, ColumnVector, ColumnView, DType, GroupByAggregation, GroupByOptions, NullPolicy, Scalar, ScanAggregation, ScanType, SegmentedReductionAggregation, Table} import com.nvidia.spark.rapids._ import com.nvidia.spark.rapids.ArrayIndexUtils.firstIndexAndNumElementUnchecked import com.nvidia.spark.rapids.BoolUtils.isAllValidTrue import com.nvidia.spark.rapids.GpuExpressionsUtils.columnarEvalToColumn import com.nvidia.spark.rapids.RapidsPluginImplicits._ import com.nvidia.spark.rapids.shims.{RapidsErrorUtils, ShimExpression} - import org.apache.spark.sql.catalyst.analysis.{TypeCheckResult, TypeCoercion} import org.apache.spark.sql.catalyst.expressions.{ExpectsInputTypes, Expression, ImplicitCastInputTypes, RowOrdering, Sequence, TimeZoneAwareExpression} import org.apache.spark.sql.types._ @@ -508,6 +505,75 @@ case class GpuArrayMax(child: Expression) extends GpuUnaryExpression with Implic } } +case class GpuArrayRepeat(left: Expression, right: Expression) extends GpuBinaryExpression { + + override def dataType: DataType = ArrayType(left.dataType, left.nullable) + + override def doColumnar(lhs: GpuColumnVector, rhs: GpuColumnVector): ColumnVector = { + val countNotNull = withResource(GpuScalar.from(1, DataTypes.IntegerType)) { one => + rhs.getBase.replaceNulls(one) + } + + val elemTable = closeOnExcept(countNotNull) { _ => + withResource(GpuScalar.from(null, lhs.dataType())) { nullElem => + withResource(rhs.getBase.isNull) { isCntNull => + withResource(isCntNull.ifElse(nullElem, lhs.getBase)) { elemWithNull => + new Table(elemWithNull) + } + } + } + } + + val repeated = withResource(countNotNull) { cnt => + withResource(elemTable) { table => + table.repeat(cnt, true).getColumn(0) + } + } + + withResource(repeated) { repeated => + withResource(rhs.getBase.scan( + ScanAggregation.sum(), ScanType.INCLUSIVE, NullPolicy.EXCLUDE)) { offsets => + repeated.makeListFromOffsets(lhs.getRowCount, offsets) + } + } + } + + override def doColumnar(lhs: GpuScalar, rhs: GpuColumnVector): ColumnVector = { + withResource(GpuColumnVector.from(lhs, rhs.getRowCount.toInt, lhs.dataType)) { left => + doColumnar(left, rhs) + } + } + + override def doColumnar(lhs: GpuColumnVector, rhs: GpuScalar): ColumnVector = { + val numRows = lhs.getRowCount.toInt + if (!rhs.isValid) { + GpuColumnVector.fromNull(numRows, lhs.dataType()).getBase + } else { + val offsets = withResource(GpuColumnVector.from(rhs, numRows, rhs.dataType)) { cnt => + cnt.getBase.scan( + ScanAggregation.sum(), ScanType.INCLUSIVE, NullPolicy.EXCLUDE) + } + withResource(offsets) { offsets => + withResource(new Table(lhs.getBase)) { table => + withResource(table.repeat(rhs.getValue.asInstanceOf[Int]).getColumn(0)) { repeated => + repeated.makeListFromOffsets(lhs.getRowCount, offsets) + } + } + } + } + } + + override def doColumnar(numRows: Int, lhs: GpuScalar, rhs: GpuScalar): ColumnVector = { + if (!rhs.isValid) { + GpuColumnVector.fromNull(numRows, lhs.dataType).getBase + } else { + withResource(GpuColumnVector.from(lhs, numRows, lhs.dataType)) { left => + doColumnar(left, rhs) + } + } + } +} + class GpuSequenceMeta( expr: Sequence, conf: RapidsConf, From f8f49f9646d47f2514591408d133c2d9b5d752c1 Mon Sep 17 00:00:00 2001 From: sperlingxx Date: Thu, 21 Apr 2022 20:21:08 +0800 Subject: [PATCH 2/5] refine Signed-off-by: sperlingxx --- .../src/main/python/array_test.py | 27 ++++++++ .../nvidia/spark/rapids/GpuOverrides.scala | 4 +- .../sql/rapids/collectionOperations.scala | 65 ++++++++++++------- 3 files changed, 71 insertions(+), 25 deletions(-) diff --git a/integration_tests/src/main/python/array_test.py b/integration_tests/src/main/python/array_test.py index b80a3211751..c239eead19e 100644 --- a/integration_tests/src/main/python/array_test.py +++ b/integration_tests/src/main/python/array_test.py @@ -284,6 +284,33 @@ def test_array_max(data_gen): 'array_max(a)'), conf=no_nans_conf) + +@pytest.mark.parametrize('data_gen', orderable_gens + nested_gens_sample, ids=idfn) +def test_array_repeat_with_count_column(data_gen): + cnt_gen = IntegerGen(min_val=-5, max_val=5, special_cases=[]) + cnt_not_null_gen = IntegerGen(min_val=-5, max_val=5, special_cases=[], nullable=False) + gen = StructGen( + [('elem', data_gen), ('cnt', cnt_gen), ('cnt_nn', cnt_not_null_gen)], nullable=False) + assert_gpu_and_cpu_are_equal_collect( + lambda spark: gen_df(spark, gen).selectExpr( + 'array_repeat(elem, cnt)', + 'array_repeat(elem, cnt_nn)', + 'array_repeat("abc", cnt)')) + + +@pytest.mark.parametrize('data_gen', orderable_gens + nested_gens_sample, ids=idfn) +def test_array_repeat_with_count_scalar(data_gen): + assert_gpu_and_cpu_are_equal_collect( + lambda spark: unary_op_df(spark, data_gen).selectExpr( + 'array_repeat(a, 3)', + 'array_repeat(a, 1)', + 'array_repeat(a, 0)', + 'array_repeat(a, -2)', + 'array_repeat("abc", 2)', + 'array_repeat("abc", 0)', + 'array_repeat("abc", -1)')) + + # We add in several types of processing for foldable functions because the output # can be different types. @pytest.mark.parametrize('query', [ diff --git a/sql-plugin/src/main/scala/com/nvidia/spark/rapids/GpuOverrides.scala b/sql-plugin/src/main/scala/com/nvidia/spark/rapids/GpuOverrides.scala index 02c1901173f..1478435ff22 100644 --- a/sql-plugin/src/main/scala/com/nvidia/spark/rapids/GpuOverrides.scala +++ b/sql-plugin/src/main/scala/com/nvidia/spark/rapids/GpuOverrides.scala @@ -2772,10 +2772,10 @@ object GpuOverrides extends Logging { "Returns the array containing the given input value (left) count (right) times", ExprChecks.binaryProject( TypeSig.ARRAY.nested(TypeSig.commonCudfTypes + TypeSig.DECIMAL_128 + TypeSig.NULL - + TypeSig.ARRAY + TypeSig.STRUCT), + + TypeSig.ARRAY + TypeSig.STRUCT + TypeSig.MAP), TypeSig.ARRAY.nested(TypeSig.all), ("left", (TypeSig.commonCudfTypes + TypeSig.DECIMAL_128 + TypeSig.NULL - + TypeSig.ARRAY + TypeSig.STRUCT).nested(), TypeSig.all), + + TypeSig.ARRAY + TypeSig.STRUCT + TypeSig.MAP).nested(), TypeSig.all), ("right", TypeSig.integral, TypeSig.integral)), (in, conf, p, r) => new BinaryExprMeta[ArrayRepeat](in, conf, p, r) { override def convertToGpu(lhs: Expression, rhs: Expression): GpuExpression = diff --git a/sql-plugin/src/main/scala/org/apache/spark/sql/rapids/collectionOperations.scala b/sql-plugin/src/main/scala/org/apache/spark/sql/rapids/collectionOperations.scala index 13019b07015..e486cc07a9e 100644 --- a/sql-plugin/src/main/scala/org/apache/spark/sql/rapids/collectionOperations.scala +++ b/sql-plugin/src/main/scala/org/apache/spark/sql/rapids/collectionOperations.scala @@ -17,15 +17,18 @@ package org.apache.spark.sql.rapids import java.util.Optional + import scala.collection.mutable.ArrayBuffer + import ai.rapids.cudf -import ai.rapids.cudf.{BinaryOp, ColumnVector, ColumnView, DType, GroupByAggregation, GroupByOptions, NullPolicy, Scalar, ScanAggregation, ScanType, SegmentedReductionAggregation, Table} +import ai.rapids.cudf.{BinaryOp, ColumnVector, ColumnView, DType, GroupByAggregation, GroupByOptions, Scalar, SegmentedReductionAggregation, Table} import com.nvidia.spark.rapids._ import com.nvidia.spark.rapids.ArrayIndexUtils.firstIndexAndNumElementUnchecked import com.nvidia.spark.rapids.BoolUtils.isAllValidTrue import com.nvidia.spark.rapids.GpuExpressionsUtils.columnarEvalToColumn import com.nvidia.spark.rapids.RapidsPluginImplicits._ import com.nvidia.spark.rapids.shims.{RapidsErrorUtils, ShimExpression} + import org.apache.spark.sql.catalyst.analysis.{TypeCheckResult, TypeCoercion} import org.apache.spark.sql.catalyst.expressions.{ExpectsInputTypes, Expression, ImplicitCastInputTypes, RowOrdering, Sequence, TimeZoneAwareExpression} import org.apache.spark.sql.types._ @@ -510,32 +513,44 @@ case class GpuArrayRepeat(left: Expression, right: Expression) extends GpuBinary override def dataType: DataType = ArrayType(left.dataType, left.nullable) override def doColumnar(lhs: GpuColumnVector, rhs: GpuColumnVector): ColumnVector = { - val countNotNull = withResource(GpuScalar.from(1, DataTypes.IntegerType)) { one => - rhs.getBase.replaceNulls(one) - } - - val elemTable = closeOnExcept(countNotNull) { _ => - withResource(GpuScalar.from(null, lhs.dataType())) { nullElem => - withResource(rhs.getBase.isNull) { isCntNull => - withResource(isCntNull.ifElse(nullElem, lhs.getBase)) { elemWithNull => - new Table(elemWithNull) + // The primary issue of array_repeat is to workaround the null and negative count. + // Spark returns a null (list) when encountering a null count, while cudf::repeat simply + // throws an exception. + // Spark returns a empty list when encountering a negative count, while cudf::repeat simply + // throws an exception. + + // Step 1. replace invalid counts + // null -> 1 + // negative values -> 0 + val refinedCount = withResource(GpuScalar.from(1, DataTypes.IntegerType)) { one => + withResource(rhs.getBase.replaceNulls(one)) { notNull => + withResource(GpuScalar.from(0, DataTypes.IntegerType)) { zero => + withResource(notNull.lessThan(zero)) { lessThanZero => + lessThanZero.ifElse(zero, notNull) } } } } - - val repeated = withResource(countNotNull) { cnt => - withResource(elemTable) { table => + // Step 2. perform cuDF repeat + val repeated = closeOnExcept(refinedCount) { cnt => + withResource(new Table(lhs.getBase)) { table => table.repeat(cnt, true).getColumn(0) } } - - withResource(repeated) { repeated => - withResource(rhs.getBase.scan( - ScanAggregation.sum(), ScanType.INCLUSIVE, NullPolicy.EXCLUDE)) { offsets => + // Step 3. generate list offsets from refined counts + val offsets = withResource(refinedCount) { cnt => + cnt.generateListOffsets() + } + // Step 4. make the result list column with offsets and child column + val list = withResource(offsets) { offsets => + withResource(repeated) { repeated => repeated.makeListFromOffsets(lhs.getRowCount, offsets) } } + // Step 5. merge the validity of count column to the result + withResource(list) { list => + list.mergeAndSetValidity(BinaryOp.BITWISE_AND, rhs.getBase) + } } override def doColumnar(lhs: GpuScalar, rhs: GpuColumnVector): ColumnVector = { @@ -547,15 +562,19 @@ case class GpuArrayRepeat(left: Expression, right: Expression) extends GpuBinary override def doColumnar(lhs: GpuColumnVector, rhs: GpuScalar): ColumnVector = { val numRows = lhs.getRowCount.toInt if (!rhs.isValid) { - GpuColumnVector.fromNull(numRows, lhs.dataType()).getBase + GpuColumnVector.fromNull(numRows, dataType).getBase } else { - val offsets = withResource(GpuColumnVector.from(rhs, numRows, rhs.dataType)) { cnt => - cnt.getBase.scan( - ScanAggregation.sum(), ScanType.INCLUSIVE, NullPolicy.EXCLUDE) + val count = rhs.getValue.asInstanceOf[Int] max 0 + + val offsets = withResource(GpuScalar.from(count, IntegerType)) { cntScalar => + withResource(GpuColumnVector.from(cntScalar, numRows, rhs.dataType)) { cnt => + cnt.getBase.generateListOffsets() + } } + withResource(offsets) { offsets => withResource(new Table(lhs.getBase)) { table => - withResource(table.repeat(rhs.getValue.asInstanceOf[Int]).getColumn(0)) { repeated => + withResource(table.repeat(count).getColumn(0)) { repeated => repeated.makeListFromOffsets(lhs.getRowCount, offsets) } } @@ -565,7 +584,7 @@ case class GpuArrayRepeat(left: Expression, right: Expression) extends GpuBinary override def doColumnar(numRows: Int, lhs: GpuScalar, rhs: GpuScalar): ColumnVector = { if (!rhs.isValid) { - GpuColumnVector.fromNull(numRows, lhs.dataType).getBase + GpuColumnVector.fromNull(numRows, dataType).getBase } else { withResource(GpuColumnVector.from(lhs, numRows, lhs.dataType)) { left => doColumnar(left, rhs) From 948b9752d48df8347657c0a21d68f0edebd4e625 Mon Sep 17 00:00:00 2001 From: sperlingxx Date: Wed, 27 Apr 2022 16:54:59 +0800 Subject: [PATCH 3/5] refine Signed-off-by: sperlingxx --- docs/configs.md | 1 + docs/supported_ops.md | 68 +++++++++++++++++++ .../sql/rapids/collectionOperations.scala | 18 ++--- tools/src/main/resources/operatorsScore.csv | 1 + tools/src/main/resources/supportedExprs.csv | 3 + 5 files changed, 82 insertions(+), 9 deletions(-) diff --git a/docs/configs.md b/docs/configs.md index 4daf78ecce8..f93cbb4f484 100644 --- a/docs/configs.md +++ b/docs/configs.md @@ -158,6 +158,7 @@ Name | SQL Function(s) | Description | Default Value | Notes spark.rapids.sql.expression.ArrayExists|`exists`|Return true if any element satisfies the predicate LambdaFunction|true|None| spark.rapids.sql.expression.ArrayMax|`array_max`|Returns the maximum value in the array|true|None| spark.rapids.sql.expression.ArrayMin|`array_min`|Returns the minimum value in the array|true|None| +spark.rapids.sql.expression.ArrayRepeat|`array_repeat`|Returns the array containing the given input value (left) count (right) times|true|None| spark.rapids.sql.expression.ArrayTransform|`transform`|Transform elements in an array using the transform function. This is similar to a `map` in functional programming|true|None| spark.rapids.sql.expression.Asin|`asin`|Inverse sine|true|None| spark.rapids.sql.expression.Asinh|`asinh`|Inverse hyperbolic sine|true|None| diff --git a/docs/supported_ops.md b/docs/supported_ops.md index 0f0c5678cf0..f1ffaab7a5a 100644 --- a/docs/supported_ops.md +++ b/docs/supported_ops.md @@ -2218,6 +2218,74 @@ are limited. NS +ArrayRepeat +`array_repeat` +Returns the array containing the given input value (left) count (right) times +None +project +left +S +S +S +S +S +S +S +S +PS
UTC is only supported TZ for TIMESTAMP
+S +S +S +NS +NS +PS
UTC is only supported TZ for child TIMESTAMP;
unsupported child types BINARY, CALENDAR, UDT
+PS
UTC is only supported TZ for child TIMESTAMP;
unsupported child types BINARY, CALENDAR, UDT
+PS
UTC is only supported TZ for child TIMESTAMP;
unsupported child types BINARY, CALENDAR, UDT
+NS + + +right + +S +S +S +S + + + + + + + + + + + + + + + +result + + + + + + + + + + + + + + +PS
UTC is only supported TZ for child TIMESTAMP;
unsupported child types BINARY, CALENDAR, UDT
+ + + + + ArrayTransform `transform` Transform elements in an array using the transform function. This is similar to a `map` in functional programming diff --git a/sql-plugin/src/main/scala/org/apache/spark/sql/rapids/collectionOperations.scala b/sql-plugin/src/main/scala/org/apache/spark/sql/rapids/collectionOperations.scala index 65b29d43a16..9057f85988c 100644 --- a/sql-plugin/src/main/scala/org/apache/spark/sql/rapids/collectionOperations.scala +++ b/sql-plugin/src/main/scala/org/apache/spark/sql/rapids/collectionOperations.scala @@ -519,14 +519,12 @@ case class GpuArrayRepeat(left: Expression, right: Expression) extends GpuBinary // throws an exception. // Step 1. replace invalid counts - // null -> 1 + // null -> 0 // negative values -> 0 - val refinedCount = withResource(GpuScalar.from(1, DataTypes.IntegerType)) { one => - withResource(rhs.getBase.replaceNulls(one)) { notNull => - withResource(GpuScalar.from(0, DataTypes.IntegerType)) { zero => - withResource(notNull.lessThan(zero)) { lessThanZero => - lessThanZero.ifElse(zero, notNull) - } + val refinedCount = withResource(GpuScalar.from(0, DataTypes.IntegerType)) { zero => + withResource(rhs.getBase.replaceNulls(zero)) { notNull => + withResource(notNull.lessThan(zero)) { lessThanZero => + lessThanZero.ifElse(zero, notNull) } } } @@ -537,8 +535,10 @@ case class GpuArrayRepeat(left: Expression, right: Expression) extends GpuBinary } } // Step 3. generate list offsets from refined counts - val offsets = withResource(refinedCount) { cnt => - cnt.generateListOffsets() + val offsets = closeOnExcept(repeated) { _ => + withResource(refinedCount) { cnt => + cnt.generateListOffsets() + } } // Step 4. make the result list column with offsets and child column val list = withResource(offsets) { offsets => diff --git a/tools/src/main/resources/operatorsScore.csv b/tools/src/main/resources/operatorsScore.csv index 27df5a0bc7d..7e2cefcfd9e 100644 --- a/tools/src/main/resources/operatorsScore.csv +++ b/tools/src/main/resources/operatorsScore.csv @@ -46,6 +46,7 @@ ArrayContains,3 ArrayExists,3 ArrayMax,3 ArrayMin,3 +ArrayRepeat,3 ArrayTransform,3 Asin,3 Asinh,3 diff --git a/tools/src/main/resources/supportedExprs.csv b/tools/src/main/resources/supportedExprs.csv index b9660da6622..05d8879c1ac 100644 --- a/tools/src/main/resources/supportedExprs.csv +++ b/tools/src/main/resources/supportedExprs.csv @@ -37,6 +37,9 @@ ArrayMax,S,`array_max`,None,project,input,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA ArrayMax,S,`array_max`,None,project,result,S,S,S,S,S,S,S,S,PS,S,S,S,NS,NS,NS,NA,NS,NS ArrayMin,S,`array_min`,None,project,input,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,PS,NA,NA,NA ArrayMin,S,`array_min`,None,project,result,S,S,S,S,S,S,S,S,PS,S,S,S,NS,NS,NS,NA,NS,NS +ArrayRepeat,S,`array_repeat`,None,project,left,S,S,S,S,S,S,S,S,PS,S,S,S,NS,NS,PS,PS,PS,NS +ArrayRepeat,S,`array_repeat`,None,project,right,NA,S,S,S,S,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA +ArrayRepeat,S,`array_repeat`,None,project,result,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,PS,NA,NA,NA ArrayTransform,S,`transform`,None,project,argument,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,PS,NA,NA,NA ArrayTransform,S,`transform`,None,project,function,S,S,S,S,S,S,S,S,PS,S,S,S,NS,NS,PS,PS,PS,NS ArrayTransform,S,`transform`,None,project,result,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,PS,NA,NA,NA From 07d010c28171581b28df05c897a53c08de59db62 Mon Sep 17 00:00:00 2001 From: sperlingxx Date: Thu, 28 Apr 2022 13:26:48 +0800 Subject: [PATCH 4/5] fix --- .../scala/org/apache/spark/sql/rapids/collectionOperations.scala | 1 + 1 file changed, 1 insertion(+) diff --git a/sql-plugin/src/main/scala/org/apache/spark/sql/rapids/collectionOperations.scala b/sql-plugin/src/main/scala/org/apache/spark/sql/rapids/collectionOperations.scala index b83541f596b..756f7a33e03 100644 --- a/sql-plugin/src/main/scala/org/apache/spark/sql/rapids/collectionOperations.scala +++ b/sql-plugin/src/main/scala/org/apache/spark/sql/rapids/collectionOperations.scala @@ -591,6 +591,7 @@ case class GpuArrayRepeat(left: Expression, right: Expression) extends GpuBinary } } } +} case class GpuArraysZip(children: Seq[Expression]) extends GpuExpression with ShimExpression with ExpectsInputTypes { From 2d257e843278897499bafef224d974958ef102da Mon Sep 17 00:00:00 2001 From: sperlingxx Date: Thu, 28 Apr 2022 14:41:14 +0800 Subject: [PATCH 5/5] update docs --- docs/supported_ops.md | 1718 +++++++++++++++++++++-------------------- 1 file changed, 872 insertions(+), 846 deletions(-) diff --git a/docs/supported_ops.md b/docs/supported_ops.md index 14a0b153df9..cb3142a9d50 100644 --- a/docs/supported_ops.md +++ b/docs/supported_ops.md @@ -2491,6 +2491,32 @@ are limited. +Expression +SQL Functions(s) +Description +Notes +Context +Param/Output +BOOLEAN +BYTE +SHORT +INT +LONG +FLOAT +DOUBLE +DATE +TIMESTAMP +STRING +DECIMAL +NULL +BINARY +CALENDAR +ARRAY +MAP +STRUCT +UDT + + Asinh `asinh` Inverse hyperbolic sine @@ -2581,32 +2607,6 @@ are limited. -Expression -SQL Functions(s) -Description -Notes -Context -Param/Output -BOOLEAN -BYTE -SHORT -INT -LONG -FLOAT -DOUBLE -DATE -TIMESTAMP -STRING -DECIMAL -NULL -BINARY -CALENDAR -ARRAY -MAP -STRUCT -UDT - - AtLeastNNonNulls Checks if number of non null/Nan values is greater than a given value @@ -2882,6 +2882,32 @@ are limited. NS +Expression +SQL Functions(s) +Description +Notes +Context +Param/Output +BOOLEAN +BYTE +SHORT +INT +LONG +FLOAT +DOUBLE +DATE +TIMESTAMP +STRING +DECIMAL +NULL +BINARY +CALENDAR +ARRAY +MAP +STRUCT +UDT + + BRound `bround` Round an expression to d decimal places using HALF_EVEN rounding mode @@ -2950,32 +2976,6 @@ are limited. -Expression -SQL Functions(s) -Description -Notes -Context -Param/Output -BOOLEAN -BYTE -SHORT -INT -LONG -FLOAT -DOUBLE -DATE -TIMESTAMP -STRING -DECIMAL -NULL -BINARY -CALENDAR -ARRAY -MAP -STRUCT -UDT - - BitLength `bit_length` The bit length of string data @@ -3245,6 +3245,32 @@ are limited. +Expression +SQL Functions(s) +Description +Notes +Context +Param/Output +BOOLEAN +BYTE +SHORT +INT +LONG +FLOAT +DOUBLE +DATE +TIMESTAMP +STRING +DECIMAL +NULL +BINARY +CALENDAR +ARRAY +MAP +STRUCT +UDT + + BitwiseOr `\|` Returns the bitwise OR of the operands @@ -3377,32 +3403,6 @@ are limited. -Expression -SQL Functions(s) -Description -Notes -Context -Param/Output -BOOLEAN -BYTE -SHORT -INT -LONG -FLOAT -DOUBLE -DATE -TIMESTAMP -STRING -DECIMAL -NULL -BINARY -CALENDAR -ARRAY -MAP -STRUCT -UDT - - BitwiseXor `^` Returns the bitwise XOR of the operands @@ -3603,6 +3603,32 @@ are limited. NS +Expression +SQL Functions(s) +Description +Notes +Context +Param/Output +BOOLEAN +BYTE +SHORT +INT +LONG +FLOAT +DOUBLE +DATE +TIMESTAMP +STRING +DECIMAL +NULL +BINARY +CALENDAR +ARRAY +MAP +STRUCT +UDT + + Cbrt `cbrt` Cube root @@ -3740,32 +3766,6 @@ are limited. -Expression -SQL Functions(s) -Description -Notes -Context -Param/Output -BOOLEAN -BYTE -SHORT -INT -LONG -FLOAT -DOUBLE -DATE -TIMESTAMP -STRING -DECIMAL -NULL -BINARY -CALENDAR -ARRAY -MAP -STRUCT -UDT - - CheckOverflow CheckOverflow after arithmetic operations between DecimalType data @@ -4022,6 +4022,32 @@ are limited. +Expression +SQL Functions(s) +Description +Notes +Context +Param/Output +BOOLEAN +BYTE +SHORT +INT +LONG +FLOAT +DOUBLE +DATE +TIMESTAMP +STRING +DECIMAL +NULL +BINARY +CALENDAR +ARRAY +MAP +STRUCT +UDT + + Cos `cos` Cosine @@ -4112,32 +4138,6 @@ are limited. -Expression -SQL Functions(s) -Description -Notes -Context -Param/Output -BOOLEAN -BYTE -SHORT -INT -LONG -FLOAT -DOUBLE -DATE -TIMESTAMP -STRING -DECIMAL -NULL -BINARY -CALENDAR -ARRAY -MAP -STRUCT -UDT - - Cosh `cosh` Hyperbolic cosine @@ -4412,6 +4412,32 @@ are limited. +Expression +SQL Functions(s) +Description +Notes +Context +Param/Output +BOOLEAN +BYTE +SHORT +INT +LONG +FLOAT +DOUBLE +DATE +TIMESTAMP +STRING +DECIMAL +NULL +BINARY +CALENDAR +ARRAY +MAP +STRUCT +UDT + + CreateNamedStruct `named_struct`, `struct` Creates a struct with the given field names and values @@ -4480,32 +4506,6 @@ are limited. -Expression -SQL Functions(s) -Description -Notes -Context -Param/Output -BOOLEAN -BYTE -SHORT -INT -LONG -FLOAT -DOUBLE -DATE -TIMESTAMP -STRING -DECIMAL -NULL -BINARY -CALENDAR -ARRAY -MAP -STRUCT -UDT - - CurrentRow$ Special boundary for a window frame, indicating stopping at the current row @@ -4804,6 +4804,32 @@ are limited. +Expression +SQL Functions(s) +Description +Notes +Context +Param/Output +BOOLEAN +BYTE +SHORT +INT +LONG +FLOAT +DOUBLE +DATE +TIMESTAMP +STRING +DECIMAL +NULL +BINARY +CALENDAR +ARRAY +MAP +STRUCT +UDT + + DateSub `date_sub` Returns the date that is num_days before start_date @@ -4872,32 +4898,6 @@ are limited. -Expression -SQL Functions(s) -Description -Notes -Context -Param/Output -BOOLEAN -BYTE -SHORT -INT -LONG -FLOAT -DOUBLE -DATE -TIMESTAMP -STRING -DECIMAL -NULL -BINARY -CALENDAR -ARRAY -MAP -STRUCT -UDT - - DayOfMonth `dayofmonth`, `day` Returns the day of the month from a date or timestamp @@ -5222,6 +5222,32 @@ are limited. NS +Expression +SQL Functions(s) +Description +Notes +Context +Param/Output +BOOLEAN +BYTE +SHORT +INT +LONG +FLOAT +DOUBLE +DATE +TIMESTAMP +STRING +DECIMAL +NULL +BINARY +CALENDAR +ARRAY +MAP +STRUCT +UDT + + EndsWith Ends with @@ -5266,54 +5292,28 @@ are limited. - - - -result -S - - - - - - - - - - - - - - - - - - - -Expression -SQL Functions(s) -Description -Notes -Context -Param/Output -BOOLEAN -BYTE -SHORT -INT -LONG -FLOAT -DOUBLE -DATE -TIMESTAMP -STRING -DECIMAL -NULL -BINARY -CALENDAR -ARRAY -MAP -STRUCT -UDT + + + +result +S + + + + + + + + + + + + + + + + + EqualNullSafe @@ -5606,6 +5606,32 @@ are limited. +Expression +SQL Functions(s) +Description +Notes +Context +Param/Output +BOOLEAN +BYTE +SHORT +INT +LONG +FLOAT +DOUBLE +DATE +TIMESTAMP +STRING +DECIMAL +NULL +BINARY +CALENDAR +ARRAY +MAP +STRUCT +UDT + + Explode `explode`, `explode_outer` Given an input array produces a sequence of rows for each value in the array @@ -5653,32 +5679,6 @@ are limited. -Expression -SQL Functions(s) -Description -Notes -Context -Param/Output -BOOLEAN -BYTE -SHORT -INT -LONG -FLOAT -DOUBLE -DATE -TIMESTAMP -STRING -DECIMAL -NULL -BINARY -CALENDAR -ARRAY -MAP -STRUCT -UDT - - Expm1 `expm1` Euler's number e raised to a power minus 1 @@ -5999,6 +5999,32 @@ are limited. +Expression +SQL Functions(s) +Description +Notes +Context +Param/Output +BOOLEAN +BYTE +SHORT +INT +LONG +FLOAT +DOUBLE +DATE +TIMESTAMP +STRING +DECIMAL +NULL +BINARY +CALENDAR +ARRAY +MAP +STRUCT +UDT + + GetJsonObject `get_json_object` Extracts a json object from path @@ -6067,32 +6093,6 @@ are limited. -Expression -SQL Functions(s) -Description -Notes -Context -Param/Output -BOOLEAN -BYTE -SHORT -INT -LONG -FLOAT -DOUBLE -DATE -TIMESTAMP -STRING -DECIMAL -NULL -BINARY -CALENDAR -ARRAY -MAP -STRUCT -UDT - - GetMapValue Gets Value from a Map based on a key @@ -6408,6 +6408,32 @@ are limited. +Expression +SQL Functions(s) +Description +Notes +Context +Param/Output +BOOLEAN +BYTE +SHORT +INT +LONG +FLOAT +DOUBLE +DATE +TIMESTAMP +STRING +DECIMAL +NULL +BINARY +CALENDAR +ARRAY +MAP +STRUCT +UDT + + GreaterThanOrEqual `>=` >= operator @@ -6540,32 +6566,6 @@ are limited. -Expression -SQL Functions(s) -Description -Notes -Context -Param/Output -BOOLEAN -BYTE -SHORT -INT -LONG -FLOAT -DOUBLE -DATE -TIMESTAMP -STRING -DECIMAL -NULL -BINARY -CALENDAR -ARRAY -MAP -STRUCT -UDT - - Greatest `greatest` Returns the greatest value of all parameters, skipping null values @@ -6817,6 +6817,32 @@ are limited. NS +Expression +SQL Functions(s) +Description +Notes +Context +Param/Output +BOOLEAN +BYTE +SHORT +INT +LONG +FLOAT +DOUBLE +DATE +TIMESTAMP +STRING +DECIMAL +NULL +BINARY +CALENDAR +ARRAY +MAP +STRUCT +UDT + + In `in` IN operator @@ -6932,32 +6958,6 @@ are limited. -Expression -SQL Functions(s) -Description -Notes -Context -Param/Output -BOOLEAN -BYTE -SHORT -INT -LONG -FLOAT -DOUBLE -DATE -TIMESTAMP -STRING -DECIMAL -NULL -BINARY -CALENDAR -ARRAY -MAP -STRUCT -UDT - - InitCap `initcap` Returns str with the first letter of each word in uppercase. All other letters are in lowercase @@ -7198,6 +7198,32 @@ are limited. +Expression +SQL Functions(s) +Description +Notes +Context +Param/Output +BOOLEAN +BYTE +SHORT +INT +LONG +FLOAT +DOUBLE +DATE +TIMESTAMP +STRING +DECIMAL +NULL +BINARY +CALENDAR +ARRAY +MAP +STRUCT +UDT + + IsNotNull `isnotnull` Checks if a value is not null @@ -7339,32 +7365,6 @@ are limited. -Expression -SQL Functions(s) -Description -Notes -Context -Param/Output -BOOLEAN -BYTE -SHORT -INT -LONG -FLOAT -DOUBLE -DATE -TIMESTAMP -STRING -DECIMAL -NULL -BINARY -CALENDAR -ARRAY -MAP -STRUCT -UDT - - KnownNotNull Tag an expression as known to not be null @@ -7569,6 +7569,32 @@ are limited. NS +Expression +SQL Functions(s) +Description +Notes +Context +Param/Output +BOOLEAN +BYTE +SHORT +INT +LONG +FLOAT +DOUBLE +DATE +TIMESTAMP +STRING +DECIMAL +NULL +BINARY +CALENDAR +ARRAY +MAP +STRUCT +UDT + + LastDay `last_day` Returns the last day of the month which the date belongs to @@ -7705,32 +7731,6 @@ are limited. NS -Expression -SQL Functions(s) -Description -Notes -Context -Param/Output -BOOLEAN -BYTE -SHORT -INT -LONG -FLOAT -DOUBLE -DATE -TIMESTAMP -STRING -DECIMAL -NULL -BINARY -CALENDAR -ARRAY -MAP -STRUCT -UDT - - Least `least` Returns the least value of all parameters, skipping null values @@ -7957,6 +7957,32 @@ are limited. +Expression +SQL Functions(s) +Description +Notes +Context +Param/Output +BOOLEAN +BYTE +SHORT +INT +LONG +FLOAT +DOUBLE +DATE +TIMESTAMP +STRING +DECIMAL +NULL +BINARY +CALENDAR +ARRAY +MAP +STRUCT +UDT + + LessThanOrEqual `<=` <= operator @@ -8089,32 +8115,6 @@ are limited. -Expression -SQL Functions(s) -Description -Notes -Context -Param/Output -BOOLEAN -BYTE -SHORT -INT -LONG -FLOAT -DOUBLE -DATE -TIMESTAMP -STRING -DECIMAL -NULL -BINARY -CALENDAR -ARRAY -MAP -STRUCT -UDT - - Like `like` Like @@ -8325,6 +8325,32 @@ are limited. +Expression +SQL Functions(s) +Description +Notes +Context +Param/Output +BOOLEAN +BYTE +SHORT +INT +LONG +FLOAT +DOUBLE +DATE +TIMESTAMP +STRING +DECIMAL +NULL +BINARY +CALENDAR +ARRAY +MAP +STRUCT +UDT + + Log1p `log1p` Natural log 1 + expr @@ -8487,32 +8513,6 @@ are limited. -Expression -SQL Functions(s) -Description -Notes -Context -Param/Output -BOOLEAN -BYTE -SHORT -INT -LONG -FLOAT -DOUBLE -DATE -TIMESTAMP -STRING -DECIMAL -NULL -BINARY -CALENDAR -ARRAY -MAP -STRUCT -UDT - - Lower `lower`, `lcase` String lowercase operator @@ -8701,6 +8701,32 @@ are limited. +Expression +SQL Functions(s) +Description +Notes +Context +Param/Output +BOOLEAN +BYTE +SHORT +INT +LONG +FLOAT +DOUBLE +DATE +TIMESTAMP +STRING +DECIMAL +NULL +BINARY +CALENDAR +ARRAY +MAP +STRUCT +UDT + + MapValues `map_values` Returns an unordered array containing the values of the map @@ -8844,54 +8870,28 @@ are limited. MonotonicallyIncreasingID `monotonically_increasing_id` -Returns monotonically increasing 64-bit integers -None -project -result - - - - -S - - - - - - - - - - - - - - - -Expression -SQL Functions(s) -Description -Notes -Context -Param/Output -BOOLEAN -BYTE -SHORT -INT -LONG -FLOAT -DOUBLE -DATE -TIMESTAMP -STRING -DECIMAL -NULL -BINARY -CALENDAR -ARRAY -MAP -STRUCT -UDT +Returns monotonically increasing 64-bit integers +None +project +result + + + + +S + + + + + + + + + + + + + Month @@ -9073,6 +9073,32 @@ are limited. +Expression +SQL Functions(s) +Description +Notes +Context +Param/Output +BOOLEAN +BYTE +SHORT +INT +LONG +FLOAT +DOUBLE +DATE +TIMESTAMP +STRING +DECIMAL +NULL +BINARY +CALENDAR +ARRAY +MAP +STRUCT +UDT + + Murmur3Hash `hash` Murmur3 hash operator @@ -9304,32 +9330,6 @@ are limited. -Expression -SQL Functions(s) -Description -Notes -Context -Param/Output -BOOLEAN -BYTE -SHORT -INT -LONG -FLOAT -DOUBLE -DATE -TIMESTAMP -STRING -DECIMAL -NULL -BINARY -CALENDAR -ARRAY -MAP -STRUCT -UDT - - OctetLength `octet_length` The byte length of string data @@ -9509,6 +9509,32 @@ are limited. +Expression +SQL Functions(s) +Description +Notes +Context +Param/Output +BOOLEAN +BYTE +SHORT +INT +LONG +FLOAT +DOUBLE +DATE +TIMESTAMP +STRING +DECIMAL +NULL +BINARY +CALENDAR +ARRAY +MAP +STRUCT +UDT + + PercentRank `percent_rank` Window function that returns the percent rank value within the aggregation window @@ -9671,32 +9697,6 @@ are limited. -Expression -SQL Functions(s) -Description -Notes -Context -Param/Output -BOOLEAN -BYTE -SHORT -INT -LONG -FLOAT -DOUBLE -DATE -TIMESTAMP -STRING -DECIMAL -NULL -BINARY -CALENDAR -ARRAY -MAP -STRUCT -UDT - - Pow `pow`, `power` lhs ^ rhs @@ -9876,6 +9876,32 @@ are limited. +Expression +SQL Functions(s) +Description +Notes +Context +Param/Output +BOOLEAN +BYTE +SHORT +INT +LONG +FLOAT +DOUBLE +DATE +TIMESTAMP +STRING +DECIMAL +NULL +BINARY +CALENDAR +ARRAY +MAP +STRUCT +UDT + + PromotePrecision PromotePrecision before arithmetic operations between DecimalType data @@ -10099,32 +10125,6 @@ are limited. -Expression -SQL Functions(s) -Description -Notes -Context -Param/Output -BOOLEAN -BYTE -SHORT -INT -LONG -FLOAT -DOUBLE -DATE -TIMESTAMP -STRING -DECIMAL -NULL -BINARY -CALENDAR -ARRAY -MAP -STRUCT -UDT - - Quarter `quarter` Returns the quarter of the year for date, in the range 1 to 4 @@ -10240,6 +10240,32 @@ are limited. +Expression +SQL Functions(s) +Description +Notes +Context +Param/Output +BOOLEAN +BYTE +SHORT +INT +LONG +FLOAT +DOUBLE +DATE +TIMESTAMP +STRING +DECIMAL +NULL +BINARY +CALENDAR +ARRAY +MAP +STRUCT +UDT + + Rand `random`, `rand` Generate a random column with i.i.d. uniformly distributed values in [0, 1) @@ -10533,32 +10559,6 @@ are limited. -Expression -SQL Functions(s) -Description -Notes -Context -Param/Output -BOOLEAN -BYTE -SHORT -INT -LONG -FLOAT -DOUBLE -DATE -TIMESTAMP -STRING -DECIMAL -NULL -BINARY -CALENDAR -ARRAY -MAP -STRUCT -UDT - - Remainder `%`, `mod` Remainder or modulo @@ -10627,6 +10627,32 @@ are limited. +Expression +SQL Functions(s) +Description +Notes +Context +Param/Output +BOOLEAN +BYTE +SHORT +INT +LONG +FLOAT +DOUBLE +DATE +TIMESTAMP +STRING +DECIMAL +NULL +BINARY +CALENDAR +ARRAY +MAP +STRUCT +UDT + + ReplicateRows Given an input row replicates the row N times @@ -10905,32 +10931,6 @@ are limited. NS -Expression -SQL Functions(s) -Description -Notes -Context -Param/Output -BOOLEAN -BYTE -SHORT -INT -LONG -FLOAT -DOUBLE -DATE -TIMESTAMP -STRING -DECIMAL -NULL -BINARY -CALENDAR -ARRAY -MAP -STRUCT -UDT - - Second `second` Returns the second component of the string/timestamp @@ -11067,6 +11067,32 @@ are limited. +Expression +SQL Functions(s) +Description +Notes +Context +Param/Output +BOOLEAN +BYTE +SHORT +INT +LONG +FLOAT +DOUBLE +DATE +TIMESTAMP +STRING +DECIMAL +NULL +BINARY +CALENDAR +ARRAY +MAP +STRUCT +UDT + + ShiftLeft `shiftleft` Bitwise shift left (<<) @@ -11271,32 +11297,6 @@ are limited. -Expression -SQL Functions(s) -Description -Notes -Context -Param/Output -BOOLEAN -BYTE -SHORT -INT -LONG -FLOAT -DOUBLE -DATE -TIMESTAMP -STRING -DECIMAL -NULL -BINARY -CALENDAR -ARRAY -MAP -STRUCT -UDT - - Signum `sign`, `signum` Returns -1.0, 0.0 or 1.0 as expr is negative, 0 or positive @@ -11434,6 +11434,32 @@ are limited. +Expression +SQL Functions(s) +Description +Notes +Context +Param/Output +BOOLEAN +BYTE +SHORT +INT +LONG +FLOAT +DOUBLE +DATE +TIMESTAMP +STRING +DECIMAL +NULL +BINARY +CALENDAR +ARRAY +MAP +STRUCT +UDT + + Sinh `sinh` Hyperbolic sine @@ -11639,32 +11665,6 @@ are limited. -Expression -SQL Functions(s) -Description -Notes -Context -Param/Output -BOOLEAN -BYTE -SHORT -INT -LONG -FLOAT -DOUBLE -DATE -TIMESTAMP -STRING -DECIMAL -NULL -BINARY -CALENDAR -ARRAY -MAP -STRUCT -UDT - - SortOrder Sort order @@ -11806,6 +11806,32 @@ are limited. +Expression +SQL Functions(s) +Description +Notes +Context +Param/Output +BOOLEAN +BYTE +SHORT +INT +LONG +FLOAT +DOUBLE +DATE +TIMESTAMP +STRING +DECIMAL +NULL +BINARY +CALENDAR +ARRAY +MAP +STRUCT +UDT + + Sqrt `sqrt` Square root @@ -12053,32 +12079,6 @@ are limited. -Expression -SQL Functions(s) -Description -Notes -Context -Param/Output -BOOLEAN -BYTE -SHORT -INT -LONG -FLOAT -DOUBLE -DATE -TIMESTAMP -STRING -DECIMAL -NULL -BINARY -CALENDAR -ARRAY -MAP -STRUCT -UDT - - StringLocate `position`, `locate` Substring search operator @@ -12168,6 +12168,32 @@ are limited. +Expression +SQL Functions(s) +Description +Notes +Context +Param/Output +BOOLEAN +BYTE +SHORT +INT +LONG +FLOAT +DOUBLE +DATE +TIMESTAMP +STRING +DECIMAL +NULL +BINARY +CALENDAR +ARRAY +MAP +STRUCT +UDT + + StringRPad `rpad` Pad a string on the right @@ -12390,54 +12416,28 @@ are limited. - - - -result - - - - - - - - - -S - - - - - - - - - - -Expression -SQL Functions(s) -Description -Notes -Context -Param/Output -BOOLEAN -BYTE -SHORT -INT -LONG -FLOAT -DOUBLE -DATE -TIMESTAMP -STRING -DECIMAL -NULL -BINARY -CALENDAR -ARRAY -MAP -STRUCT -UDT + + + +result + + + + + + + + + +S + + + + + + + + StringSplit @@ -12529,6 +12529,32 @@ are limited. +Expression +SQL Functions(s) +Description +Notes +Context +Param/Output +BOOLEAN +BYTE +SHORT +INT +LONG +FLOAT +DOUBLE +DATE +TIMESTAMP +STRING +DECIMAL +NULL +BINARY +CALENDAR +ARRAY +MAP +STRUCT +UDT + + StringToMap `str_to_map` Creates a map after splitting the input string into pairs of key-value strings @@ -12822,32 +12848,6 @@ are limited. -Expression -SQL Functions(s) -Description -Notes -Context -Param/Output -BOOLEAN -BYTE -SHORT -INT -LONG -FLOAT -DOUBLE -DATE -TIMESTAMP -STRING -DECIMAL -NULL -BINARY -CALENDAR -ARRAY -MAP -STRUCT -UDT - - Substring `substr`, `substring` Substring operator @@ -12937,6 +12937,32 @@ are limited. +Expression +SQL Functions(s) +Description +Notes +Context +Param/Output +BOOLEAN +BYTE +SHORT +INT +LONG +FLOAT +DOUBLE +DATE +TIMESTAMP +STRING +DECIMAL +NULL +BINARY +CALENDAR +ARRAY +MAP +STRUCT +UDT + + SubstringIndex `substring_index` substring_index operator @@ -13248,32 +13274,6 @@ are limited. -Expression -SQL Functions(s) -Description -Notes -Context -Param/Output -BOOLEAN -BYTE -SHORT -INT -LONG -FLOAT -DOUBLE -DATE -TIMESTAMP -STRING -DECIMAL -NULL -BINARY -CALENDAR -ARRAY -MAP -STRUCT -UDT - - Tanh `tanh` Hyperbolic tangent @@ -13364,6 +13364,32 @@ are limited. +Expression +SQL Functions(s) +Description +Notes +Context +Param/Output +BOOLEAN +BYTE +SHORT +INT +LONG +FLOAT +DOUBLE +DATE +TIMESTAMP +STRING +DECIMAL +NULL +BINARY +CALENDAR +ARRAY +MAP +STRUCT +UDT + + TimeAdd Adds interval to timestamp @@ -13662,32 +13688,6 @@ are limited. -Expression -SQL Functions(s) -Description -Notes -Context -Param/Output -BOOLEAN -BYTE -SHORT -INT -LONG -FLOAT -DOUBLE -DATE -TIMESTAMP -STRING -DECIMAL -NULL -BINARY -CALENDAR -ARRAY -MAP -STRUCT -UDT - - TransformValues `transform_values` Transform values in a map using a transform function @@ -13756,6 +13756,32 @@ are limited. +Expression +SQL Functions(s) +Description +Notes +Context +Param/Output +BOOLEAN +BYTE +SHORT +INT +LONG +FLOAT +DOUBLE +DATE +TIMESTAMP +STRING +DECIMAL +NULL +BINARY +CALENDAR +ARRAY +MAP +STRUCT +UDT + + UnaryMinus `negative` Negate a numeric value @@ -14056,32 +14082,6 @@ are limited. -Expression -SQL Functions(s) -Description -Notes -Context -Param/Output -BOOLEAN -BYTE -SHORT -INT -LONG -FLOAT -DOUBLE -DATE -TIMESTAMP -STRING -DECIMAL -NULL -BINARY -CALENDAR -ARRAY -MAP -STRUCT -UDT - - UnscaledValue Convert a Decimal to an unscaled long value for some aggregation optimizations @@ -14129,6 +14129,32 @@ are limited. +Expression +SQL Functions(s) +Description +Notes +Context +Param/Output +BOOLEAN +BYTE +SHORT +INT +LONG +FLOAT +DOUBLE +DATE +TIMESTAMP +STRING +DECIMAL +NULL +BINARY +CALENDAR +ARRAY +MAP +STRUCT +UDT + + Upper `upper`, `ucase` String uppercase operator