com.lucidera.farrago
Class LucidDbSqlValidator.EquiJoinFinder

java.lang.Object
  extended by org.eigenbase.sql.util.SqlBasicVisitor<Void>
      extended by com.lucidera.farrago.LucidDbSqlValidator.EquiJoinFinder
All Implemented Interfaces:
SqlVisitor<Void>
Enclosing class:
LucidDbSqlValidator

private class LucidDbSqlValidator.EquiJoinFinder
extends SqlBasicVisitor<Void>

Visitor that walks a SqlNode expression tree looking for an equijoin between a source and target column.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.eigenbase.sql.util.SqlBasicVisitor
SqlBasicVisitor.ArgHandler<R>, SqlBasicVisitor.ArgHandlerImpl<R>
 
Field Summary
private  boolean found
           
private  SqlValidatorScope scope
           
private  SqlIdentifier sourceCol
           
private  SqlIdentifier targetCol
           
 
Constructor Summary
LucidDbSqlValidator.EquiJoinFinder(SqlIdentifier targetCol, SqlIdentifier sourceCol, SqlValidatorScope scope)
           
 
Method Summary
private  boolean checkOperands(SqlNode op1, SqlNode op2)
          Determines if the first operand matches the target column and the second matches the source column
 boolean foundMatch()
           
 Void visit(SqlCall call)
          Visits a call to a SqlOperator.
 
Methods inherited from class org.eigenbase.sql.util.SqlBasicVisitor
visit, visit, visit, visit, visit, visit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

targetCol

private SqlIdentifier targetCol

sourceCol

private SqlIdentifier sourceCol

scope

private SqlValidatorScope scope

found

private boolean found
Constructor Detail

LucidDbSqlValidator.EquiJoinFinder

LucidDbSqlValidator.EquiJoinFinder(SqlIdentifier targetCol,
                                   SqlIdentifier sourceCol,
                                   SqlValidatorScope scope)
Method Detail

visit

public Void visit(SqlCall call)
Description copied from interface: SqlVisitor
Visits a call to a SqlOperator.

Specified by:
visit in interface SqlVisitor<Void>
Overrides:
visit in class SqlBasicVisitor<Void>
Parameters:
call - Call
See Also:
SqlCall.accept(SqlVisitor)

checkOperands

private boolean checkOperands(SqlNode op1,
                              SqlNode op2)
Determines if the first operand matches the target column and the second matches the source column

Parameters:
op1 - first operand
op2 - second operand
Returns:
true if a match has been found

foundMatch

public boolean foundMatch()