Class RexNode
- Direct Known Subclasses:
RexCall
,RexFieldAccess
,RexLambda
,RexLiteral
,RexRangeRef
,RexVariable
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.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract <R,
P> R accept
(RexBiVisitor<R, P> visitor, P arg) Accepts a visitor with a payload, dispatching to the right overloadedRexBiVisitor.visitInputRef(RexInputRef, Object)
visitXxx} method.abstract <R> R
accept
(RexVisitor<R> visitor) Accepts a visitor, dispatching to the right overloadedvisitXxx
method.abstract boolean
getKind()
Returns the kind of node this is.abstract RelDataType
getType()
abstract int
hashCode()
boolean
isA
(Collection<SqlKind> kinds) boolean
boolean
Returns whether this expression always returns false.boolean
Returns whether this expression always returns true.int
Returns the number of nodes in this expression.toString()
-
Field Details
-
digest
-
-
Constructor Details
-
RexNode
public RexNode()
-
-
Method Details
-
getType
-
isAlwaysTrue
public boolean isAlwaysTrue()Returns whether this expression always returns true. (Such as if this expression is equal to the literalTRUE
.) -
isAlwaysFalse
public boolean isAlwaysFalse()Returns whether this expression always returns false. (Such as if this expression is equal to the literalFALSE
.) -
isA
-
isA
-
getKind
Returns the kind of node this is.- Returns:
- Node kind, never null
-
toString
-
nodeCount
public int nodeCount()Returns the number of nodes in this expression.Leaf nodes, such as
RexInputRef
orRexLiteral
, 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.
-
accept
Accepts a visitor, dispatching to the right overloadedvisitXxx
method.Also see
RexUtil.apply(RexVisitor, java.util.List, RexNode)
, which applies a visitor to several expressions simultaneously. -
accept
Accepts a visitor with a payload, dispatching to the right overloadedRexBiVisitor.visitInputRef(RexInputRef, Object)
visitXxx} method. -
equals
Every node must implement
equals(java.lang.Object)
based on its content -
hashCode
public abstract int hashCode()Every node must implement
hashCode()
consistent withequals(java.lang.Object)
-