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 UnaryOperatorNode
K_BASE, K_XMLPARSE, K_XMLSERIALIZE, kind, methodName, operand, operator, receiverInterfaceType, resultInterfaceType, UnaryArgTypes, UnaryMethodNames, UnaryOperators, UnaryResultTypesFields inherited from class ValueNode
transformedFields inherited from class 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) voidSet the type info for this node.(package private) ValueNodebindExpression(FromList fromList, SubqueryList subqueryList, List<AggregateNode> aggregates) Bind this comparison operator.(package private) ValueNodeeliminateNots(boolean underNotNode) Eliminate NotNodes in the current query block.voidgenerateAbsoluteColumnId(MethodBuilder mb, Optimizable optTable) voidgenerateExpressionOperand(Optimizable optTable, int columnPosition, ExpressionClassBuilderInterface acbi, MethodBuilder mb) voidvoidgenerateQualMethod(ExpressionClassBuilderInterface acbi, MethodBuilder mb, Optimizable optTable) voidgenerateRelativeColumnId(MethodBuilder mb, Optimizable optTable) private intgetAbsoluteColumnPosition(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 UnaryOperatorNodegetNegation(ValueNode operand) Negate the comparison.getOperand(ColumnReference cRef, int refSetSize, boolean otherSide) intgetOrderableVariantType(Optimizable optTable) intgetStartOperator(Optimizable optTable) intgetStopOperator(Optimizable optTable) booleanisQualifier(Optimizable optTable, boolean forPush) booleanbooleanMethods inherited from class UnaryOperatorNode
acceptChildren, addXmlOpMethodParams, bindOperand, bindParameter, categorize, constantExpression, generateExpression, getOperand, getOperatorString, getOrderableVariantType, getParameterOperand, getReceiverInterfaceName, isConstantExpression, isEquivalent, isSameNodeKind, preprocess, printSubNodes, remapColumnReferencesToExpressions, setMethodName, setOperator, toStringMethods inherited from class OperatorNode
pushSqlXmlUtilMethods inherited from class 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, verifyPutAndsOnTopMethods inherited from class 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:
bindExpressionin 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:
eliminateNotsin 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:
-