Package com.twilio.kudu.sql
Class CalciteKuduPredicate
java.lang.Object
com.twilio.kudu.sql.CalciteKuduPredicate
- Direct Known Subclasses:
ComparisonPredicate
,InListPredicate
,NullPredicate
A simple "case" class / POJO to help with code generation in
KuduToEnumerableConverter
. Simplifies the
Expression
generation so it is more
readable-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract String
explainPredicate
(org.apache.kudu.ColumnSchema columnSchema) Constructs a string used when generating the explain planabstract int
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
-
Constructor Details
-
CalciteKuduPredicate
public CalciteKuduPredicate()
-
-
Method Details
-
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
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
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)
-