| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private boolean |
| Access | Constructor and Description |
|---|---|
| pack-priv | BinaryComparisonOperatorNode(ValueNode
The left operand of the comparison leftOperand, ValueNode The right operand of the comparison rightOperand, String The name of the operator operator, String The name of the method to call in the generated
class methodName, boolean 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.java forQueryRewrite, ContextManager The context manager cm)Constructor for a BinaryComparisonOperatorNode |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv void | bindComparisonOperator()
Test the type compatability of the operands and set the type info for this node. |
| pack-priv ValueNode | Returns: The new top of the expression tree.The query's FROM list fromList, SubqueryList The subquery list being built as we find SubqueryNodes subqueryList, List<AggregateNode> The aggregate list being built as we find AggregateNodes aggregates)Overrides org. Bind this comparison operator. |
| pack-priv ValueNode | Returns: The modified expressionWhether or not we are under a top level AndNode. underTopAndNode)Overrides org. Finish putting an expression into conjunctive normal form. |
| pack-priv ValueNode | Returns: The modified expressionWhether or not we are under a NotNode. underNotNode)Overrides org. Eliminate NotNodes in the current query block. |
| pack-priv ValueNode | genSQLJavaSQLTree()
Overrides org. generate a SQL->Java->SQL conversion tree above the left and right operand of this Binary Operator Node if needed. |
| pack-priv boolean | Returns: Whether or not to use the between selectivity for this node.Return whether or not to use the between selectivity for this node. |
| pack-priv boolean | Returns: true if it was generated in a query rewrite.Was this node generated in a query rewrite? |
| pack-priv abstract BinaryOperatorNode | Returns: BinaryOperatorNode The negated expressionThe left operand of the comparison operator leftOperand, ValueNode The right operand of the comparison operator rightOperand)Negate the comparison. |
| pack-priv abstract BinaryOperatorNode | Returns: an equivalent expression with the operands swappedReturn a node equivalent to this node, but with the left and right operands swapped. |
| pack-priv ValueNode | Returns: The modified expressionNumber of tables in the DML Statement numTables, FromList FromList from outer query block outerFromList, SubqueryList SubqueryList from outer query block outerSubqueryList, PredicateList PredicateList from outer query block outerPredicateList)Overrides org. Preprocess an expression tree. |
| pack-priv void | |
| pack-priv void | setForQueryRewrite(boolean
true if this was for a query rewrite val)This node was generated as part of a query rewrite. |
| betweenSelectivity | back to summary |
|---|---|
| private boolean betweenSelectivity | |
| forQueryRewrite | back to summary |
|---|---|
| private boolean forQueryRewrite | |
| BinaryComparisonOperatorNode | back to summary |
|---|---|
| pack-priv BinaryComparisonOperatorNode(ValueNode leftOperand, ValueNode rightOperand, String operator, String methodName, boolean forQueryRewrite, ContextManager cm) throws StandardException Constructor for a BinaryComparisonOperatorNode
| |
| bindComparisonOperator | back to summary |
|---|---|
| pack-priv void bindComparisonOperator() throws StandardException Test the type compatability of the operands and 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.
| |
| bindExpression | back to summary |
|---|---|
| pack-priv ValueNode bindExpression(FromList fromList, SubqueryList subqueryList, List<AggregateNode> aggregates) throws StandardException Overrides org. Bind this comparison operator. All that has to be done for binding a comparison operator is to bind the operands, check the compatibility of the types, and set the result type to SQLBoolean.
| |
| changeToCNF | back to summary |
|---|---|
| pack-priv ValueNode changeToCNF(boolean underTopAndNode) throws StandardException Overrides org. Finish putting an expression into conjunctive normal form. An expression tree in conjunctive normal form meets the following criteria: o If the expression tree is not null, the top level will be a chain of AndNodes terminating in a true BooleanConstantNode. o The left child of an AndNode will never be an AndNode. o Any right-linked chain that includes an AndNode will be entirely composed of AndNodes terminated by a true BooleanConstantNode. o The left child of an OrNode will never be an OrNode. o Any right-linked chain that includes an OrNode will be entirely composed of OrNodes terminated by a false BooleanConstantNode. o ValueNodes other than AndNodes and OrNodes are considered leaf nodes for purposes of expression normalization. In other words, we won't do any normalization under those nodes. In addition, we track whether or not we are under a top level AndNode. SubqueryNodes need to know this for subquery flattening.
| |
| eliminateNots | back to summary |
|---|---|
| pack-priv ValueNode eliminateNots(boolean underNotNode) throws StandardException Overrides org. 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.
| |
| genSQLJavaSQLTree | back to summary |
|---|---|
| pack-priv ValueNode genSQLJavaSQLTree() throws StandardException Overrides org. Doc from org. generate a SQL->Java->SQL conversion tree above the left and right operand of this Binary Operator Node if needed. Subclasses can override the default behavior.
| |
| getBetweenSelectivity | back to summary |
|---|---|
| pack-priv boolean getBetweenSelectivity() Return whether or not to use the between selectivity for this node.
| |
| getForQueryRewrite | back to summary |
|---|---|
| pack-priv boolean getForQueryRewrite() Was this node generated in a query rewrite?
| |
| getNegation | back to summary |
|---|---|
| pack-priv abstract BinaryOperatorNode getNegation(ValueNode leftOperand, ValueNode rightOperand) throws StandardException Negate the comparison.
| |
| getSwappedEquivalent | back to summary |
|---|---|
| pack-priv abstract 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:
| |
| preprocess | back to summary |
|---|---|
| pack-priv ValueNode preprocess(int numTables, FromList outerFromList, SubqueryList outerSubqueryList, PredicateList outerPredicateList) throws StandardException Overrides org. Preprocess an expression tree. We do a number of transformations here (including subqueries, IN lists, LIKE and BETWEEN) plus subquery flattening. Note This is done before the outer ResultSetNode is preprocessed.
| |
| setBetweenSelectivity | back to summary |
|---|---|
| pack-priv void setBetweenSelectivity() Use between selectivity when calculating the selectivity. | |
| setForQueryRewrite | back to summary |
|---|---|
| pack-priv void setForQueryRewrite(boolean val) This node was generated as part of a query rewrite. Bypass the normal comparability checks.
| |