Class GeneralScalarExpression
Object
org.apache.spark.sql.internal.connector.ExpressionWithToString
org.apache.spark.sql.connector.expressions.GeneralScalarExpression
- All Implemented Interfaces:
Serializable
,Expression
- Direct Known Subclasses:
Predicate
@Evolving
public class GeneralScalarExpression
extends org.apache.spark.sql.internal.connector.ExpressionWithToString
The general representation of SQL scalar expressions, which contains the upper-cased
expression name and all the children expressions. Please also see
Predicate
for the supported predicate expressions.
The currently supported SQL scalar expressions:
- Name:
+
- SQL semantic:
expr1 + expr2
- Since version: 3.3.0
- SQL semantic:
- Name:
-
- SQL semantic:
expr1 - expr2
or- expr
- Since version: 3.3.0
- SQL semantic:
- Name:
*
- SQL semantic:
expr1 * expr2
- Since version: 3.3.0
- SQL semantic:
- Name:
/
- SQL semantic:
expr1 / expr2
- Since version: 3.3.0
- SQL semantic:
- Name:
%
- SQL semantic:
expr1 % expr2
- Since version: 3.3.0
- SQL semantic:
- Name:
&
- SQL semantic:
expr1 & expr2
- Since version: 3.3.0
- SQL semantic:
- Name:
|
- SQL semantic:
expr1 | expr2
- Since version: 3.3.0
- SQL semantic:
- Name:
^
- SQL semantic:
expr1 ^ expr2
- Since version: 3.3.0
- SQL semantic:
- Name:
~
- SQL semantic:
~ expr
- Since version: 3.3.0
- SQL semantic:
- Name:
CASE_WHEN
- SQL semantic:
CASE WHEN expr1 THEN expr2 [WHEN expr3 THEN expr4]* [ELSE expr5] END
- Since version: 3.3.0
- SQL semantic:
- Name:
ABS
- SQL semantic:
ABS(expr)
- Since version: 3.3.0
- SQL semantic:
- Name:
COALESCE
- SQL semantic:
COALESCE(expr1, expr2)
- Since version: 3.3.0
- SQL semantic:
- Name:
GREATEST
- SQL semantic:
GREATEST(expr, ...)
- Since version: 3.4.0
- SQL semantic:
- Name:
LEAST
- SQL semantic:
LEAST(expr, ...)
- Since version: 3.4.0
- SQL semantic:
- Name:
RAND
- SQL semantic:
RAND([seed])
- Since version: 3.4.0
- SQL semantic:
- Name:
LOG
- SQL semantic:
LOG(base, expr)
- Since version: 3.4.0
- SQL semantic:
- Name:
LOG10
- SQL semantic:
LOG10(expr)
- Since version: 3.4.0
- SQL semantic:
- Name:
LOG2
- SQL semantic:
LOG2(expr)
- Since version: 3.4.0
- SQL semantic:
- Name:
LN
- SQL semantic:
LN(expr)
- Since version: 3.3.0
- SQL semantic:
- Name:
EXP
- SQL semantic:
EXP(expr)
- Since version: 3.3.0
- SQL semantic:
- Name:
POWER
- SQL semantic:
POWER(expr, number)
- Since version: 3.3.0
- SQL semantic:
- Name:
SQRT
- SQL semantic:
SQRT(expr)
- Since version: 3.3.0
- SQL semantic:
- Name:
FLOOR
- SQL semantic:
FLOOR(expr)
- Since version: 3.3.0
- SQL semantic:
- Name:
CEIL
- SQL semantic:
CEIL(expr)
- Since version: 3.3.0
- SQL semantic:
- Name:
ROUND
- SQL semantic:
ROUND(expr, [scale])
- Since version: 3.4.0
- SQL semantic:
- Name:
SIN
- SQL semantic:
SIN(expr)
- Since version: 3.4.0
- SQL semantic:
- Name:
SINH
- SQL semantic:
SINH(expr)
- Since version: 3.4.0
- SQL semantic:
- Name:
COS
- SQL semantic:
COS(expr)
- Since version: 3.4.0
- SQL semantic:
- Name:
COSH
- SQL semantic:
COSH(expr)
- Since version: 3.4.0
- SQL semantic:
- Name:
TAN
- SQL semantic:
TAN(expr)
- Since version: 3.4.0
- SQL semantic:
- Name:
TANH
- SQL semantic:
TANH(expr)
- Since version: 3.4.0
- SQL semantic:
- Name:
COT
- SQL semantic:
COT(expr)
- Since version: 3.4.0
- SQL semantic:
- Name:
ASIN
- SQL semantic:
ASIN(expr)
- Since version: 3.4.0
- SQL semantic:
- Name:
ASINH
- SQL semantic:
ASINH(expr)
- Since version: 3.4.0
- SQL semantic:
- Name:
ACOS
- SQL semantic:
ACOS(expr)
- Since version: 3.4.0
- SQL semantic:
- Name:
ACOSH
- SQL semantic:
ACOSH(expr)
- Since version: 3.4.0
- SQL semantic:
- Name:
ATAN
- SQL semantic:
ATAN(expr)
- Since version: 3.4.0
- SQL semantic:
- Name:
ATANH
- SQL semantic:
ATANH(expr)
- Since version: 3.4.0
- SQL semantic:
- Name:
ATAN2
- SQL semantic:
ATAN2(exprY, exprX)
- Since version: 3.4.0
- SQL semantic:
- Name:
CBRT
- SQL semantic:
CBRT(expr)
- Since version: 3.4.0
- SQL semantic:
- Name:
DEGREES
- SQL semantic:
DEGREES(expr)
- Since version: 3.4.0
- SQL semantic:
- Name:
RADIANS
- SQL semantic:
RADIANS(expr)
- Since version: 3.4.0
- SQL semantic:
- Name:
SIGN
- SQL semantic:
SIGN(expr)
- Since version: 3.4.0
- SQL semantic:
- Name:
WIDTH_BUCKET
- SQL semantic:
WIDTH_BUCKET(expr)
- Since version: 3.3.0
- SQL semantic:
- Name:
SUBSTRING
- SQL semantic:
SUBSTRING(str, pos[, len])
- Since version: 3.4.0
- SQL semantic:
- Name:
UPPER
- SQL semantic:
UPPER(expr)
- Since version: 3.4.0
- SQL semantic:
- Name:
LOWER
- SQL semantic:
LOWER(expr)
- Since version: 3.4.0
- SQL semantic:
- Name:
TRANSLATE
- SQL semantic:
TRANSLATE(input, from, to)
- Since version: 3.4.0
- SQL semantic:
- Name:
TRIM
- SQL semantic:
TRIM(src, trim)
- Since version: 3.4.0
- SQL semantic:
- Name:
LTRIM
- SQL semantic:
LTRIM(src, trim)
- Since version: 3.4.0
- SQL semantic:
- Name:
RTRIM
- SQL semantic:
RTRIM(src, trim)
- Since version: 3.4.0
- SQL semantic:
- Name:
BIT_LENGTH
- SQL semantic:
BIT_LENGTH(src)
- Since version: 3.4.0
- SQL semantic:
- Name:
CHAR_LENGTH
- SQL semantic:
CHAR_LENGTH(src)
- Since version: 3.4.0
- SQL semantic:
- Name:
CONCAT
- SQL semantic:
CONCAT(col1, col2, ..., colN)
- Since version: 3.4.0
- SQL semantic:
- Name:
OVERLAY
- SQL semantic:
OVERLAY(string, replace, position[, length])
- Since version: 3.4.0
- SQL semantic:
- Name:
DATE_ADD
- SQL semantic:
DATE_ADD(start_date, num_days)
- Since version: 3.4.0
- SQL semantic:
- Name:
DATE_DIFF
- SQL semantic:
DATE_DIFF(end_date, start_date)
- Since version: 3.4.0
- SQL semantic:
- Name:
TRUNC
- SQL semantic:
TRUNC(date, format)
- Since version: 3.4.0
- SQL semantic:
- Name:
AES_ENCRYPT
- SQL semantic:
AES_ENCRYPT(expr, key[, mode[, padding]])
- Since version: 3.4.0
- SQL semantic:
- Name:
AES_DECRYPT
- SQL semantic:
AES_DECRYPT(expr, key[, mode[, padding]])
- Since version: 3.4.0
- SQL semantic:
- Name:
SHA1
- SQL semantic:
SHA1(expr)
- Since version: 3.4.0
- SQL semantic:
- Name:
SHA2
- SQL semantic:
SHA2(expr, bitLength)
- Since version: 3.4.0
- SQL semantic:
- Name:
MD5
- SQL semantic:
MD5(expr)
- Since version: 3.4.0
- SQL semantic:
- Name:
CRC32
- SQL semantic:
CRC32(expr)
- Since version: 3.4.0
- SQL semantic:
- Since:
- 3.3.0
- See Also:
-
Field Summary
Fields inherited from interface org.apache.spark.sql.connector.expressions.Expression
EMPTY_EXPRESSION, EMPTY_NAMED_REFERENCE
-
Constructor Summary
-
Method Summary
Methods inherited from class org.apache.spark.sql.internal.connector.ExpressionWithToString
describe, references, toString
-
Constructor Details
-
GeneralScalarExpression
-
-
Method Details
-
name
-
children
Description copied from interface:Expression
Returns an array of the children of this node. Children should not change. -
equals
-
hashCode
public int hashCode()
-