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
FieldsModifier and TypeFieldDescriptionprotected final com.google.common.collect.ImmutableList<RelHint>Fields inherited from class org.apache.calcite.rel.AbstractRelNode
digest, id, rowType, traitSet -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSnapshot(RelOptCluster cluster, RelTraitSet traitSet, List<RelHint> hints, RelNode input, RexNode period) Creates a Snapshot.protectedSnapshot(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 RelNodecopy(RelTraitSet traitSet, List<RelNode> inputs) Creates a copy of this relational expression, perhaps changing traits and inputs.abstract Snapshotcopy(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.booleanisValid(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, replaceInputMethods 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, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.calcite.rel.hint.Hintable
attachHints, withHintsMethods 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:RelNodeCreates 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:
copyin interfaceRelNode- Overrides:
copyin classAbstractRelNode- Parameters:
traitSet- Trait setinputs- Inputs- Returns:
- Copy of this relational expression, substituting traits and inputs
-
copy
-
accept
Description copied from interface:RelNodeAccepts 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:
acceptin interfaceRelNode- Overrides:
acceptin 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:AbstractRelNodeDescribes 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:
explainTermsin classSingleRel- Parameters:
pw- Plan writer- Returns:
- Plan writer for fluent-explain pattern
-
getPeriod
-
isValid
Description copied from interface:RelNodeReturns 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
AssertionErrorif it is not valid.- Specified by:
isValidin interfaceRelNode- Overrides:
isValidin classAbstractRelNode- Parameters:
litmus- What to do if invalidcontext- Context for validity checking- Returns:
- Whether relational expression is valid
-
getHints
Description copied from interface:HintableReturns the hints of this relational expressions as an immutable list.
-