Interface Hintable

All Known Implementing Classes:
Aggregate, Bindables.BindableAggregate, Bindables.BindableJoin, Bindables.BindableProject, Bindables.BindableTableScan, Calc, CassandraProject, CassandraTableScan, CsvTableScan, CsvTableScan, ElasticsearchAggregate, ElasticsearchProject, ElasticsearchTableScan, EnumerableAggregate, EnumerableAggregateBase, EnumerableBatchNestedLoopJoin, EnumerableCalc, EnumerableHashJoin, EnumerableMergeJoin, EnumerableNestedLoopJoin, EnumerableProject, EnumerableSortedAggregate, EnumerableTableScan, EquiJoin, EquiJoin, GeodeAggregate, GeodeProject, GeodeTableScan, JdbcRules.JdbcAggregate, JdbcRules.JdbcJoin, JdbcRules.JdbcProject, JdbcTableScan, Join, LogicalAggregate, LogicalCalc, LogicalJoin, LogicalProject, LogicalTableScan, MongoAggregate, MongoProject, MongoTableScan, PigAggregate, PigJoin, PigProject, PigTableScan, Project, SplunkTableScan, StarTable.StarTableScan, TableScan

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 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.
  • 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.