Interface Hintable

All Known Implementing Classes:
Aggregate, Bindables.BindableAggregate, Bindables.BindableFilter, Bindables.BindableIntersect, Bindables.BindableJoin, Bindables.BindableMinus, Bindables.BindableProject, Bindables.BindableSort, Bindables.BindableTableScan, Bindables.BindableUnion, Bindables.BindableValues, Bindables.BindableWindow, Calc, CassandraFilter, CassandraProject, CassandraSort, CassandraTableScan, Correlate, CsvTableScan, CsvTableScan, ElasticsearchAggregate, ElasticsearchFilter, ElasticsearchProject, ElasticsearchSort, ElasticsearchTableScan, EnumerableAggregate, EnumerableAggregateBase, EnumerableBatchNestedLoopJoin, EnumerableCalc, EnumerableCorrelate, EnumerableFilter, EnumerableHashJoin, EnumerableIntersect, EnumerableLimitSort, EnumerableMergeJoin, EnumerableMergeUnion, EnumerableMinus, EnumerableNestedLoopJoin, EnumerableProject, EnumerableSort, EnumerableSortedAggregate, EnumerableTableFunctionScan, EnumerableTableScan, EnumerableUnion, EnumerableValues, EnumerableWindow, EquiJoin, EquiJoin, Filter, GeodeAggregate, GeodeFilter, GeodeProject, GeodeSort, GeodeTableScan, InnodbFilter, InnodbProject, InnodbSort, InnodbTableScan, Intersect, JdbcRules.JdbcAggregate, JdbcRules.JdbcFilter, JdbcRules.JdbcIntersect, JdbcRules.JdbcJoin, JdbcRules.JdbcMinus, JdbcRules.JdbcProject, JdbcRules.JdbcSort, JdbcRules.JdbcUnion, JdbcRules.JdbcValues, JdbcTableScan, Join, LogicalAggregate, LogicalCalc, LogicalCorrelate, LogicalFilter, LogicalIntersect, LogicalJoin, LogicalMinus, LogicalProject, LogicalSnapshot, LogicalSort, LogicalTableFunctionScan, LogicalTableScan, LogicalUnion, LogicalValues, LogicalWindow, Minus, MongoAggregate, MongoFilter, MongoProject, MongoSort, MongoTableScan, PigAggregate, PigFilter, PigJoin, PigProject, PigTableScan, Project, SetOp, Snapshot, Sort, SparkRules.SparkValues, SplunkTableScan, SqlToRelTestBase.CustomCorrelate, StarTable.StarTableScan, TableFunctionScan, TableScan, Union, Values, Window

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.

  • Method Summary

    Modifier and Type
    Method
    Description
    default RelNode
    Attaches list of hints to this relational expression.
    com.google.common.collect.ImmutableList<RelHint>
    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.
  • Method Details

    • attachHints

      default RelNode attachHints(List<RelHint> hintList)
      Attaches list of hints to this relational expression.

      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.

      Parameters:
      hintList - The hints to attach to this relational expression
      Returns:
      Relational expression with the hints hintList attached
    • withHints

      default RelNode withHints(List<RelHint> hintList)
      Returns a new relational expression with the specified hints 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.

      Returns:
      Relational expression with set up hints
    • getHints

      com.google.common.collect.ImmutableList<RelHint> getHints()
      Returns the hints of this relational expressions as an immutable list.