Class RexCall
- java.lang.Object
-
- org.apache.calcite.rex.RexNode
-
- org.apache.calcite.rex.RexCall
-
- Direct Known Subclasses:
Match.RexMRAggCall
,RexOver
,RexSubQuery
,Window.RexWinAggCall
public class RexCall extends RexNode
An expression formed by a call to an operator with zero or more expressions as operands.Operators may be binary, unary, functions, special syntactic constructs like
CASE ... WHEN ... END
, or even internally generated constructs like implicit type conversions. The syntax of the operator is really irrelevant, because row-expressions (unlikeSQL expressions
) do not directly represent a piece of source code.It's not often necessary to sub-class this class. The smarts should be in the operator, rather than the call. Any extra information about the call can often be encoded as extra arguments. (These don't need to be hidden, because no one is going to be generating source code from this tree.)
-
-
Field Summary
Fields Modifier and Type Field Description SqlOperator
op
com.google.common.collect.ImmutableList<RexNode>
operands
RelDataType
type
-
Constructor Summary
Constructors Modifier Constructor Description protected
RexCall(RelDataType type, SqlOperator op, java.util.List<? extends RexNode> operands)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <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.<R> R
accept(RexVisitor<R> visitor)
Accepts a visitor, dispatching to the right overloadedvisitXxx
method.RexCall
clone(RelDataType type, java.util.List<RexNode> operands)
Creates a new call to the same operator with different operands.protected java.lang.String
computeDigest(boolean withType)
boolean
equals(java.lang.Object obj)
SqlKind
getKind()
Returns the kind of node this is.java.util.List<RexNode>
getOperands()
SqlOperator
getOperator()
RelDataType
getType()
int
hashCode()
boolean
isAlwaysFalse()
Returns whether this expression always returns false.boolean
isAlwaysTrue()
Returns whether this expression always returns true.java.lang.String
toString()
-
-
-
Field Detail
-
op
public final SqlOperator op
-
operands
public final com.google.common.collect.ImmutableList<RexNode> operands
-
type
public final RelDataType type
-
-
Constructor Detail
-
RexCall
protected RexCall(RelDataType type, SqlOperator op, java.util.List<? extends RexNode> operands)
-
-
Method Detail
-
computeDigest
@Nonnull protected java.lang.String computeDigest(boolean withType)
-
accept
public <R> R accept(RexVisitor<R> visitor)
Description copied from class:RexNode
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 <R,P> R accept(RexBiVisitor<R,P> visitor, P arg)
Description copied from class:RexNode
Accepts a visitor with a payload, dispatching to the right overloadedRexBiVisitor.visitInputRef(RexInputRef, Object)
visitXxx} method.
-
getType
public RelDataType getType()
-
isAlwaysTrue
public boolean isAlwaysTrue()
Description copied from class:RexNode
Returns whether this expression always returns true. (Such as if this expression is equal to the literalTRUE
.)- Overrides:
isAlwaysTrue
in classRexNode
-
isAlwaysFalse
public boolean isAlwaysFalse()
Description copied from class:RexNode
Returns whether this expression always returns false. (Such as if this expression is equal to the literalFALSE
.)- Overrides:
isAlwaysFalse
in classRexNode
-
getKind
public SqlKind getKind()
Description copied from class:RexNode
Returns the kind of node this is.
-
getOperands
public java.util.List<RexNode> getOperands()
-
getOperator
public SqlOperator getOperator()
-
clone
public RexCall clone(RelDataType type, java.util.List<RexNode> operands)
Creates a new call to the same operator with different operands.- Parameters:
type
- Return typeoperands
- Operands to call- Returns:
- New call
-
equals
public boolean equals(java.lang.Object obj)
Description copied from class:RexNode
Every node must implement
RexNode.equals(java.lang.Object)
based on its content
-
hashCode
public int hashCode()
Description copied from class:RexNode
Every node must implement
RexNode.hashCode()
consistent withRexNode.equals(java.lang.Object)
-
-