Package com.twilio.kudu.sql.rules
Class RowValueExpressionConverter
- java.lang.Object
-
- org.apache.calcite.rex.RexShuttle
-
- com.twilio.kudu.sql.rules.RowValueExpressionConverter
-
- All Implemented Interfaces:
org.apache.calcite.rex.RexVisitor<org.apache.calcite.rex.RexNode>
public class RowValueExpressionConverter extends org.apache.calcite.rex.RexShuttle
Used to paginate through rows in the order of the primary key columns by comparing row expressions with a greater than operator If the the PK of the table is(A asc, B asc, C asc) (A, B, C) > ('a1', 'b1', * 'c1')
is transformed to(A > 'a1') OR ((A = 'a1') AND (B > 'b1')) OR ((A = 'a1') AND (B = 'b1') AND (C > 'c1'))
If the the PK of the table is(A asc, B desc, C asc) (A, B, C) > ('a1', 'b1', 'c1')
is transformed to(A > 'a1') OR ((A = 'a1') AND (B < 'b1')) OR ((A = 'a1') AND (B = 'b1') AND (C > 'c1'))
This implementation is different from the SQL-92 standard see https://stackoverflow.com/questions/32981903/sql-syntax-term-for-where-col1-col2-val1-val2/32982077#32982077
-
-
Constructor Summary
Constructors Constructor Description RowValueExpressionConverter(org.apache.calcite.rex.RexBuilder rexBuilder, CalciteKuduTable calciteKuduTable)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.calcite.rex.RexNode
visitCall(org.apache.calcite.rex.RexCall call)
-
Methods inherited from class org.apache.calcite.rex.RexShuttle
apply, apply, mutate, visitArray, visitCorrelVariable, visitDynamicParam, visitFieldAccess, visitFieldCollations, visitInputRef, visitList, visitLiteral, visitLocalRef, visitOver, visitPatternFieldRef, visitRangeRef, visitSubQuery, visitTableInputRef, visitWindow
-
-
-
-
Constructor Detail
-
RowValueExpressionConverter
public RowValueExpressionConverter(org.apache.calcite.rex.RexBuilder rexBuilder, CalciteKuduTable calciteKuduTable)
-
-