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.OperatorNode
org.apache.derby.impl.sql.compile.UnaryOperatorNode
org.apache.derby.impl.sql.compile.UnaryComparisonOperatorNode
- All Implemented Interfaces:
Visitable
- Direct Known Subclasses:
IsNullNode
This node is the superclass for all unary comparison operators, such as is null
and is not null.
-
Field Summary
Fields inherited from class org.apache.derby.impl.sql.compile.UnaryOperatorNode
K_BASE, K_XMLPARSE, K_XMLSERIALIZE, kind, methodName, operand, operator, receiverInterfaceType, resultInterfaceType, UnaryArgTypes, UnaryMethodNames, UnaryOperators, UnaryResultTypes
Fields inherited from class org.apache.derby.impl.sql.compile.ValueNode
transformed
Fields inherited from class org.apache.derby.impl.sql.compile.QueryTreeNode
AUTOINCREMENT_CREATE_MODIFY, AUTOINCREMENT_CYCLE, AUTOINCREMENT_INC_INDEX, AUTOINCREMENT_IS_AUTOINCREMENT_INDEX, AUTOINCREMENT_START_INDEX
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) void
Set the type info for this node.(package private) ValueNode
bindExpression
(FromList fromList, SubqueryList subqueryList, List<AggregateNode> aggregates) 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, ExpressionClassBuilderInterface acbi, MethodBuilder mb) void
void
generateQualMethod
(ExpressionClassBuilderInterface acbi, 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.getColumnOperand
(Optimizable optTable) getColumnOperand
(Optimizable optTable, int columnPosition) getExpressionOperand
(int tableNumber, int columnNumber, Optimizable ft) (package private) abstract UnaryOperatorNode
getNegation
(ValueNode operand) Negate the comparison.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
boolean
Methods inherited from class org.apache.derby.impl.sql.compile.UnaryOperatorNode
acceptChildren, addXmlOpMethodParams, bindOperand, bindParameter, categorize, constantExpression, generateExpression, getOperand, getOperatorString, getOrderableVariantType, getParameterOperand, getReceiverInterfaceName, isConstantExpression, isEquivalent, isSameNodeKind, preprocess, printSubNodes, remapColumnReferencesToExpressions, setMethodName, setOperator, toString
Methods inherited from class org.apache.derby.impl.sql.compile.OperatorNode
pushSqlXmlUtil
Methods inherited from class org.apache.derby.impl.sql.compile.ValueNode
bindExpression, changeToCNF, checkIsBoolean, checkTopPredicatesForEqualsConditions, copyFields, evaluateConstantExpressions, genEqualsFalseTree, generate, genIsNullTree, genSQLJavaSQLTree, 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
Methods inherited from class org.apache.derby.impl.sql.compile.QueryTreeNode
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
-
Constructor Details
-
UnaryComparisonOperatorNode
UnaryComparisonOperatorNode(ValueNode operator, ContextManager cm) throws StandardException - Throws:
StandardException
-
-
Method Details
-
bindExpression
ValueNode bindExpression(FromList fromList, SubqueryList subqueryList, List<AggregateNode> aggregates) 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 classUnaryOperatorNode
- Parameters:
fromList
- The query's FROM listsubqueryList
- The subquery list being built as we find SubqueryNodesaggregates
- The aggregate list being built as we find AggregateNodes- Returns:
- The new top of the expression tree.
- Throws:
StandardException
- Thrown on error
-
bindComparisonOperator
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
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 classValueNode
- Parameters:
underNotNode
- Whether or not we are under a NotNode.- Returns:
- The modified expression
- Throws:
StandardException
- Thrown on error
-
getNegation
Negate the comparison.- Parameters:
operand
- The operand of the comparison operator- Returns:
- BinaryOperatorNode The negated expression
- Throws:
StandardException
- Thrown on error
-
getColumnOperand
- See Also:
-
getColumnOperand
- See Also:
-
getOperand
- See Also:
-
selfComparison
- See Also:
-
getExpressionOperand
- See Also:
-
generateExpressionOperand
public void generateExpressionOperand(Optimizable optTable, int columnPosition, ExpressionClassBuilderInterface acbi, MethodBuilder mb) throws StandardException - Throws:
StandardException
- Thrown on error- See Also:
-
getStartOperator
- See Also:
-
getStopOperator
- See Also:
-
generateOrderedNulls
- See Also:
-
generateQualMethod
public void generateQualMethod(ExpressionClassBuilderInterface acbi, MethodBuilder mb, Optimizable optTable) throws StandardException - Throws:
StandardException
- Thrown on error- See Also:
-
generateAbsoluteColumnId
- See Also:
-
generateRelativeColumnId
- See Also:
-
getAbsoluteColumnPosition
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:
-
isQualifier
- See Also:
-
getOrderableVariantType
- Throws:
StandardException
- thrown on error- See Also:
-