Package org.apache.calcite.rex
Class RexSubQuery
- java.lang.Object
-
- org.apache.calcite.rex.RexNode
-
- org.apache.calcite.rex.RexCall
-
- org.apache.calcite.rex.RexSubQuery
-
public class RexSubQuery extends RexCall
Scalar expression that represents an IN, EXISTS or scalar sub-query.
-
-
Constructor Summary
Constructors Modifier Constructor Description private
RexSubQuery(RelDataType type, SqlOperator op, com.google.common.collect.ImmutableList<RexNode> operands, RelNode rel)
-
Method Summary
All Methods Static 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.RexSubQuery
clone(RelNode rel)
RexSubQuery
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)
static RexSubQuery
exists(RelNode rel)
Creates an EXISTS sub-query.static RexSubQuery
in(RelNode rel, com.google.common.collect.ImmutableList<RexNode> nodes)
Creates an IN sub-query.static RexSubQuery
scalar(RelNode rel)
Creates a scalar sub-query.static RexSubQuery
some(RelNode rel, com.google.common.collect.ImmutableList<RexNode> nodes, SqlQuantifyOperator op)
Creates a SOME sub-query.(package private) static RelDataType
type(RelNode rel, com.google.common.collect.ImmutableList<RexNode> nodes)
-
Methods inherited from class org.apache.calcite.rex.RexCall
equals, getKind, getOperands, getOperator, getType, hashCode, isAlwaysFalse, isAlwaysTrue, toString
-
-
-
-
Field Detail
-
rel
public final RelNode rel
-
-
Constructor Detail
-
RexSubQuery
private RexSubQuery(RelDataType type, SqlOperator op, com.google.common.collect.ImmutableList<RexNode> operands, RelNode rel)
-
-
Method Detail
-
in
public static RexSubQuery in(RelNode rel, com.google.common.collect.ImmutableList<RexNode> nodes)
Creates an IN sub-query.
-
some
public static RexSubQuery some(RelNode rel, com.google.common.collect.ImmutableList<RexNode> nodes, SqlQuantifyOperator op)
Creates a SOME sub-query.There is no ALL. For
x comparison ALL (sub-query)
use insteadNOT (x inverse-comparison SOME (sub-query))
. Ifcomparison
is>
thennegated-comparison
is<=
, and so forth.
-
type
static RelDataType type(RelNode rel, com.google.common.collect.ImmutableList<RexNode> nodes)
-
exists
public static RexSubQuery exists(RelNode rel)
Creates an EXISTS sub-query.
-
scalar
public static RexSubQuery scalar(RelNode rel)
Creates a scalar sub-query.
-
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.
-
computeDigest
@Nonnull protected java.lang.String computeDigest(boolean withType)
- Overrides:
computeDigest
in classRexCall
-
clone
public RexSubQuery clone(RelDataType type, java.util.List<RexNode> operands)
Description copied from class:RexCall
Creates a new call to the same operator with different operands.
-
clone
public RexSubQuery clone(RelNode rel)
-
-