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.
|
Acos |
acos()
Calculates the arc cosine of a given number.
|
Alias |
as(scala.Symbol name,
scala.collection.Seq<scala.Symbol> extraNames)
Specifies a name for an expression i.e.
|
Asc |
asc()
Specifies ascending order of an expression i.e.
|
Asin |
asin()
Calculates the arc sine of a given number.
|
ArrayElementAt |
at(Expression index)
Accesses the element of an array based on an index (starting at 1).
|
Atan |
atan()
Calculates the arc tangent of a given number.
|
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.
|
Cos |
cos()
Calculates the cosine of a given number.
|
Cot |
cot()
Calculates the cotangent of a given number.
|
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.
|
Degrees |
degrees()
Converts numeric from radians to degrees.
|
Desc |
desc()
Specifies descending order of an expression i.e.
|
ArrayElement |
element()
Returns the sole element of an array with a single element.
|
WindowEnd |
end()
Returns the end time (exclusive) 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.
|
UnresolvedOverCall |
over(Expression alias)
For windowing function to config over window
e.g.:
table
.window(Over partitionBy 'c orderBy 'rowtime preceding 2.rows following CURRENT_ROW as 'w)
.select('c, 'a, 'a.count over 'w, 'a.sum over 'w)
|
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.
|
ProctimeAttribute |
proctime()
Declares a field as the proctime attribute for indicating, accessing, and working in
Flink's processing time.
|
Quarter |
quarter()
Returns the quarter of a year from a SQL date.
|
Radians |
radians()
Converts numeric from degrees to radians.
|
Round |
round(Expression places)
Rounds the given number to integer places right to the decimal point.
|
Expression |
rows()
Creates an interval of rows.
|
RowtimeAttribute |
rowtime()
Declares a field as the rowtime attribute for indicating, accessing, and working in
Flink's event time.
|
Expression |
second()
Creates an interval of the given number of seconds.
|
Expression |
seconds()
Creates an interval of the given number of seconds.
|
Sign |
sign()
Calculates the signum of a given number.
|
Similar |
similar(Expression pattern)
Returns true, if a string matches the specified SQL regex pattern.
|
Sin |
sin()
Calculates the sine of a given number.
|
Sqrt |
sqrt()
Calculates the square root of a given value.
|
WindowStart |
start()
Returns the start time (inclusive) of a window when applied on a window reference.
|
StddevPop |
stddevPop()
Returns the population standard deviation of an expression (the square root of varPop()).
|
StddevSamp |
stddevSamp()
Returns the sample standard deviation of an expression (the square root of varSamp()).
|
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.
|
Sum0 |
sum0()
Returns the sum of the numeric field across all input values.
|
Tan |
tan()
Calculates the tangent of a given number.
|
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.
|
VarPop |
varPop()
Returns the population standard variance of an expression.
|
VarSamp |
varSamp()
Returns the sample variance of a given expression.
|
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()
Sum0 sum0()
Min min()
Max max()
Count count()
Avg avg()
StddevPop stddevPop()
StddevSamp stddevSamp()
VarPop varPop()
VarSamp varSamp()
Cast cast(TypeInformation<?> toType)
e.g. "42".cast(Types.INT) leads to 42.
toType
- (undocumented)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()
e.g. if a window ends at 10:59:59.999 this property will return 11:00:00.000.
Mod mod(Expression other)
other
- (undocumented)Exp exp()
Log10 log10()
Ln ln()
Power power(Expression other)
other
- (undocumented)Sqrt sqrt()
Abs abs()
Floor floor()
Ceil ceil()
Sin sin()
Cos cos()
Tan tan()
Cot cot()
Asin asin()
Acos acos()
Atan atan()
Degrees degrees()
Radians radians()
Sign sign()
Round round(Expression places)
places
- (undocumented)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"
pattern
- (undocumented)Similar similar(Expression pattern)
e.g. "A+" matches all strings that consist of at least one A
pattern
- (undocumented)Position position(Expression haystack)
e.g. "a".position("bbbbba") leads to 6
haystack
- (undocumented)UnresolvedOverCall over(Expression alias)
alias
- (undocumented)Overlay overlay(Expression newString, Expression starting)
e.g. "xxxxxtest".overlay("xxxx", 6) leads to "xxxxxxxxx"
newString
- (undocumented)starting
- (undocumented)Overlay overlay(Expression newString, Expression starting, Expression length)
e.g. "xxxxxtest".overlay("xxxx", 6, 2) leads to "xxxxxxxxxst"
newString
- (undocumented)starting
- (undocumented)length
- (undocumented)Cast toDate()
Cast toTime()
Cast toTimestamp()
Extract extract(TableSymbols.TableSymbolValue timeIntervalUnit)
e.g. "2006-06-05".toDate.extract(DAY) leads to 5
timeIntervalUnit
- (undocumented)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
timeIntervalUnit
- (undocumented)TemporalCeil ceil(TableSymbols.TableSymbolValue timeIntervalUnit)
e.g. "12:44:31".toDate.ceil(MINUTE) leads to 12:45:00
timeIntervalUnit
- (undocumented)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()
RowtimeAttribute rowtime()
ProctimeAttribute proctime()
Copyright © 2014–2018 The Apache Software Foundation. All rights reserved.