Package org.apache.flink.table.functions
Interface SqlCallSyntax
-
@Internal public interface SqlCallSyntaxProvides a format for unparsingBuiltInFunctionDefinitionsinto a SQL string.
-
-
Field Summary
Fields Modifier and Type Field Description static SqlCallSyntaxASSpecial sql syntax for AS.static SqlCallSyntaxBINARY_OPBinary operator syntax, as in "x - y".static SqlCallSyntaxCASTSpecial sql syntax for CAST operators (CAST, TRY_CAST, REINTERPRET_CAST).static SqlCallSyntaxCOLLECTION_CTORFunction syntax for collection ctors, such as ARRAY[1, 2, 3] or MAP['a', 1, 'b', 2].static SqlCallSyntaxDISTINCTFunction syntax for handling DISTINCT aggregates.static SqlCallSyntaxFLOOR_OR_CEILSpecial sql syntax for FLOOR and CEIL.static SqlCallSyntaxFUNCTIONFunction syntax, as in "Foo(x, y)".static SqlCallSyntaxINCall syntax forBuiltInFunctionDefinitions.IN.static SqlCallSyntaxLIKESpecial sql syntax for LIKE.static SqlCallSyntaxMULTIPLE_BINARY_OPBinary operator syntax that in Table API can accept multiple operands, as in "x AND y AND t AND w".static SqlCallSyntaxNO_PARENTHESISFunction syntax for functions without parenthesis (e.g., CURRENT_DATE, LOCALTIMESTAMP, LOCALTIME, CURRENT_TIMESTAMP, CURRENT_TIME).static SqlCallSyntaxOVERstatic SqlCallSyntaxOVERLAYSpecial sql syntax for OVERLAY.static SqlCallSyntaxPLUS_OPSyntax for unparsing '+', Special handling for a plus on string arguments.static SqlCallSyntaxSUBSTRINGSpecial sql syntax for SUBSTRING operators (SUBSTRING, SUBSTR).static SqlCallSyntaxTRIMSpecial sql syntax for TRIM.static SqlCallSyntaxUNARY_PREFIX_OPPrefix unary operator syntax, as in "- x".static SqlCallSyntaxUNARY_SUFFIX_OPPostfix unary operator syntax, as in "x ++".static SqlCallSyntaxWINDOW_START_END
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Stringunparse(String sqlName, List<ResolvedExpression> operands, SqlFactory sqlFactory)default StringunparseDistinct(String sqlName, List<ResolvedExpression> operands, SqlFactory sqlFactory)Special case for aggregate functions, which can have a DISTINCT function applied.
-
-
-
Field Detail
-
FUNCTION
static final SqlCallSyntax FUNCTION
Function syntax, as in "Foo(x, y)".
-
NO_PARENTHESIS
static final SqlCallSyntax NO_PARENTHESIS
Function syntax for functions without parenthesis (e.g., CURRENT_DATE, LOCALTIMESTAMP, LOCALTIME, CURRENT_TIMESTAMP, CURRENT_TIME).
-
DISTINCT
static final SqlCallSyntax 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
static final SqlCallSyntax COLLECTION_CTOR
Function syntax for collection ctors, such as ARRAY[1, 2, 3] or MAP['a', 1, 'b', 2].
-
BINARY_OP
static final SqlCallSyntax BINARY_OP
Binary operator syntax, as in "x - y".
-
PLUS_OP
static final SqlCallSyntax PLUS_OP
Syntax for unparsing '+', Special handling for a plus on string arguments.
-
MULTIPLE_BINARY_OP
static final SqlCallSyntax 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
static final SqlCallSyntax UNARY_SUFFIX_OP
Postfix unary operator syntax, as in "x ++".
-
UNARY_PREFIX_OP
static final SqlCallSyntax UNARY_PREFIX_OP
Prefix unary operator syntax, as in "- x".
-
CAST
static final SqlCallSyntax CAST
Special sql syntax for CAST operators (CAST, TRY_CAST, REINTERPRET_CAST).Example: CAST(123 AS STRING)
-
SUBSTRING
static final SqlCallSyntax SUBSTRING
Special sql syntax for SUBSTRING operators (SUBSTRING, SUBSTR).Example: SUBSTR('abc' FROM 'abcdef' FOR 3)
-
FLOOR_OR_CEIL
static final SqlCallSyntax FLOOR_OR_CEIL
Special sql syntax for FLOOR and CEIL.Examples:
- FLOOR(TIME ‘12:44:31’ TO MINUTE)
- FLOOR(123)
-
TRIM
static final SqlCallSyntax TRIM
Special sql syntax for TRIM.Example: TRIM(BOTH ' ' FROM ' 0 ');
-
OVERLAY
static final SqlCallSyntax OVERLAY
Special sql syntax for OVERLAY.Example: OVERLAY('abcd' PLACING 'def' FROM 3 FOR 2)
-
AS
static final SqlCallSyntax AS
Special sql syntax for AS. The string literal is formatted as an identifier.
-
IN
static final SqlCallSyntax IN
Call syntax forBuiltInFunctionDefinitions.IN.
-
WINDOW_START_END
static final SqlCallSyntax WINDOW_START_END
-
LIKE
static final SqlCallSyntax LIKE
Special sql syntax for LIKE.Example: 'TE_ST' LIKE '%E&_S%' ESCAPE '&';
-
OVER
static final SqlCallSyntax OVER
-
-
Method Detail
-
unparse
String unparse(String sqlName, List<ResolvedExpression> operands, SqlFactory sqlFactory)
-
unparseDistinct
default String unparseDistinct(String sqlName, List<ResolvedExpression> operands, SqlFactory sqlFactory)
Special case for aggregate functions, which can have a DISTINCT function applied. Called only from the DISTINCT function.
-
-