Class ComparisonPredicate

java.lang.Object
com.twilio.kudu.sql.CalciteKuduPredicate
com.twilio.kudu.sql.ComparisonPredicate

public final class ComparisonPredicate extends CalciteKuduPredicate
An implementation of CalciteKuduPredicate that creates comparison KuduPredicate KuduPredicate.newComparisonPredicate(ColumnSchema, org.apache.kudu.client.KuduPredicate.ComparisonOp, Object)
  • Field Details

    • operation

      public final org.apache.kudu.client.KuduPredicate.ComparisonOp operation
    • rightHandValue

      public final Object 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 class CalciteKuduPredicate
      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 class CalciteKuduPredicate
      Parameters:
      columnIdx - the column index in the KuduTable
      Returns:
      true if this column and predicate can be optimized into an InListPredicate
    • explainPredicate

      public String explainPredicate(org.apache.kudu.ColumnSchema schema)
      Description copied from class: CalciteKuduPredicate
      Constructs a string used when generating the explain plan
      Specified by:
      explainPredicate in class CalciteKuduPredicate
      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 class CalciteKuduPredicate
      Parameters:
      columnSchema - column schema to use for the predicate
      invertValue - true if the column is stored in descending order
      Returns:
      KuduPredicate that represents this POJO
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object