Package org.apache.calcite.rel.core
Class Sample
- java.lang.Object
-
- org.apache.calcite.rel.AbstractRelNode
-
- org.apache.calcite.rel.SingleRel
-
- org.apache.calcite.rel.core.Sample
-
- All Implemented Interfaces:
java.lang.Cloneable
,RelOptNode
,RelNode
public class Sample extends SingleRel
Relational expression that returns a sample of the rows from its input.In SQL, a sample is expressed using the
TABLESAMPLE BERNOULLI
orSYSTEM
keyword applied to a table, view or sub-query.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.calcite.rel.RelNode
RelNode.Context
-
-
Field Summary
Fields Modifier and Type Field Description private RelOptSamplingParameters
params
-
Fields inherited from class org.apache.calcite.rel.AbstractRelNode
digest, id, rowType, traitSet
-
-
Constructor Summary
Constructors Constructor Description Sample(RelOptCluster cluster, RelNode child, RelOptSamplingParameters params)
Sample(RelInput input)
Creates a Sample by parsing serialized output.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description RelNode
copy(RelTraitSet traitSet, java.util.List<RelNode> inputs)
Creates a copy of this relational expression, perhaps changing traits and inputs.RelWriter
explainTerms(RelWriter pw)
Describes the inputs and attributes of this relational expression.RelOptSamplingParameters
getSamplingParameters()
Retrieve the sampling parameters for this Sample.private static RelOptSamplingParameters
getSamplingParameters(RelInput input)
-
Methods inherited from class org.apache.calcite.rel.SingleRel
childrenAccept, deriveRowType, estimateRowCount, getInput, getInputs, replaceInput
-
Methods inherited from class org.apache.calcite.rel.AbstractRelNode
accept, accept, collectVariablesSet, collectVariablesUsed, computeDigest, computeSelfCost, computeSelfCost, explain, getChildExps, getCluster, getCollationList, getConvention, getCorrelVariable, getDescription, getDigest, getExpectedInputRowType, getId, getInput, getQuery, getRelTypeName, getRows, getRowType, getTable, getTraitSet, getVariablesSet, getVariablesStopped, isDistinct, isKey, isValid, isValid, metadata, onRegister, recomputeDigest, register, sole, toString
-
-
-
-
Field Detail
-
params
private final RelOptSamplingParameters params
-
-
Constructor Detail
-
Sample
public Sample(RelOptCluster cluster, RelNode child, RelOptSamplingParameters params)
-
Sample
public Sample(RelInput input)
Creates a Sample by parsing serialized output.
-
-
Method Detail
-
getSamplingParameters
private static RelOptSamplingParameters getSamplingParameters(RelInput input)
-
copy
public RelNode copy(RelTraitSet traitSet, java.util.List<RelNode> inputs)
Description copied from interface:RelNode
Creates a copy of this relational expression, perhaps changing traits and inputs.Sub-classes with other important attributes are encouraged to create variants of this method with more parameters.
- Specified by:
copy
in interfaceRelNode
- Overrides:
copy
in classAbstractRelNode
- Parameters:
traitSet
- Trait setinputs
- Inputs- Returns:
- Copy of this relational expression, substituting traits and inputs
-
getSamplingParameters
public RelOptSamplingParameters getSamplingParameters()
Retrieve the sampling parameters for this Sample.
-
explainTerms
public RelWriter explainTerms(RelWriter pw)
Description copied from class:AbstractRelNode
Describes the inputs and attributes of this relational expression. Each node should callsuper.explainTerms
, then call theRelWriterImpl.input(String, RelNode)
andRelWriterImpl.item(String, Object)
methods for each input and attribute.- Overrides:
explainTerms
in classSingleRel
- Parameters:
pw
- Plan writer- Returns:
- Plan writer for fluent-explain pattern
-
-