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, LE, leftInterfaceType, leftOperand, LIKE, LT, methodName, MINUS, NE, operator, operatorType, OR, PLUS, receiver, resultInterfaceType, rightInterfaceType, rightOperand, TIMES, XMLEXISTS_OP, XMLQUERY_OPtransformedAUTOINCREMENT_CREATE_MODIFY, AUTOINCREMENT_INC_INDEX, AUTOINCREMENT_IS_AUTOINCREMENT_INDEX, AUTOINCREMENT_START_INDEX| Constructor and Description |
|---|
BinaryComparisonOperatorNode() |
| Modifier and Type | Method and Description |
|---|---|
void |
bindComparisonOperator()
Test the type compatability of the operands and set the type info
for this node.
|
ValueNode |
bindExpression(FromList fromList,
SubqueryList subqueryList,
java.util.List aggregateVector)
Bind this comparison operator.
|
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.
|
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.
|
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.
|
void |
init(java.lang.Object leftOperand,
java.lang.Object rightOperand,
java.lang.Object operator,
java.lang.Object methodName,
java.lang.Object forQueryRewrite)
Initializer for a BinaryComparisonOperatorNode
|
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.
|
void |
setForQueryRewrite(boolean val)
This node was generated as part of a query rewrite.
|
acceptChildren, bindXMLQuery, categorize, constantExpression, generateExpression, getLeftOperand, getOrderableVariantType, getReceiverInterfaceName, getRightOperand, init, init, init, isConstantExpression, isEquivalent, printSubNodes, remapColumnReferencesToExpressions, setLeftOperand, setLeftRightInterfaceType, setMethodName, setOperator, setRightOperand, toStringpushSqlXmlUtilbindExpression, checkIsBoolean, checkTopPredicatesForEqualsConditions, copyFields, evaluateConstantExpressions, genEqualsFalseTree, generate, generateFilter, genIsNullTree, getClone, getColumnName, getConstantValueAsObject, getDataValueFactory, getSchemaName, getSourceResultColumn, getTableName, getTablesReferenced, getTransformed, getTypeCompiler, getTypeId, getTypeServices, isBinaryEqualsOperatorNode, isBooleanFalse, isBooleanTrue, isCloneable, isInListProbeNode, isParameterNode, isRelationalOperator, isSameNodeType, optimizableEqualityNode, putAndsOnTop, requiresTypeFromContext, selectivity, setCollationInfo, setCollationInfo, setCollationUsingCompilationSchema, setCollationUsingCompilationSchema, setNullability, setTransformed, setType, setType, setType, updatableByCursor, verifyChangeToCNF, verifyEliminateNots, verifyPutAndsOnTopaccept, bindOffsetFetch, bindRowMultiSet, bindUserCatalogType, bindUserType, checkReliability, checkReliability, convertDefaultNode, createTypeDependency, debugFlush, debugPrint, disablePrivilegeCollection, formatNodeString, foundString, generateAuthorizeCheck, getBeginOffset, getClassFactory, getCompilerContext, getContextManager, getCursorInfo, getDataDictionary, getDependencyManager, getEndOffset, getExecutionFactory, getGenericConstantActionFactory, getIntProperty, getLanguageConnectionContext, getNodeFactory, getNodeType, getNullNode, getParameterTypes, getSchemaDescriptor, getSchemaDescriptor, getStatementType, getTableDescriptor, getTypeCompiler, init, init, init, init, init, init, init, init, init, init, isAtomic, isInstanceOf, isPrivilegeCollectionRequired, isSessionSchema, isSessionSchema, makeConstantAction, makeTableName, makeTableName, nodeHeader, orReliability, parseStatement, printLabel, referencesSessionSchema, resolveTableToSynonym, setBeginOffset, setContextManager, setEndOffset, setNodeType, setRefActionInfo, stackPrint, treePrint, treePrint, verifyClassExistprivate boolean forQueryRewrite
private boolean betweenSelectivity
public void init(java.lang.Object leftOperand,
java.lang.Object rightOperand,
java.lang.Object operator,
java.lang.Object methodName,
java.lang.Object forQueryRewrite)
init in interface Nodeinit in class ValueNodeleftOperand - 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.javapublic void setForQueryRewrite(boolean val)
val - true if this was for a query rewritepublic boolean getForQueryRewrite()
void setBetweenSelectivity()
boolean getBetweenSelectivity()
public ValueNode bindExpression(FromList fromList, SubqueryList subqueryList, java.util.List aggregateVector) throws StandardException
bindExpression in class BinaryOperatorNodefromList - The query's FROM listsubqueryList - The subquery list being built as we find SubqueryNodesaggregateVector - The aggregate vector being built as we find AggregateNodesStandardException - Thrown on errorpublic void bindComparisonOperator()
throws StandardException
StandardException - Thrown on errorpublic ValueNode preprocess(int numTables, FromList outerFromList, SubqueryList outerSubqueryList, PredicateList outerPredicateList) throws StandardException
preprocess in class BinaryOperatorNodenumTables - 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 ValueNodeunderNotNode - 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 occurspublic ValueNode changeToCNF(boolean underTopAndNode) throws StandardException
changeToCNF in class ValueNodeunderTopAndNode - Whether or not we are under a top level AndNode.StandardException - Thrown on errorpublic ValueNode genSQLJavaSQLTree() throws StandardException
BinaryOperatorNodegenSQLJavaSQLTree in class BinaryOperatorNodeStandardException - Thrown on errorBinaryOperatorNode.genSQLJavaSQLTree()Apache Derby V10.10 Internals - Copyright © 2004,2014 The Apache Software Foundation. All Rights Reserved.