Package com.twilio.kudu.sql
Class CalciteKuduPredicate
- java.lang.Object
-
- com.twilio.kudu.sql.CalciteKuduPredicate
-
- Direct Known Subclasses:
ComparisonPredicate
,InListPredicate
,NullPredicate
public abstract class CalciteKuduPredicate extends Object
A simple "case" class / POJO to help with code generation inKuduToEnumerableConverter
. Simplifies theExpression
generation so it is more readable
-
-
Constructor Summary
Constructors Constructor Description CalciteKuduPredicate()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract String
explainPredicate(org.apache.kudu.ColumnSchema columnSchema)
Constructs a string used when generating the explain planabstract int
getColumnIdx()
returns the column index for this predicateboolean
inListOptimizationAllowed(int columnIdx)
Returns true or false if this can be considered for in list optimization.protected org.apache.kudu.client.KuduPredicate.ComparisonOp
invertComparisonOp(org.apache.kudu.client.KuduPredicate.ComparisonOp currentOp)
org.apache.kudu.client.KuduPredicate
toPredicate(CalciteKuduTable calciteKuduTable)
Transforms this POJO into a properKuduPredicate
abstract org.apache.kudu.client.KuduPredicate
toPredicate(org.apache.kudu.ColumnSchema columnSchema, boolean invertValue)
Transforms this POJO into a properKuduPredicate
-
-
-
Method Detail
-
toPredicate
public abstract org.apache.kudu.client.KuduPredicate toPredicate(org.apache.kudu.ColumnSchema columnSchema, boolean invertValue)
Transforms this POJO into a properKuduPredicate
- Parameters:
columnSchema
- column schema to use for the predicateinvertValue
- true if the column is stored in descending order- Returns:
KuduPredicate
that represents this POJO
-
getColumnIdx
public abstract int getColumnIdx()
returns the column index for this predicate- Returns:
- integer of the column in Kudu
-
explainPredicate
public abstract String explainPredicate(org.apache.kudu.ColumnSchema columnSchema)
Constructs a string used when generating the explain plan- Parameters:
columnSchema
- Schema of the column from Kudu- Returns:
- Formatted string from
RelWriter
to use
-
inListOptimizationAllowed
public boolean inListOptimizationAllowed(int columnIdx)
Returns true or false if this can be considered for in list optimization.- Parameters:
columnIdx
- the column index in theKuduTable
- Returns:
- true if this column and predicate can be optimized into an
InListPredicate
-
toPredicate
public org.apache.kudu.client.KuduPredicate toPredicate(CalciteKuduTable calciteKuduTable)
Transforms this POJO into a properKuduPredicate
- Parameters:
calciteKuduTable
- table to use to generate predicate- Returns:
KuduPredicate
that represents this POJO
-
invertComparisonOp
protected org.apache.kudu.client.KuduPredicate.ComparisonOp invertComparisonOp(org.apache.kudu.client.KuduPredicate.ComparisonOp currentOp)
-
-