org.eigenbase.sql2rel
Class SqlToRelConverter.LookupContext

java.lang.Object
  extended by org.eigenbase.sql2rel.SqlToRelConverter.LookupContext
Enclosing class:
SqlToRelConverter

private static class SqlToRelConverter.LookupContext
extends Object

Context to find a relational expression to a field offset.


Field Summary
private  List<Pair<RelNode,Integer>> relOffsetList
           
 
Constructor Summary
SqlToRelConverter.LookupContext(RelNode rel, int systemFieldCount)
          Creates a LookupContext with a single input relational expression.
SqlToRelConverter.LookupContext(SqlToRelConverter.Blackboard bb, RelNode[] rels, int systemFieldCount)
          Creates a LookupContext with multiple input relational expressions.
 
Method Summary
(package private)  Pair<RelNode,Integer> findRel(int offset)
          Returns the relational expression with a given offset, and the ordinal in the combined row of its first field.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

relOffsetList

private final List<Pair<RelNode,Integer>> relOffsetList
Constructor Detail

SqlToRelConverter.LookupContext

SqlToRelConverter.LookupContext(RelNode rel,
                                int systemFieldCount)
Creates a LookupContext with a single input relational expression.

Parameters:
rel - Relational expression
systemFieldCount - Number of system fields

SqlToRelConverter.LookupContext

SqlToRelConverter.LookupContext(SqlToRelConverter.Blackboard bb,
                                RelNode[] rels,
                                int systemFieldCount)
Creates a LookupContext with multiple input relational expressions.

Parameters:
bb - Context for translating this subquery
rels - Relational expressions
systemFieldCount - Number of system fields
Method Detail

findRel

Pair<RelNode,Integer> findRel(int offset)
Returns the relational expression with a given offset, and the ordinal in the combined row of its first field.

For example, in Emp JOIN Dept, findRel(1) returns the relational expression for Dept and offset 6 (because Emp has 6 fields, therefore the first field of Dept is field 6.

Parameters:
offset - Offset of relational expression in FROM clause
Returns:
Relational expression and the ordinal of its first field