public interface Converter extends RelNode
Converter
to
indicate that it converts a physical attribute, or
trait
, of a relational expression
from one value to another.
Sometimes this conversion is expensive; for example, to convert a non-distinct to a distinct object stream, we have to clone every object in the input.
A converter does not change the logical expression being evaluated; after
conversion, the number of rows and the values of those rows will still be the
same. By declaring itself to be a converter, a relational expression is
telling the planner about this equivalence, and the planner groups
expressions which are logically equivalent but have different physical traits
into groups called RelSet
s.
In principle one could devise converters which change multiple traits
simultaneously (say change the sort-order and the physical location of a
relational expression). In which case, the method getInputTraits()
would return a RelTraitSet
. But for
simplicity, this class only allows one trait to be converted at a
time; all other traits are assumed to be preserved.
RelNode.Context
Modifier and Type | Method and Description |
---|---|
RelNode |
getInput()
Returns the sole input relational expression
|
RelTraitSet |
getInputTraits()
Returns the trait of the input relational expression.
|
RelTraitDef |
getTraitDef()
Returns the definition of trait which this converter works on.
|
accept, accept, childrenAccept, collectVariablesSet, collectVariablesUsed, computeSelfCost, computeSelfCost, copy, estimateRowCount, explain, getChildExps, getCollationList, getConvention, getCorrelVariable, getExpectedInputRowType, getInput, getInputs, getQuery, getRelTypeName, getRows, getRowType, getTable, getVariablesSet, getVariablesStopped, isDistinct, isKey, isValid, isValid, metadata, onRegister, recomputeDigest, register, replaceInput
getCluster, getDescription, getDigest, getId, getTraitSet
RelTraitSet getInputTraits()
RelTraitDef getTraitDef()
The input relational expression (matched by the rule) must possess
this trait and have the value given by getInputTraits()
, and the
traits of the output of this converter given by RelOptNode.getTraitSet()
will
have one trait altered and the other orthogonal traits will be the same.
RelNode getInput()
Copyright © 2012–2019 The Apache Software Foundation. All rights reserved.