org.apache.derby.impl.sql.compile
Class UnaryComparisonOperatorNode
java.lang.Object
org.apache.derby.impl.sql.compile.QueryTreeNode
org.apache.derby.impl.sql.compile.ValueNode
org.apache.derby.impl.sql.compile.UnaryOperatorNode
org.apache.derby.impl.sql.compile.UnaryComparisonOperatorNode
- All Implemented Interfaces:
- Visitable
- Direct Known Subclasses:
- IsNullNode
public abstract class UnaryComparisonOperatorNode
- extends UnaryOperatorNode
This node is the superclass for all unary comparison operators, such as is null
and is not null.
Fields inherited from class org.apache.derby.impl.sql.compile.UnaryOperatorNode |
methodName, operand, operator, receiverInterfaceType, resultInterfaceType, UnaryArgTypes, UnaryMethodNames, UnaryOperators, UnaryResultTypes, XMLPARSE_OP, XMLSERIALIZE_OP |
Method Summary |
void |
bindComparisonOperator()
Set the type info for this node. |
ValueNode |
bindExpression(FromList fromList,
SubqueryList subqueryList,
java.util.Vector aggregateVector)
Bind this comparison operator. |
(package private) ValueNode |
eliminateNots(boolean underNotNode)
Eliminate NotNodes in the current query block. |
void |
generateAbsoluteColumnId(MethodBuilder mb,
Optimizable optTable)
|
void |
generateExpressionOperand(Optimizable optTable,
int columnPosition,
ExpressionClassBuilder acb,
MethodBuilder mb)
|
void |
generateOrderedNulls(MethodBuilder mb)
|
void |
generateQualMethod(ExpressionClassBuilder acb,
MethodBuilder mb,
Optimizable optTable)
|
void |
generateRelativeColumnId(MethodBuilder mb,
Optimizable optTable)
|
private int |
getAbsoluteColumnPosition(Optimizable optTable)
Get the absolute 0-based column position of the ColumnReference from
the conglomerate for this Optimizable. |
ColumnReference |
getColumnOperand(Optimizable optTable)
|
ColumnReference |
getColumnOperand(Optimizable optTable,
int columnPosition)
|
ValueNode |
getExpressionOperand(int tableNumber,
int columnNumber,
FromTable ft)
|
(package private) abstract UnaryOperatorNode |
getNegation(ValueNode operand)
Negate the comparison. |
ValueNode |
getOperand(ColumnReference cRef,
int refSetSize,
boolean otherSide)
|
int |
getOrderableVariantType(Optimizable optTable)
|
int |
getStartOperator(Optimizable optTable)
|
int |
getStopOperator(Optimizable optTable)
|
boolean |
isQualifier(Optimizable optTable,
boolean forPush)
|
boolean |
orderedNulls()
|
boolean |
selfComparison(ColumnReference cr)
|
Methods inherited from class org.apache.derby.impl.sql.compile.UnaryOperatorNode |
acceptChildren, addXmlOpMethodParams, bindOperand, bindParameter, categorize, constantExpression, generateExpression, getOperand, getOperatorString, getOrderableVariantType, getParameterOperand, getReceiverInterfaceName, init, init, isConstantExpression, isEquivalent, preprocess, printSubNodes, remapColumnReferencesToExpressions, setMethodName, setOperator, toString |
Methods inherited from class org.apache.derby.impl.sql.compile.ValueNode |
bindExpression, changeToCNF, checkIsBoolean, checkTopPredicatesForEqualsConditions, copyFields, evaluateConstantExpressions, genEqualsFalseTree, generate, generateFilter, genIsNullTree, genSQLJavaSQLTree, getClone, getColumnName, getConstantValueAsObject, getDataValueFactory, getSchemaName, getSourceResultColumn, getTableName, getTablesReferenced, getTransformed, getTypeCompiler, getTypeId, getTypeServices, init, isBinaryEqualsOperatorNode, isBooleanFalse, isBooleanTrue, isCloneable, isInListProbeNode, isParameterNode, isRelationalOperator, isSameNodeType, optimizableEqualityNode, putAndsOnTop, requiresTypeFromContext, selectivity, setCollationInfo, setCollationInfo, setCollationUsingCompilationSchema, setCollationUsingCompilationSchema, setNullability, setTransformed, setType, setType, setType, updatableByCursor, verifyChangeToCNF, verifyEliminateNots, verifyPutAndsOnTop |
Methods inherited from class org.apache.derby.impl.sql.compile.QueryTreeNode |
accept, bindOffsetFetch, bindRowMultiSet, 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, getRowEstimate, getSchemaDescriptor, getSchemaDescriptor, getStatementType, getTableDescriptor, getTypeCompiler, init, 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, verifyClassExist |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
UnaryComparisonOperatorNode
public UnaryComparisonOperatorNode()
bindExpression
public ValueNode bindExpression(FromList fromList,
SubqueryList subqueryList,
java.util.Vector aggregateVector)
throws StandardException
- Bind this comparison operator. All that has to be done for binding
a comparison operator is to bind the operand and set the result type
to SQLBoolean.
- Overrides:
bindExpression
in class UnaryOperatorNode
- Parameters:
fromList
- The query's FROM listsubqueryList
- The subquery list being built as we find SubqueryNodesaggregateVector
- The aggregate vector being built as we find AggregateNodes
- Returns:
- The new top of the expression tree.
- Throws:
StandardException
- Thrown on error
bindComparisonOperator
public void bindComparisonOperator()
throws StandardException
- Set the type info for this node. This method is useful both during
binding and when we generate nodes within the language module outside
of the parser.
- Throws:
StandardException
- Thrown on error
eliminateNots
ValueNode eliminateNots(boolean underNotNode)
throws StandardException
- Eliminate NotNodes in the current query block. We traverse the tree,
inverting ANDs and ORs and eliminating NOTs as we go. We stop at
ComparisonOperators and boolean expressions. We invert
ComparisonOperators and replace boolean expressions with
boolean expression = false.
NOTE: Since we do not recurse under ComparisonOperators, there
still could be NotNodes left in the tree.
- Overrides:
eliminateNots
in class ValueNode
- Parameters:
underNotNode
- Whether or not we are under a NotNode.
- Returns:
- The modified expression
- Throws:
StandardException
- Thrown on error
getNegation
abstract UnaryOperatorNode getNegation(ValueNode operand)
throws StandardException
- Negate the comparison.
- Parameters:
operand
- The operand of the comparison operator
- Returns:
- BinaryOperatorNode The negated expression
- Throws:
StandardException
- Thrown on error
getColumnOperand
public ColumnReference getColumnOperand(Optimizable optTable,
int columnPosition)
- See Also:
RelationalOperator.getColumnOperand(org.apache.derby.iapi.sql.compile.Optimizable, int)
getColumnOperand
public ColumnReference getColumnOperand(Optimizable optTable)
- See Also:
RelationalOperator.getColumnOperand(org.apache.derby.iapi.sql.compile.Optimizable, int)
getOperand
public ValueNode getOperand(ColumnReference cRef,
int refSetSize,
boolean otherSide)
- See Also:
RelationalOperator.getOperand(org.apache.derby.impl.sql.compile.ColumnReference, int, boolean)
selfComparison
public boolean selfComparison(ColumnReference cr)
- See Also:
RelationalOperator.selfComparison(org.apache.derby.impl.sql.compile.ColumnReference)
getExpressionOperand
public ValueNode getExpressionOperand(int tableNumber,
int columnNumber,
FromTable ft)
- See Also:
RelationalOperator.getExpressionOperand(int, int, org.apache.derby.impl.sql.compile.FromTable)
generateExpressionOperand
public void generateExpressionOperand(Optimizable optTable,
int columnPosition,
ExpressionClassBuilder acb,
MethodBuilder mb)
throws StandardException
- Throws:
StandardException
- Thrown on error- See Also:
RelationalOperator.generateExpressionOperand(org.apache.derby.iapi.sql.compile.Optimizable, int, org.apache.derby.impl.sql.compile.ExpressionClassBuilder, org.apache.derby.iapi.services.compiler.MethodBuilder)
getStartOperator
public int getStartOperator(Optimizable optTable)
- See Also:
RelationalOperator.getStartOperator(org.apache.derby.iapi.sql.compile.Optimizable)
getStopOperator
public int getStopOperator(Optimizable optTable)
- See Also:
RelationalOperator.getStopOperator(org.apache.derby.iapi.sql.compile.Optimizable)
generateOrderedNulls
public void generateOrderedNulls(MethodBuilder mb)
- See Also:
RelationalOperator.generateOrderedNulls(org.apache.derby.iapi.services.compiler.MethodBuilder)
generateQualMethod
public void generateQualMethod(ExpressionClassBuilder acb,
MethodBuilder mb,
Optimizable optTable)
throws StandardException
- Throws:
StandardException
- Thrown on error- See Also:
RelationalOperator.generateQualMethod(org.apache.derby.impl.sql.compile.ExpressionClassBuilder, org.apache.derby.iapi.services.compiler.MethodBuilder, org.apache.derby.iapi.sql.compile.Optimizable)
generateAbsoluteColumnId
public void generateAbsoluteColumnId(MethodBuilder mb,
Optimizable optTable)
- See Also:
RelationalOperator.generateAbsoluteColumnId(org.apache.derby.iapi.services.compiler.MethodBuilder, org.apache.derby.iapi.sql.compile.Optimizable)
generateRelativeColumnId
public void generateRelativeColumnId(MethodBuilder mb,
Optimizable optTable)
- See Also:
RelationalOperator.generateRelativeColumnId(org.apache.derby.iapi.services.compiler.MethodBuilder, org.apache.derby.iapi.sql.compile.Optimizable)
getAbsoluteColumnPosition
private int getAbsoluteColumnPosition(Optimizable optTable)
- Get the absolute 0-based column position of the ColumnReference from
the conglomerate for this Optimizable.
- Parameters:
optTable
- The Optimizable
- Returns:
- The absolute 0-based column position of the ColumnReference
orderedNulls
public boolean orderedNulls()
- See Also:
RelationalOperator.orderedNulls()
isQualifier
public boolean isQualifier(Optimizable optTable,
boolean forPush)
- See Also:
RelationalOperator.isQualifier(org.apache.derby.iapi.sql.compile.Optimizable, boolean)
getOrderableVariantType
public int getOrderableVariantType(Optimizable optTable)
throws StandardException
- Throws:
StandardException
- thrown on error- See Also:
RelationalOperator.getOrderableVariantType(org.apache.derby.iapi.sql.compile.Optimizable)
Apache Derby V10.6 Internals - Copyright © 2004,2007 The Apache Software Foundation. All Rights Reserved.