net.sf.farrago.test
Class Rex2CalcPlanTest.TesterImpl

java.lang.Object
  extended by org.eigenbase.test.SqlToRelTestBase.TesterImpl
      extended by net.sf.farrago.test.Rex2CalcPlanTest.TesterImpl
All Implemented Interfaces:
Rex2CalcPlanTest.Tester, SqlToRelTestBase.Tester
Enclosing class:
Rex2CalcPlanTest

 class Rex2CalcPlanTest.TesterImpl
extends SqlToRelTestBase.TesterImpl
implements Rex2CalcPlanTest.Tester

Implementation of Rex2CalcPlanTest.Tester.


Nested Class Summary
private  class Rex2CalcPlanTest.TesterImpl.MyRelOptRuleCall
           
 
Constructor Summary
Rex2CalcPlanTest.TesterImpl(DiffRepository diffRepos)
          Creates a TesterImpl.
 
Method Summary
private  RelNode callRule(RelOptRule rule, RelNode[] rels)
           
 void check(String sql, boolean nullSemantics, boolean shortCircuit)
          Compiles a SQL statement, and compares the generated calc program with the contents of a reference file with the same name as the current test.
 void checkAgg(String sql, boolean shortCircuit)
          Compiles a SQL statement containing aggregation, and compares the generated programs (init, add, drop) with the contents of a reference file.
 void checkWinAgg(String sql, boolean shortCircuit)
          Compiles a SQL statement containing windowed aggregation, and compares the generated programs (for init, add, drop and output) with the contents of a reference file.
 
Methods inherited from class org.eigenbase.test.SqlToRelTestBase.TesterImpl
assertConvertsTo, convertSqlToRel, createCatalogReader, createOperatorTable, createPlanner, createRelOptSchema, createSqlToRelConverter, createTypeFactory, createValidator, getConformance, getDiffRepos, getOperatorTable, getPlanner, parseQuery
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eigenbase.test.SqlToRelTestBase.Tester
assertConvertsTo, convertSqlToRel, createCatalogReader, createPlanner, createRelOptSchema, createValidator, getConformance, getDiffRepos, getOperatorTable, parseQuery
 

Constructor Detail

Rex2CalcPlanTest.TesterImpl

Rex2CalcPlanTest.TesterImpl(DiffRepository diffRepos)
Creates a TesterImpl.

Parameters:
diffRepos - Diff repository
Method Detail

check

public void check(String sql,
                  boolean nullSemantics,
                  boolean shortCircuit)
Description copied from interface: Rex2CalcPlanTest.Tester
Compiles a SQL statement, and compares the generated calc program with the contents of a reference file with the same name as the current test.

Specified by:
check in interface Rex2CalcPlanTest.Tester
Parameters:
sql - SQL statement. Must be of the form "SELECT ... FROM ... WHERE".
nullSemantics - If true, adds logic to ensure that a WHERE clause which evalutes to NULL will filter out rows (as if it had evaluated to FALSE).
shortCircuit - Generate short-circuit logic to optimize logical operations such as AND and OR conditions.

checkWinAgg

public void checkWinAgg(String sql,
                        boolean shortCircuit)
Description copied from interface: Rex2CalcPlanTest.Tester
Compiles a SQL statement containing windowed aggregation, and compares the generated programs (for init, add, drop and output) with the contents of a reference file.

Specified by:
checkWinAgg in interface Rex2CalcPlanTest.Tester
Parameters:
sql - SQL statement. Must be of the form "SELECT agg OVER window, agg OVER window ... FROM ... WINDOW decl".
shortCircuit - Generate short-circuit logic to optimize logical operations such as AND and OR conditions.

callRule

private RelNode callRule(RelOptRule rule,
                         RelNode[] rels)

checkAgg

public void checkAgg(String sql,
                     boolean shortCircuit)
Description copied from interface: Rex2CalcPlanTest.Tester
Compiles a SQL statement containing aggregation, and compares the generated programs (init, add, drop) with the contents of a reference file.

Specified by:
checkAgg in interface Rex2CalcPlanTest.Tester
Parameters:
sql - SQL statement. Must be of the form "SELECT ... FROM ... WHERE ... GROUP BY ...".
shortCircuit - Generate short-circuit logic to optimize logical operations such as AND and OR conditions.