static class CassandraFilter.Translator extends Object
RexNode expressions into Cassandra expression strings.| Modifier and Type | Field and Description |
|---|---|
private List<String> |
clusteringKeys |
private List<String> |
fieldNames |
private List<RelFieldCollation> |
implicitFieldCollations |
private Set<String> |
partitionKeys |
private int |
restrictedClusteringKeys |
private RelDataType |
rowType |
| Constructor and Description |
|---|
Translator(RelDataType rowType,
List<String> partitionKeys,
List<String> clusteringKeys,
List<RelFieldCollation> implicitFieldCollations) |
| Modifier and Type | Method and Description |
|---|---|
RelCollation |
getImplicitCollation()
Infer the implicit correlation from the unrestricted clustering keys.
|
boolean |
isSinglePartition()
Check if the query spans only one partition.
|
private static String |
literalValue(RexLiteral literal)
Conver the value of a literal to a string.
|
private String |
translateAnd(RexNode condition)
Translate a conjunctive predicate to a CQL string.
|
private String |
translateBinary(String op,
String rop,
RexCall call)
Translates a call to a binary operator, reversing arguments if
necessary.
|
private String |
translateBinary2(String op,
RexNode left,
RexNode right)
Translates a call to a binary operator.
|
private String |
translateMatch(RexNode condition)
Produce the CQL predicate string for the given condition.
|
private String |
translateMatch2(RexNode node)
Translate a binary relation.
|
private String |
translateOp2(String op,
String name,
RexLiteral right)
Combines a field name, operator, and literal to produce a predicate string.
|
private final RelDataType rowType
private int restrictedClusteringKeys
private final List<RelFieldCollation> implicitFieldCollations
Translator(RelDataType rowType, List<String> partitionKeys, List<String> clusteringKeys, List<RelFieldCollation> implicitFieldCollations)
public boolean isSinglePartition()
public RelCollation getImplicitCollation()
private String translateMatch(RexNode condition)
condition - Condition to translateprivate static String literalValue(RexLiteral literal)
literal - Literal to translateprivate String translateAnd(RexNode condition)
condition - A conjunctive predicateprivate String translateBinary(String op, String rop, RexCall call)
private String translateBinary2(String op, RexNode left, RexNode right)
private String translateOp2(String op, String name, RexLiteral right)
Copyright © 2012–2017 The Apache Software Foundation. All rights reserved.