interface RelationalOperator
Modifier and Type | Field and Description |
---|---|
static int |
EQUALS_RELOP |
static int |
GREATER_EQUALS_RELOP |
static int |
GREATER_THAN_RELOP |
static int |
IS_NOT_NULL_RELOP |
static int |
IS_NULL_RELOP |
static int |
LESS_EQUALS_RELOP |
static int |
LESS_THAN_RELOP |
static int |
NOT_EQUALS_RELOP |
Modifier and Type | Method and Description |
---|---|
boolean |
compareWithKnownConstant(Optimizable optTable,
boolean considerParameters)
Return whether this operator compares the given Optimizable with
a constant whose value is known at compile time.
|
boolean |
equalsComparisonWithConstantExpression(Optimizable optTable)
Return whether this operator is an equality comparison of the given
optimizable with a constant expression.
|
void |
generateAbsoluteColumnId(MethodBuilder mb,
Optimizable optTable)
Generate the absolute column id for the ColumnReference that appears on one
side of this RelationalOperator or the other, and that refers to
the given table.
|
void |
generateExpressionOperand(Optimizable optTable,
int columnPosition,
ExpressionClassBuilderInterface acb,
MethodBuilder mb)
Check whether this RelationalOperator is a comparison of the given
column with an expression.
|
void |
generateNegate(MethodBuilder mb,
Optimizable optTable)
Generate an expression that evaluates to true if the result of the
comparison should be negated.
|
void |
generateOperator(MethodBuilder mb,
Optimizable optTable)
Generate the comparison operator for this RelationalOperator.
|
void |
generateOrderedNulls(MethodBuilder mb)
Generate an expression that evaluates to true if this RelationalOperator
uses ordered null semantics, false if it doesn't.
|
void |
generateQualMethod(ExpressionClassBuilderInterface acb,
MethodBuilder mb,
Optimizable optTable)
Generate the method to evaluate a Qualifier.
|
void |
generateRelativeColumnId(MethodBuilder mb,
Optimizable optTable)
Generate the relative column id for the ColumnReference that appears on one
side of this RelationalOperator or the other, and that refers to
the given table.
|
ColumnReference |
getColumnOperand(Optimizable optTable)
Get the ColumnReference for the given table on one side of this
RelationalOperator.
|
ColumnReference |
getColumnOperand(Optimizable optTable,
int columnPosition)
Check whether this RelationalOperator is a comparison of the given
column with an expression.
|
DataValueDescriptor |
getCompareValue(Optimizable optTable)
Return an Object representing the known value that this relational
operator is comparing to a column in the given Optimizable.
|
ValueNode |
getExpressionOperand(int tableNumber,
int columnPosition,
Optimizable ft)
Check whether this RelationalOperator is a comparison of the given
column with an expression.
|
ValueNode |
getOperand(ColumnReference cRef,
int refSetSize,
boolean otherSide)
Find the operand (left or right) that points to the same table
as the received ColumnReference, and then return either that
operand or the "other" operand, depending on the value of
otherSide.
|
int |
getOperator()
Return the operator (as an int) for this RelationalOperator.
|
int |
getOrderableVariantType(Optimizable optTable)
Return the variant type for the Qualifier's Orderable.
|
int |
getStartOperator(Optimizable optTable)
Get the start operator for a scan (at the store level) for this
RelationalOperator.
|
int |
getStopOperator(Optimizable optTable)
Get the stop operator for a scan (at the store level) for this
RelationalOperator.
|
RelationalOperator |
getTransitiveSearchClause(ColumnReference otherCR)
Return a relational operator which matches the current one
but with the passed in ColumnReference as the (left) operand.
|
boolean |
isQualifier(Optimizable optTable,
boolean forPush)
Return true if this operator can be compiled into a Qualifier for
the given Optimizable table.
|
boolean |
orderedNulls()
Return true if this operator uses ordered null semantics
|
boolean |
selfComparison(ColumnReference cr)
Check whether this RelationalOperator compares the given ColumnReference
to any columns in the same table as the ColumnReference.
|
boolean |
usefulStartKey(Optimizable optTable)
Tell whether this relop is a useful start key for the given table.
|
boolean |
usefulStopKey(Optimizable optTable)
Tell whether this relop is a useful stop key for the given table.
|
static final int EQUALS_RELOP
static final int NOT_EQUALS_RELOP
static final int GREATER_THAN_RELOP
static final int GREATER_EQUALS_RELOP
static final int LESS_THAN_RELOP
static final int LESS_EQUALS_RELOP
static final int IS_NULL_RELOP
static final int IS_NOT_NULL_RELOP
ColumnReference getColumnOperand(Optimizable optTable, int columnPosition)
optTable
- An Optimizable for the base table the column is incolumnPosition
- The ordinal position of the column (one-based)ColumnReference getColumnOperand(Optimizable optTable)
ValueNode getOperand(ColumnReference cRef, int refSetSize, boolean otherSide)
cRef
- The ColumnReference for which we're searching.refSetSize
- Size of the referenced map for the predicate
represented by this RelationalOperator node. This is used
for storing base table numbers when searching for cRef.otherSide
- Assuming we find an operand that points to
the same table as cRef, then we will return the *other*
operand if otherSide is true; else we'll return the operand
that matches cRef.ValueNode getExpressionOperand(int tableNumber, int columnPosition, Optimizable ft)
tableNumber
- The table number of the base table the column is incolumnPosition
- The ordinal position of the column (one-based)ft
- We'll look for the column in all tables at and beneath ft.
This is useful if ft is, say, a ProjectRestrictNode over a subquery--
then we want to look at all of the FROM tables in the subquery to try
to find the right column.void generateExpressionOperand(Optimizable optTable, int columnPosition, ExpressionClassBuilderInterface acb, MethodBuilder mb) throws StandardException
optTable
- An Optimizable for the base table the column is incolumnPosition
- The ordinal position of the column (one-based)acb
- The ExpressionClassBuilder for the class we're buildingmb
- The method the expression will go intoStandardException
- Thrown on errorboolean selfComparison(ColumnReference cr) throws StandardException
cr
- The ColumnReference that is being compared to some
expression.StandardException
- Thrown on errorboolean usefulStartKey(Optimizable optTable)
optTable
- The Optimizable table for which we want to know
whether this is a useful start key.boolean usefulStopKey(Optimizable optTable)
optTable
- The Optimizable table for which we want to know
whether this is a useful stop key.int getStartOperator(Optimizable optTable)
optTable
- The optimizable table we're doing the scan on.
This parameter is so we can tell which side of
the operator the table's column is on.TransactionController.openScan(long, boolean, int, int, int, org.apache.derby.iapi.services.io.FormatableBitSet, org.apache.derby.iapi.types.DataValueDescriptor[], int, org.apache.derby.iapi.store.access.Qualifier[][], org.apache.derby.iapi.types.DataValueDescriptor[], int)
int getStopOperator(Optimizable optTable)
optTable
- The optimizable table we're doing the scan on.
This parameter is so we can tell which side of
the operator the table's column is on.TransactionController.openScan(long, boolean, int, int, int, org.apache.derby.iapi.services.io.FormatableBitSet, org.apache.derby.iapi.types.DataValueDescriptor[], int, org.apache.derby.iapi.store.access.Qualifier[][], org.apache.derby.iapi.types.DataValueDescriptor[], int)
void generateAbsoluteColumnId(MethodBuilder mb, Optimizable optTable)
mb
- The method the generated code is to go intooptTable
- The optimizable table we're doing the scan on.void generateRelativeColumnId(MethodBuilder mb, Optimizable optTable)
mb
- The method the generated code is to go intooptTable
- The optimizable table we're doing the scan on.void generateOperator(MethodBuilder mb, Optimizable optTable)
mb
- The method the generated code is to go intooptTable
- The optimizable table we're doing the scan on.void generateQualMethod(ExpressionClassBuilderInterface acb, MethodBuilder mb, Optimizable optTable) throws StandardException
acb
- The ExpressionClassBuilder for the class we're buildingmb
- The method the generated code is to go intooptTable
- The Optimizable table the Qualifier will qualifyStandardException
- Thrown on error.void generateOrderedNulls(MethodBuilder mb)
mb
- The method the generated code is to go intovoid generateNegate(MethodBuilder mb, Optimizable optTable)
mb
- The method the generated code is to go intooptTable
- The Optimizable table the Qualifier will qualifyboolean orderedNulls()
boolean isQualifier(Optimizable optTable, boolean forPush) throws StandardException
optTable
- The Optimizable table in question.forPush
- Are we asking because we're trying to push?StandardException
- Thrown on errorint getOperator()
int getOrderableVariantType(Optimizable optTable) throws StandardException
optTable
- The Optimizable table the Qualifier will qualifyStandardException
- thrown on errorboolean compareWithKnownConstant(Optimizable optTable, boolean considerParameters)
DataValueDescriptor getCompareValue(Optimizable optTable) throws StandardException
StandardException
- Thrown on errorboolean equalsComparisonWithConstantExpression(Optimizable optTable)
RelationalOperator getTransitiveSearchClause(ColumnReference otherCR) throws StandardException
otherCR
- The ColumnReference for the new (left) operand.StandardException
- Thrown on errorApache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.