public abstract class BinaryComparisonOperatorNode extends BinaryOperatorNode
Modifier and Type | Field and Description |
---|---|
private boolean |
betweenSelectivity |
private boolean |
forQueryRewrite |
AND, BinaryArgTypes, BinaryMethodNames, BinaryOperators, BinaryResultTypes, CONCATENATE, DIVIDE, EQ, GE, GT, K_BASE, K_XMLEXISTS, K_XMLQUERY, kind, LE, leftInterfaceType, leftOperand, LIKE, LT, methodName, MINUS, NE, operator, OR, PLUS, receiver, resultInterfaceType, rightInterfaceType, rightOperand, TIMES
transformed
AUTOINCREMENT_CREATE_MODIFY, AUTOINCREMENT_CYCLE, AUTOINCREMENT_INC_INDEX, AUTOINCREMENT_IS_AUTOINCREMENT_INDEX, AUTOINCREMENT_START_INDEX
Constructor and Description |
---|
BinaryComparisonOperatorNode(ValueNode leftOperand,
ValueNode rightOperand,
java.lang.String operator,
java.lang.String methodName,
boolean forQueryRewrite,
ContextManager cm)
Constructor for a BinaryComparisonOperatorNode
|
Modifier and Type | Method and Description |
---|---|
(package private) void |
bindComparisonOperator()
Test the type compatability of the operands and set the type info
for this node.
|
(package private) ValueNode |
bindExpression(FromList fromList,
SubqueryList subqueryList,
java.util.List<AggregateNode> aggregates)
Bind this comparison operator.
|
(package private) ValueNode |
changeToCNF(boolean underTopAndNode)
Finish putting an expression into conjunctive normal
form.
|
(package private) ValueNode |
eliminateNots(boolean underNotNode)
Eliminate NotNodes in the current query block.
|
(package private) ValueNode |
genSQLJavaSQLTree()
generate a SQL->Java->SQL conversion tree above the left and right
operand of this Binary Operator Node if needed.
|
(package private) boolean |
getBetweenSelectivity()
Return whether or not to use the between selectivity for this node.
|
(package private) boolean |
getForQueryRewrite()
Was this node generated in a query rewrite?
|
(package private) abstract BinaryOperatorNode |
getNegation(ValueNode leftOperand,
ValueNode rightOperand)
Negate the comparison.
|
(package private) abstract BinaryOperatorNode |
getSwappedEquivalent()
Return a node equivalent to this node, but with the left and right
operands swapped.
|
(package private) ValueNode |
preprocess(int numTables,
FromList outerFromList,
SubqueryList outerSubqueryList,
PredicateList outerPredicateList)
Preprocess an expression tree.
|
(package private) void |
setBetweenSelectivity()
Use between selectivity when calculating the selectivity.
|
(package private) void |
setForQueryRewrite(boolean val)
This node was generated as part of a query rewrite.
|
acceptChildren, bindXMLQuery, categorize, constantExpression, generateExpression, getLeftOperand, getOrderableVariantType, getReceiverInterfaceName, getRightOperand, isConstantExpression, isEquivalent, isSameNodeKind, printSubNodes, remapColumnReferencesToExpressions, setLeftOperand, setLeftRightInterfaceType, setMethodName, setOperator, setRightOperand, toString
pushSqlXmlUtil
bindExpression, checkIsBoolean, checkTopPredicatesForEqualsConditions, copyFields, evaluateConstantExpressions, genEqualsFalseTree, generate, genIsNullTree, getClone, getColumnName, getConstantValueAsObject, getDataValueFactory, getSchemaName, getSourceResultColumn, getTableName, getTablesReferenced, getTransformed, getTypeCompiler, getTypeId, getTypeServices, isBinaryEqualsOperatorNode, isBooleanFalse, isBooleanTrue, isCloneable, isInListProbeNode, isParameterNode, isRelationalOperator, optimizableEqualityNode, putAndsOnTop, requiresTypeFromContext, selectivity, setCollationInfo, setCollationInfo, setCollationUsingCompilationSchema, setCollationUsingCompilationSchema, setNullability, setTransformed, setType, setType, setType, updatableByCursor, verifyChangeToCNF, verifyEliminateNots, verifyPutAndsOnTop
accept, addTag, addUDTUsagePriv, addUDTUsagePriv, bindOffsetFetch, bindRowMultiSet, bindUserCatalogType, bindUserType, checkReliability, checkReliability, convertDefaultNode, copyTagsFrom, createTypeDependency, debugFlush, debugPrint, disablePrivilegeCollection, formatNodeString, generateAuthorizeCheck, getBeginOffset, getClassFactory, getCompilerContext, getContext, getContextManager, getDataDictionary, getDependencyManager, getEndOffset, getExecutionFactory, getGenericConstantActionFactory, getIntProperty, getLanguageConnectionContext, getLongProperty, getNullNode, getOffsetOrderedNodes, getOptimizerFactory, getOptimizerTracer, getParameterTypes, getSchemaDescriptor, getSchemaDescriptor, getStatementType, getTableDescriptor, getTypeCompiler, getUDTDesc, isAtomic, isPrivilegeCollectionRequired, isSessionSchema, isSessionSchema, makeConstantAction, makeTableName, makeTableName, nodeHeader, optimizerTracingIsOn, orReliability, parseSearchCondition, parseStatement, printLabel, referencesSessionSchema, resolveTableToSynonym, setBeginOffset, setEndOffset, setRefActionInfo, stackPrint, taggedWith, treePrint, treePrint, verifyClassExist
private boolean forQueryRewrite
private boolean betweenSelectivity
BinaryComparisonOperatorNode(ValueNode leftOperand, ValueNode rightOperand, java.lang.String operator, java.lang.String methodName, boolean forQueryRewrite, ContextManager cm) throws StandardException
leftOperand
- The left operand of the comparisonrightOperand
- The right operand of the comparisonoperator
- The name of the operatormethodName
- The name of the method to call in the generated
classforQueryRewrite
- Can be true only if if this node has been
added by an internal rewrite of the query. This
allows binding to be more liberal when checking
it against allowed syntax.
This parameter will be passed FALSE when a new
instance of the node is being created(which is
the majority of the cases). But when an
existing node is getting cloned, the value of
this parameter should be passed as the
originalNode.getForQueryRewrite(). Examples of
this can be found in Predicate.Java and
PredicateList.javacm
- The context managerStandardException
void setForQueryRewrite(boolean val)
val
- true if this was for a query rewriteboolean getForQueryRewrite()
void setBetweenSelectivity()
boolean getBetweenSelectivity()
ValueNode bindExpression(FromList fromList, SubqueryList subqueryList, java.util.List<AggregateNode> aggregates) throws StandardException
bindExpression
in class BinaryOperatorNode
fromList
- The query's FROM listsubqueryList
- The subquery list being built as we find SubqueryNodesaggregates
- The aggregate list being built as we find AggregateNodesStandardException
- Thrown on errorvoid bindComparisonOperator() throws StandardException
StandardException
- Thrown on errorValueNode preprocess(int numTables, FromList outerFromList, SubqueryList outerSubqueryList, PredicateList outerPredicateList) throws StandardException
preprocess
in class BinaryOperatorNode
numTables
- Number of tables in the DML StatementouterFromList
- FromList from outer query blockouterSubqueryList
- SubqueryList from outer query blockouterPredicateList
- PredicateList from outer query blockStandardException
- Thrown on errorValueNode eliminateNots(boolean underNotNode) throws StandardException
eliminateNots
in class ValueNode
underNotNode
- Whether or not we are under a NotNode.StandardException
- Thrown on errorabstract BinaryOperatorNode getNegation(ValueNode leftOperand, ValueNode rightOperand) throws StandardException
leftOperand
- The left operand of the comparison operatorrightOperand
- The right operand of the comparison operatorStandardException
- Thrown on errorabstract BinaryOperatorNode getSwappedEquivalent() throws StandardException
Return a node equivalent to this node, but with the left and right operands swapped. The node type may also be changed if the operator is not symmetric.
This method may for instance be used to normalize a predicate by
moving constants to the right-hand side of the comparison. Example:
1 = A
will be transformed to A = 1
, and 10 < B
will be transformed to B > 10
.
StandardException
- if an error occursValueNode changeToCNF(boolean underTopAndNode) throws StandardException
changeToCNF
in class ValueNode
underTopAndNode
- Whether or not we are under a top level AndNode.StandardException
- Thrown on errorValueNode genSQLJavaSQLTree() throws StandardException
BinaryOperatorNode
genSQLJavaSQLTree
in class BinaryOperatorNode
StandardException
- Thrown on errorBinaryOperatorNode.genSQLJavaSQLTree()
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.