public abstract class Snapshot extends SingleRel
For example, if Products
is a temporal table, and
TableScan
(Products) is a relational operator that returns all
versions of the contents of the table, then
Snapshot
(TableScan(Products)) is a relational operator that only
returns the contents whose versions that overlap with the given specific
period (i.e. those that started before given period and ended after it).
RelNode.Context
Modifier and Type | Field and Description |
---|---|
private RexNode |
period |
digest, id, rowType, traitSet
Modifier | Constructor and Description |
---|---|
protected |
Snapshot(RelOptCluster cluster,
RelTraitSet traitSet,
RelNode input,
RexNode period)
Creates a Snapshot.
|
Modifier and Type | Method and Description |
---|---|
RelNode |
accept(RexShuttle shuttle)
Accepts a visit from a shuttle.
|
RelNode |
copy(RelTraitSet traitSet,
java.util.List<RelNode> inputs)
Creates a copy of this relational expression, perhaps changing traits and
inputs.
|
abstract Snapshot |
copy(RelTraitSet traitSet,
RelNode input,
RexNode period) |
RelWriter |
explainTerms(RelWriter pw)
Describes the inputs and attributes of this relational expression.
|
java.util.List<RexNode> |
getChildExps()
Returns a list of this relational expression's child expressions.
|
RexNode |
getPeriod() |
boolean |
isValid(Litmus litmus,
RelNode.Context context)
Returns whether this relational expression is valid.
|
childrenAccept, deriveRowType, estimateRowCount, getInput, getInputs, replaceInput
accept, collectVariablesSet, collectVariablesUsed, computeDigest, computeSelfCost, computeSelfCost, explain, getCluster, getCollationList, getConvention, getCorrelVariable, getDescription, getDigest, getExpectedInputRowType, getId, getInput, getQuery, getRelTypeName, getRows, getRowType, getTable, getTraitSet, getVariablesSet, getVariablesStopped, isDistinct, isKey, isValid, metadata, onRegister, recomputeDigest, register, sole, toString
private final RexNode period
protected Snapshot(RelOptCluster cluster, RelTraitSet traitSet, RelNode input, RexNode period)
cluster
- Cluster that this relational expression belongs totraitSet
- The traits of this relational expressioninput
- Input relational expressionperiod
- Timestamp expression which as the table was at the given
time in the pastpublic final RelNode copy(RelTraitSet traitSet, java.util.List<RelNode> inputs)
RelNode
Sub-classes with other important attributes are encouraged to create variants of this method with more parameters.
copy
in interface RelNode
copy
in class AbstractRelNode
traitSet
- Trait setinputs
- Inputspublic abstract Snapshot copy(RelTraitSet traitSet, RelNode input, RexNode period)
public java.util.List<RexNode> getChildExps()
RelNode
RelNode.getInputs()
.
The caller should treat the list as unmodifiable; typical
implementations will return an immutable list. If there are no
child expressions, returns an empty list, not null
.
getChildExps
in interface RelNode
getChildExps
in class AbstractRelNode
RelNode.accept(org.apache.calcite.rex.RexShuttle)
public RelNode accept(RexShuttle shuttle)
RelNode
accept
in interface RelNode
accept
in class AbstractRelNode
shuttle
- Shuttlepublic RelWriter explainTerms(RelWriter pw)
AbstractRelNode
super.explainTerms
, then call the
RelWriter.input(String, RelNode)
and
RelWriterImpl.item(String, Object)
methods for each input and attribute.explainTerms
in class SingleRel
pw
- Plan writerpublic RexNode getPeriod()
public boolean isValid(Litmus litmus, RelNode.Context context)
RelNode
If assertions are enabled, this method is typically called with
litmus
= THROW
, as follows:
assert rel.isValid(Litmus.THROW)
This signals that the method can throw an AssertionError
if it
is not valid.
isValid
in interface RelNode
isValid
in class AbstractRelNode
litmus
- What to do if invalidcontext
- Context for validity checkingCopyright © 2012–2019 The Apache Software Foundation. All rights reserved.