Package org.apache.calcite.rel.core
Class Snapshot
java.lang.Object
org.apache.calcite.rel.AbstractRelNode
org.apache.calcite.rel.SingleRel
org.apache.calcite.rel.core.Snapshot
- All Implemented Interfaces:
Cloneable
,RelOptNode
,Hintable
,RelNode
- Direct Known Subclasses:
LogicalSnapshot
Relational expression that returns the contents of a relation expression as
it was at a given time in the past.
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).
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.calcite.rel.RelNode
RelNode.Context
-
Field Summary
Modifier and TypeFieldDescriptionprotected final com.google.common.collect.ImmutableList<RelHint>
Fields inherited from class org.apache.calcite.rel.AbstractRelNode
digest, id, rowType, traitSet
-
Constructor Summary
ModifierConstructorDescriptionprotected
Snapshot
(RelOptCluster cluster, RelTraitSet traitSet, List<RelHint> hints, RelNode input, RexNode period) Creates a Snapshot.protected
Snapshot
(RelOptCluster cluster, RelTraitSet traitSet, RelNode input, RexNode period) Creates a Snapshot.Creates a Snapshot by parsing serialized output. -
Method Summary
Modifier and TypeMethodDescriptionaccept
(RexShuttle shuttle) Accepts a visit from a shuttle.final RelNode
copy
(RelTraitSet traitSet, List<RelNode> inputs) Creates a copy of this relational expression, perhaps changing traits and inputs.abstract Snapshot
copy
(RelTraitSet traitSet, RelNode input, RexNode period) Describes the inputs and attributes of this relational expression.com.google.common.collect.ImmutableList<RelHint>
getHints()
Returns the hints of this relational expressions as an immutable list.boolean
isValid
(Litmus litmus, @Nullable RelNode.Context context) Returns whether this relational expression is valid.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, collectVariablesSet, collectVariablesUsed, computeSelfCost, deepEquals, deepHashCode, equals, explain, getCluster, getConvention, getCorrelVariable, getDescription, getDigest, getExpectedInputRowType, getId, getInput, getRelDigest, getRelTypeName, getRowType, getTable, getTraitSet, getVariablesSet, hashCode, isEnforcer, metadata, onRegister, recomputeDigest, register, sole, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.calcite.rel.hint.Hintable
attachHints, withHints
Methods inherited from interface org.apache.calcite.rel.RelNode
explain, fieldIsNullable, stripped
-
Field Details
-
hints
-
-
Constructor Details
-
Snapshot
Creates a Snapshot by parsing serialized output. -
Snapshot
protected Snapshot(RelOptCluster cluster, RelTraitSet traitSet, List<RelHint> hints, RelNode input, RexNode period) Creates a Snapshot.- Parameters:
cluster
- Cluster that this relational expression belongs totraitSet
- The traits of this relational expressionhints
- Hints for this nodeinput
- Input relational expressionperiod
- Timestamp expression which as the table was at the given time in the past
-
Snapshot
Creates a Snapshot.- Parameters:
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 past
-
-
Method Details
-
copy
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
-
copy
-
accept
Description copied from interface:RelNode
Accepts a visit from a shuttle. If the shuttle updates expression, then a copy of the relation should be created. This new relation might have a different row-type.- Specified by:
accept
in interfaceRelNode
- Overrides:
accept
in classAbstractRelNode
- Parameters:
shuttle
- Shuttle- Returns:
- A copy of this node incorporating changes made by the shuttle to this node's children
-
explainTerms
Description copied from class:AbstractRelNode
Describes the inputs and attributes of this relational expression. Each node should callsuper.explainTerms
, then call theRelWriter.input(String, RelNode)
andRelWriter.item(String, Object)
methods for each input and attribute.- Overrides:
explainTerms
in classSingleRel
- Parameters:
pw
- Plan writer- Returns:
- Plan writer for fluent-explain pattern
-
getPeriod
-
isValid
Description copied from interface:RelNode
Returns whether this relational expression is valid.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.- Specified by:
isValid
in interfaceRelNode
- Overrides:
isValid
in classAbstractRelNode
- Parameters:
litmus
- What to do if invalidcontext
- Context for validity checking- Returns:
- Whether relational expression is valid
-
getHints
Description copied from interface:Hintable
Returns the hints of this relational expressions as an immutable list.
-