@Internal public final class ApiExpressionUtils extends Object
Expression
s.Modifier and Type | Field and Description |
---|---|
static long |
MILLIS_PER_DAY |
static long |
MILLIS_PER_HOUR |
static long |
MILLIS_PER_MINUTE |
static long |
MILLIS_PER_SECOND |
public static final long MILLIS_PER_SECOND
public static final long MILLIS_PER_MINUTE
public static final long MILLIS_PER_HOUR
public static final long MILLIS_PER_DAY
public static Expression objectToExpression(Object expression)
It converts:
null
to null literal
Row
to a call to a row constructor expression
Map
to a call to a map constructor expression
List
to a call to an array constructor expression
Seq
to an array constructor via reflection
Map
to a map constructor via reflection
BigDecimal
to a DECIMAL literal
valueLiteral(Object)
expression
- An object to convert to an expressionpublic static Expression unwrapFromApi(Expression expression)
public static LocalReferenceExpression localRef(String name, DataType dataType)
public static ValueLiteralExpression valueLiteral(Object value)
public static ValueLiteralExpression valueLiteral(Object value, DataType dataType)
public static TypeLiteralExpression typeLiteral(DataType dataType)
public static UnresolvedReferenceExpression unresolvedRef(String name)
public static UnresolvedCallExpression unresolvedCall(ContextResolvedFunction resolvedFunction, Expression... args)
public static UnresolvedCallExpression unresolvedCall(ContextResolvedFunction resolvedFunction, List<Expression> args)
public static UnresolvedCallExpression unresolvedCall(FunctionDefinition functionDefinition, Expression... args)
public static UnresolvedCallExpression unresolvedCall(FunctionDefinition functionDefinition, List<Expression> args)
public static TableReferenceExpression tableRef(String name, Table table)
public static TableReferenceExpression tableRef(String name, QueryOperation queryOperation)
public static LookupCallExpression lookupCall(String name, Expression... args)
public static SqlCallExpression sqlCall(String sqlExpression)
public static Expression toMonthInterval(Expression e, int multiplier)
public static ValueLiteralExpression intervalOfMillis(long millis)
public static Expression toMilliInterval(Expression e, long multiplier)
public static ValueLiteralExpression intervalOfMonths(int months)
public static Expression toRowInterval(Expression e)
public static boolean isFunctionOfKind(Expression expression, FunctionKind kind)
expression
- expression to checkkind
- expected type of functionpublic static boolean isFunction(Expression expression, BuiltInFunctionDefinition functionDefinition)
expression
- expression to checkfunctionDefinition
- expected function definitionCopyright © 2014–2024 The Apache Software Foundation. All rights reserved.