public abstract class RexNode extends Object
Every row-expression has a type.
(Compare with SqlNode, which is created before
validation, and therefore types may not be available.)
Some common row-expressions are: RexLiteral (constant value),
RexVariable (variable), RexCall (call to operator with
operands). Expressions are generally created using a RexBuilder
factory.
All sub-classes of RexNode are immutable.
| Modifier and Type | Field and Description |
|---|---|
protected @MonotonicNonNull String |
digest |
| Constructor and Description |
|---|
RexNode() |
| Modifier and Type | Method and Description |
|---|---|
abstract <R,P> R |
accept(RexBiVisitor<R,P> visitor,
P arg)
Accepts a visitor with a payload, dispatching to the right overloaded
RexBiVisitor.visitInputRef(RexInputRef, Object) visitXxx} method. |
abstract <R> R |
accept(RexVisitor<R> visitor)
Accepts a visitor, dispatching to the right overloaded
visitXxx method. |
abstract boolean |
equals(@Nullable Object obj) |
SqlKind |
getKind()
Returns the kind of node this is.
|
abstract RelDataType |
getType() |
abstract int |
hashCode() |
boolean |
isA(Collection<SqlKind> kinds) |
boolean |
isA(SqlKind kind) |
boolean |
isAlwaysFalse()
Returns whether this expression always returns false.
|
boolean |
isAlwaysTrue()
Returns whether this expression always returns true.
|
int |
nodeCount()
Returns the number of nodes in this expression.
|
String |
toString() |
protected @MonotonicNonNull String digest
public abstract RelDataType getType()
public boolean isAlwaysTrue()
TRUE.)public boolean isAlwaysFalse()
FALSE.)public boolean isA(SqlKind kind)
public boolean isA(Collection<SqlKind> kinds)
public SqlKind getKind()
public int nodeCount()
Leaf nodes, such as RexInputRef or RexLiteral, have
a count of 1. Calls have a count of 1 plus the sum of their operands.
Node count is a measure of expression complexity that is used by some planner rules to prevent deeply nested expressions.
public abstract <R> R accept(RexVisitor<R> visitor)
visitXxx method.
Also see RexUtil.apply(RexVisitor, java.util.List, RexNode),
which applies a visitor to several expressions simultaneously.
public abstract <R,P> R accept(RexBiVisitor<R,P> visitor, P arg)
RexBiVisitor.visitInputRef(RexInputRef, Object) visitXxx} method.public abstract boolean equals(@Nullable Object obj)
Every node must implement equals(java.lang.Object) based on its content
public abstract int hashCode()
Every node must implement hashCode() consistent with
equals(java.lang.Object)
Copyright © 2012-2022 Apache Software Foundation. All Rights Reserved.