Package com.twilio.kudu.sql
Class ComparisonPredicate
java.lang.Object
com.twilio.kudu.sql.CalciteKuduPredicate
com.twilio.kudu.sql.ComparisonPredicate
An implementation of
CalciteKuduPredicate
that creates comparison
KuduPredicate
KuduPredicate.newComparisonPredicate(ColumnSchema, org.apache.kudu.client.KuduPredicate.ComparisonOp, Object)
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal int
final org.apache.kudu.client.KuduPredicate.ComparisonOp
final Object
-
Constructor Summary
ConstructorsConstructorDescriptionComparisonPredicate
(int columnIdx, org.apache.kudu.client.KuduPredicate.ComparisonOp operation, Object rightHandValue) -
Method Summary
Modifier and TypeMethodDescriptionboolean
explainPredicate
(org.apache.kudu.ColumnSchema schema) Constructs a string used when generating the explain planint
returns the column index for this predicateint
hashCode()
boolean
inListOptimizationAllowed
(int columnIdx) Returns true or false if this can be considered for in list optimization.org.apache.kudu.client.KuduPredicate
toPredicate
(org.apache.kudu.ColumnSchema columnSchema, boolean invertValue) In order to support descending ordered primary key column we invert the column value (see MutationState.getColumnValue())toString()
Methods inherited from class com.twilio.kudu.sql.CalciteKuduPredicate
invertComparisonOp, toPredicate
-
Field Details
-
operation
public final org.apache.kudu.client.KuduPredicate.ComparisonOp operation -
rightHandValue
-
columnIdx
public final int columnIdx
-
-
Constructor Details
-
ComparisonPredicate
public ComparisonPredicate(int columnIdx, org.apache.kudu.client.KuduPredicate.ComparisonOp operation, Object rightHandValue)
-
-
Method Details
-
getColumnIdx
public int getColumnIdx()Description copied from class:CalciteKuduPredicate
returns the column index for this predicate- Specified by:
getColumnIdx
in classCalciteKuduPredicate
- Returns:
- integer of the column in Kudu
-
inListOptimizationAllowed
public boolean inListOptimizationAllowed(int columnIdx) Description copied from class:CalciteKuduPredicate
Returns true or false if this can be considered for in list optimization.- Overrides:
inListOptimizationAllowed
in classCalciteKuduPredicate
- Parameters:
columnIdx
- the column index in theKuduTable
- Returns:
- true if this column and predicate can be optimized into an
InListPredicate
-
explainPredicate
Description copied from class:CalciteKuduPredicate
Constructs a string used when generating the explain plan- Specified by:
explainPredicate
in classCalciteKuduPredicate
- Parameters:
schema
- Schema of the column from Kudu- Returns:
- Formatted string from
RelWriter
to use
-
toPredicate
public org.apache.kudu.client.KuduPredicate toPredicate(org.apache.kudu.ColumnSchema columnSchema, boolean invertValue) In order to support descending ordered primary key column we invert the column value (see MutationState.getColumnValue())- Specified by:
toPredicate
in classCalciteKuduPredicate
- Parameters:
columnSchema
- column schema to use for the predicateinvertValue
- true if the column is stored in descending order- Returns:
KuduPredicate
that represents this POJO
-
hashCode
public int hashCode() -
equals
-
toString
-