Class Expression
- java.lang.Object
-
- org.apache.cassandra.index.sai.plan.Expression
-
- Direct Known Subclasses:
Expression.IndexedExpression
,Expression.UnindexedExpression
public abstract class Expression extends java.lang.Object
AnExpression
is an internal representation of an index query operation. They are built from CQLOperator
andByteBuffer
value pairs for a single column.Each
Expression
consists of anExpression.IndexOperator
and optional lower and upperExpression.Bound
s.The
Expression.IndexedExpression
has a backingStorageAttachedIndex
for the index query but order to support CQL expressions on columns that do not have indexes or use operators that are not supported by the index there is anExpression.UnindexedExpression
that does not provide aStorageAttachedIndex
and can only be used for post-filtering
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Expression.Bound
static class
Expression.IndexedExpression
static class
Expression.IndexOperator
static class
Expression.UnindexedExpression
static class
Expression.Value
A representation of a column value in its raw and encoded form.
-
Field Summary
Fields Modifier and Type Field Description Expression.Bound
lower
boolean
lowerInclusive
protected Expression.IndexOperator
operator
Expression.Bound
upper
boolean
upperInclusive
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Expression
add(Operator op, java.nio.ByteBuffer value)
This adds an operation to the currentExpression
instance and returns the current instance.static Expression
create(StorageAttachedIndex index)
static Expression
create(IndexTermType indexTermType)
boolean
equals(java.lang.Object other)
abstract StorageAttachedIndex
getIndex()
Expression.IndexOperator
getIndexOperator()
IndexTermType
getIndexTermType()
int
hashCode()
abstract boolean
isNotIndexed()
boolean
isSatisfiedBy(java.nio.ByteBuffer columnValue)
Used in post-filtering to determine is an indexed value matches the expressionExpression.Bound
lower()
static boolean
supportsOperator(Operator operator)
java.lang.String
toString()
Expression.Bound
upper()
-
-
-
Field Detail
-
operator
protected Expression.IndexOperator operator
-
lower
public Expression.Bound lower
-
upper
public Expression.Bound upper
-
upperInclusive
public boolean upperInclusive
-
lowerInclusive
public boolean lowerInclusive
-
-
Method Detail
-
create
public static Expression create(StorageAttachedIndex index)
-
create
public static Expression create(IndexTermType indexTermType)
-
supportsOperator
public static boolean supportsOperator(Operator operator)
-
isNotIndexed
public abstract boolean isNotIndexed()
-
getIndex
public abstract StorageAttachedIndex getIndex()
-
getIndexOperator
public Expression.IndexOperator getIndexOperator()
-
getIndexTermType
public IndexTermType getIndexTermType()
-
lower
public Expression.Bound lower()
-
upper
public Expression.Bound upper()
-
add
public Expression add(Operator op, java.nio.ByteBuffer value)
This adds an operation to the currentExpression
instance and returns the current instance.- Parameters:
op
- the CQL3 operationvalue
- the expression value- Returns:
- the current expression with the added operation
-
isSatisfiedBy
public boolean isSatisfiedBy(java.nio.ByteBuffer columnValue)
Used in post-filtering to determine is an indexed value matches the expression
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
-