Package org.apache.calcite.rex
Class RexNode
- java.lang.Object
-
- org.apache.calcite.rex.RexNode
-
- Direct Known Subclasses:
RexCall
,RexFieldAccess
,RexLiteral
,RexRangeRef
,RexVariable
public abstract class RexNode extends java.lang.Object
Row expression.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 aRexBuilder
factory.All sub-classes of RexNode are immutable.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
digest
-
Constructor Summary
Constructors Constructor Description RexNode()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract <R,P>
Raccept(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
equals(java.lang.Object obj)
SqlKind
getKind()
Returns the kind of node this is.abstract RelDataType
getType()
abstract int
hashCode()
boolean
isA(java.util.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.java.lang.String
toString()
-
-
-
Method Detail
-
getType
public abstract RelDataType 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
public boolean isA(SqlKind kind)
-
isA
public boolean isA(java.util.Collection<SqlKind> kinds)
-
getKind
public SqlKind getKind()
Returns the kind of node this is.- Returns:
- Node kind, never null
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
accept
public abstract <R> R accept(RexVisitor<R> visitor)
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
public abstract <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.
-
equals
public abstract boolean equals(java.lang.Object obj)
Every node must implement
equals(java.lang.Object)
based on its content- Overrides:
equals
in classjava.lang.Object
-
hashCode
public abstract int hashCode()
Every node must implement
hashCode()
consistent withequals(java.lang.Object)
- Overrides:
hashCode
in classjava.lang.Object
-
-