Package org.apache.flink.table.functions
Interface SqlCallSyntax
@Internal
public interface SqlCallSyntax
Provides a format for unparsing
BuiltInFunctionDefinitions into a SQL string.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SqlCallSyntaxSpecial sql syntax for AS.static final SqlCallSyntaxBinary operator syntax, as in "x - y".static final SqlCallSyntaxSpecial sql syntax for CAST operators (CAST, TRY_CAST, REINTERPRET_CAST).static final SqlCallSyntaxFunction syntax for collection ctors, such as ARRAY[1, 2, 3] or MAP['a', 1, 'b', 2].static final SqlCallSyntaxFunction syntax for handling DISTINCT aggregates.static final SqlCallSyntaxSpecial sql syntax for FLOOR and CEIL.static final SqlCallSyntaxFunction syntax, as in "Foo(x, y)".static final SqlCallSyntaxCall syntax forBuiltInFunctionDefinitions.IN.static final SqlCallSyntaxSpecial sql syntax for LIKE.static final SqlCallSyntaxBinary operator syntax that in Table API can accept multiple operands, as in "x AND y AND t AND w".static final SqlCallSyntaxFunction syntax for functions without parenthesis (e.g., CURRENT_DATE, LOCALTIMESTAMP, LOCALTIME, CURRENT_TIMESTAMP, CURRENT_TIME).static final SqlCallSyntaxstatic final SqlCallSyntaxSpecial sql syntax for OVERLAY.static final SqlCallSyntaxSyntax for unparsing '+', Special handling for a plus on string arguments.static final SqlCallSyntaxSpecial sql syntax for SUBSTRING operators (SUBSTRING, SUBSTR).static final SqlCallSyntaxSpecial sql syntax for TRIM.static final SqlCallSyntaxPrefix unary operator syntax, as in "- x".static final SqlCallSyntaxPostfix unary operator syntax, as in "x ++".static final SqlCallSyntax -
Method Summary
Modifier and TypeMethodDescriptionunparse(String sqlName, List<ResolvedExpression> operands) default StringunparseDistinct(String sqlName, List<ResolvedExpression> operands) Special case for aggregate functions, which can have a DISTINCT function applied.
-
Field Details
-
FUNCTION
Function syntax, as in "Foo(x, y)". -
NO_PARENTHESIS
Function syntax for functions without parenthesis (e.g., CURRENT_DATE, LOCALTIMESTAMP, LOCALTIME, CURRENT_TIMESTAMP, CURRENT_TIME). -
DISTINCT
Function syntax for handling DISTINCT aggregates. Special case. It does not have a syntax itself, but modifies the syntax of the nested call. -
COLLECTION_CTOR
Function syntax for collection ctors, such as ARRAY[1, 2, 3] or MAP['a', 1, 'b', 2]. -
BINARY_OP
Binary operator syntax, as in "x - y". -
PLUS_OP
Syntax for unparsing '+', Special handling for a plus on string arguments. -
MULTIPLE_BINARY_OP
Binary operator syntax that in Table API can accept multiple operands, as in "x AND y AND t AND w". -
UNARY_SUFFIX_OP
Postfix unary operator syntax, as in "x ++". -
UNARY_PREFIX_OP
Prefix unary operator syntax, as in "- x". -
CAST
Special sql syntax for CAST operators (CAST, TRY_CAST, REINTERPRET_CAST).Example: CAST(123 AS STRING)
-
SUBSTRING
Special sql syntax for SUBSTRING operators (SUBSTRING, SUBSTR).Example: SUBSTR('abc' FROM 'abcdef' FOR 3)
-
FLOOR_OR_CEIL
Special sql syntax for FLOOR and CEIL.Examples:
- FLOOR(TIME ‘12:44:31’ TO MINUTE)
- FLOOR(123)
-
TRIM
Special sql syntax for TRIM.Example: TRIM(BOTH ' ' FROM ' 0 ');
-
OVERLAY
Special sql syntax for OVERLAY.Example: OVERLAY('abcd' PLACING 'def' FROM 3 FOR 2)
-
AS
Special sql syntax for AS. The string literal is formatted as an identifier. -
IN
Call syntax forBuiltInFunctionDefinitions.IN. -
WINDOW_START_END
-
LIKE
Special sql syntax for LIKE.Example: 'TE_ST' LIKE '%E&_S%' ESCAPE '&';
-
OVER
-
-
Method Details
-
unparse
-
unparseDistinct
Special case for aggregate functions, which can have a DISTINCT function applied. Called only from the DISTINCT function.
-