Interface IPredicate
public interface IPredicate
Definition of a analyzed predicate.
This is the foundation of an analyzed predicate (ie. WHERE or JOIN condition). Core analyzes a predicate and splits it into pairs. Common predicate types are provided for easier process by catalogs. More complex predicates (nested AND/OR etc.) are accessible viagetUndefinedExpression()and can be utilized via a custom.IExpressionVisitorExample: a.col = b.col AND a.col1 = '10' AND a.col2 LIKE 'abc%' AND a.col3 IN (1,2,3) AND someFunc() AND a.col4 IS NULL This will yield 4 analyzed pairs - COMPARISON (EQ) => a.col1 = '10' - LIKE => a.col2 LIKE 'abc%' - IN => a.bol3 IN (1,2,3) - FUNCTION_CALL => someFunc() - NULL => a.col4 IS NULL Catalogs can pick those types/columns that it supports and handle them at the data source level to avoid core to process to much data.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionReturn comparison value expression.Return the comparison type.Return the original predicate expression.Return function call expression.Return in expression.Return like expression.Return null predicate expression.Return the qualified column name of this predicate (if any exists).Return the SQL representation of this pair.getType()Return the type of this pairReturn function call expression.
-
Method Details
-
getSqlRepresentation
String getSqlRepresentation()Return the SQL representation of this pair.<some expression> = a.value Will return the SQL representation of '<some expression> = a.value'
-
getType
IPredicate.Type getType()Return the type of this pair -
getQualifiedColumn
QualifiedName getQualifiedColumn()Return the qualified column name of this predicate (if any exists). If no column is present null is returned -
getFullExpression
IExpression getFullExpression()Return the original predicate expression. Is used when a more complex traversal is used and all convenience methods below isn't used. -
getComparisonExpression
IExpression getComparisonExpression()Return comparison value expression. Only applicable ifgetType()isIPredicate.Type.COMPARISION. This returns the "other" side of the comparison regarding thegetQualifiedColumn().ie. 10 < col Here ILiteralIntegerExpression(10) will be returned
-
getComparisonType
IComparisonExpression.Type getComparisonType()Return the comparison type. Only applicable ifgetType()isIPredicate.Type.COMPARISION -
getInExpression
IInExpression getInExpression()Return in expression. Only applicable ifgetType()isIPredicate.Type.IN -
getLikeExpression
ILikeExpression getLikeExpression()Return like expression. Only applicable ifgetType()isIPredicate.Type.LIKE -
getNullPredicateExpression
INullPredicateExpression getNullPredicateExpression()Return null predicate expression. Only applicable ifgetType()isIPredicate.Type.NULL -
getFunctionCallExpression
IFunctionCallExpression getFunctionCallExpression()Return function call expression. Only applicable ifgetType()isIPredicate.Type.FUNCTION_CALL -
getUndefinedExpression
IExpression getUndefinedExpression()Return function call expression. Only applicable ifgetType()isIPredicate.Type.UNDEFINED
-