public interface ImplicitExpressionOperations
Expression
AST for expression
operations.
These operations must be kept in sync with the parser in
ExpressionParser
.
Modifier and Type | Method and Description |
---|---|
Abs |
abs()
Calculates the absolute value of given value.
|
Alias |
as(scala.Symbol name,
scala.collection.Seq<scala.Symbol> extraNames)
Specifies a name for an expression i.e.
|
Asc |
asc() |
ArrayElementAt |
at(Expression index)
Accesses the element of an array based on an index (starting at 1).
|
Avg |
avg()
Returns the average (arithmetic mean) of the numeric field across all input values.
|
ArrayCardinality |
cardinality()
Returns the number of elements of an array.
|
Cast |
cast(TypeInformation<?> toType)
Converts a value to a given type.
|
Ceil |
ceil()
Calculates the smallest integer greater than or equal to a given number.
|
TemporalCeil |
ceil(TableSymbols.TableSymbolValue timeIntervalUnit)
Rounds up a time point to the given unit.
|
CharLength |
charLength()
Returns the length of a string.
|
Count |
count()
Returns the number of input rows for which the field is not null.
|
Expression |
day()
Creates an interval of the given number of days.
|
Expression |
days()
Creates an interval of the given number of days.
|
Desc |
desc() |
ArrayElement |
element()
Returns the sole element of an array with a single element.
|
WindowEnd |
end()
Returns the end time of a window when applied on a window reference.
|
Exp |
exp()
Calculates the Euler's number raised to the given power.
|
Expression |
expr() |
Extract |
extract(TableSymbols.TableSymbolValue timeIntervalUnit)
Extracts parts of a time point or time interval.
|
Flattening |
flatten()
Converts a Flink composite type (such as Tuple, POJO, etc.) and all of its direct subtypes
into a flat representation where every subtype is a separate field.
|
Floor |
floor()
Calculates the largest integer less than or equal to a given number.
|
TemporalFloor |
floor(TableSymbols.TableSymbolValue timeIntervalUnit)
Rounds down a time point to the given unit.
|
GetCompositeField |
get(int index)
Accesses the field of a Flink composite type (such as Tuple, POJO, etc.) by index and
returns it's value.
|
GetCompositeField |
get(String name)
Accesses the field of a Flink composite type (such as Tuple, POJO, etc.) by name and
returns it's value.
|
Expression |
hour()
Creates an interval of the given number of hours.
|
Expression |
hours()
Creates an interval of the given number of hours.
|
InitCap |
initCap()
Converts the initial letter of each word in a string to uppercase.
|
IsFalse |
isFalse()
Returns true if given boolean expression is false.
|
IsNotFalse |
isNotFalse()
Returns true if given boolean expression is not false (for null and true).
|
IsNotNull |
isNotNull()
Returns true if the given expression is not null.
|
IsNotTrue |
isNotTrue()
Returns true if given boolean expression is not true (for null and false).
|
IsNull |
isNull()
Returns true if the given expression is null.
|
IsTrue |
isTrue()
Returns true if given boolean expression is true.
|
Like |
like(Expression pattern)
Returns true, if a string matches the specified LIKE pattern.
|
Ln |
ln()
Calculates the natural logarithm of given value.
|
Log10 |
log10()
Calculates the base 10 logarithm of given value.
|
Lower |
lowerCase()
Returns all of the characters in a string in lower case using the rules of
the default locale.
|
Max |
max()
Returns the maximum value of field across all input values.
|
Expression |
milli()
Creates an interval of the given number of milliseconds.
|
Expression |
millis()
Creates an interval of the given number of milliseconds.
|
Min |
min()
Returns the minimum value of field across all input values.
|
Expression |
minute()
Creates an interval of the given number of minutes.
|
Expression |
minutes()
Creates an interval of the given number of minutes.
|
Mod |
mod(Expression other)
Calculates the remainder of division the given number by another one.
|
Expression |
month()
Creates an interval of the given number of months.
|
Expression |
months()
Creates an interval of the given number of months.
|
Overlay |
overlay(Expression newString,
Expression starting)
Replaces a substring of string with a string starting at a position (starting at 1).
|
Overlay |
overlay(Expression newString,
Expression starting,
Expression length)
Replaces a substring of string with a string starting at a position (starting at 1).
|
Position |
position(Expression haystack)
Returns the position of string in an other string starting at 1.
|
Power |
power(Expression other)
Calculates the given number raised to the power of the other value.
|
Quarter |
quarter()
Returns the quarter of a year from a SQL date.
|
Expression |
rows()
Creates an interval of rows.
|
Expression |
second()
Creates an interval of the given number of seconds.
|
Expression |
seconds()
Creates an interval of the given number of seconds.
|
Similar |
similar(Expression pattern)
Returns true, if a string matches the specified SQL regex pattern.
|
Sqrt |
sqrt()
Calculates the square root of a given value.
|
WindowStart |
start()
Returns the start time of a window when applied on a window reference.
|
Substring |
substring(Expression beginIndex)
Creates a substring of the given string beginning at the given index to the end.
|
Substring |
substring(Expression beginIndex,
Expression length)
Creates a substring of the given string at given index for a given length.
|
Sum |
sum()
Returns the sum of the numeric field across all input values.
|
Cast |
toDate()
Parses a date string in the form "yy-mm-dd" to a SQL Date.
|
Expression |
toExpr()
Enables literals on left side of binary expressions.
|
Cast |
toTime()
Parses a time string in the form "hh:mm:ss" to a SQL Time.
|
Cast |
toTimestamp()
Parses a timestamp string in the form "yy-mm-dd hh:mm:ss.fff" to a SQL Timestamp.
|
Expression |
trim(boolean removeLeading,
boolean removeTrailing,
Expression character)
Removes leading and/or trailing characters from the given string.
|
Upper |
upperCase()
Returns all of the characters in a string in upper case using the rules of
the default locale.
|
Expression |
year()
Creates an interval of the given number of years.
|
Expression |
years()
Creates an interval of the given number of years.
|
Expression expr()
Expression toExpr()
e.g. 12.toExpr % 'a
IsNull isNull()
IsNotNull isNotNull()
IsTrue isTrue()
IsFalse isFalse()
IsNotTrue isNotTrue()
IsNotFalse isNotFalse()
Sum sum()
Min min()
Max max()
Count count()
Avg avg()
Cast cast(TypeInformation<?> toType)
e.g. "42".cast(Types.INT) leads to 42.
Alias as(scala.Symbol name, scala.collection.Seq<scala.Symbol> extraNames)
name
- name for one fieldextraNames
- additional names if the expression expands to multiple fieldsAsc asc()
Desc desc()
WindowStart start()
WindowEnd end()
Mod mod(Expression other)
Exp exp()
Log10 log10()
Ln ln()
Power power(Expression other)
Sqrt sqrt()
Abs abs()
Floor floor()
Ceil ceil()
Substring substring(Expression beginIndex, Expression length)
beginIndex
- first character of the substring (starting at 1, inclusive)length
- number of characters of the substringSubstring substring(Expression beginIndex)
beginIndex
- first character of the substring (starting at 1, inclusive)Expression trim(boolean removeLeading, boolean removeTrailing, Expression character)
removeLeading
- if true, remove leading characters (default: true)removeTrailing
- if true, remove trailing characters (default: true)character
- string containing the character (default: " ")CharLength charLength()
Upper upperCase()
Lower lowerCase()
InitCap initCap()
Like like(Expression pattern)
e.g. "Jo_n%" matches all strings that start with "Jo(arbitrary letter)n"
Similar similar(Expression pattern)
e.g. "A+" matches all strings that consist of at least one A
Position position(Expression haystack)
e.g. "a".position("bbbbba") leads to 6
Overlay overlay(Expression newString, Expression starting)
e.g. "xxxxxtest".overlay("xxxx", 6) leads to "xxxxxxxxx"
Overlay overlay(Expression newString, Expression starting, Expression length)
e.g. "xxxxxtest".overlay("xxxx", 6, 2) leads to "xxxxxxxxxst"
Cast toDate()
Cast toTime()
Cast toTimestamp()
Extract extract(TableSymbols.TableSymbolValue timeIntervalUnit)
e.g. "2006-06-05".toDate.extract(DAY) leads to 5
Quarter quarter()
e.g. "1994-09-27".toDate.quarter() leads to 3
TemporalFloor floor(TableSymbols.TableSymbolValue timeIntervalUnit)
e.g. "12:44:31".toDate.floor(MINUTE) leads to 12:44:00
TemporalCeil ceil(TableSymbols.TableSymbolValue timeIntervalUnit)
e.g. "12:44:31".toDate.ceil(MINUTE) leads to 12:45:00
Expression year()
Expression years()
Expression month()
Expression months()
Expression day()
Expression days()
Expression hour()
Expression hours()
Expression minute()
Expression minutes()
Expression second()
Expression seconds()
Expression milli()
Expression millis()
Expression rows()
GetCompositeField get(String name)
name
- name of the field (similar to Flink's field expressions)GetCompositeField get(int index)
index
- position of the fieldFlattening flatten()
ArrayElementAt at(Expression index)
index
- position of the element (starting at 1)ArrayCardinality cardinality()
ArrayElement element()
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.