public interface Hintable
Hintable is a kind of RelNode that can attach RelHints.
This interface is experimental, RelNodes that implement it
have a constructor parameter named "hints" used to construct relational expression
with given hints.
Current design is not that elegant and mature, because we have to copy the hints whenever these relational expressions are copied or used to derive new relational expressions. Even though we have implemented the mechanism to propagate the hints, for large queries, there would be many cases where the hints are not copied to the right RelNode, and the effort/memory is wasted if we are copying the hint to a RelNode but the hint is not used.
| Modifier and Type | Method and Description |
|---|---|
default RelNode |
attachHints(List<RelHint> hintList)
Attaches list of hints to this relational expression.
|
com.google.common.collect.ImmutableList<RelHint> |
getHints()
Returns the hints of this relational expressions as an immutable list.
|
default RelNode |
withHints(List<RelHint> hintList)
Returns a new relational expression with the specified hints
hintList. |
default RelNode attachHints(List<RelHint> hintList)
This method is only for internal use during sql-to-rel conversion.
Sub-class should return a new copy of the relational expression.
The default implementation merges the given hints with existing ones, put them in one list and eliminate the duplicates; then returns a new copy of this relational expression with the merged hints.
hintList - The hints to attach to this relational expressionhintList attacheddefault RelNode withHints(List<RelHint> hintList)
hintList.
This method should be overridden by every logical node that supports hint. It is only for internal use during decorrelation.
Sub-class should return a new copy of the relational expression.
The default implementation returns the relational expression directly only because not every kind of relational expression supports hints.
com.google.common.collect.ImmutableList<RelHint> getHints()
Copyright © 2012-2022 Apache Software Foundation. All Rights Reserved.