org.eigenbase.test
Interface SqlToRelTestBase.Tester

All Known Subinterfaces:
Rex2CalcPlanTest.Tester
All Known Implementing Classes:
Rex2CalcPlanTest.TesterImpl, SqlToRelTestBase.TesterImpl
Enclosing class:
SqlToRelTestBase

public static interface SqlToRelTestBase.Tester

Helper class which contains default implementations of methods used for running sql-to-rel conversion tests.


Method Summary
 void assertConvertsTo(String sql, String plan)
          Checks that a SQL statement converts to a given plan.
 RelNode convertSqlToRel(String sql)
          Converts a SQL string to a RelNode tree.
 SqlValidatorCatalogReader createCatalogReader(RelDataTypeFactory typeFactory)
          Factory method for a SqlValidatorCatalogReader.
 RelOptPlanner createPlanner()
           
 SqlToRelTestBase.MockRelOptSchema createRelOptSchema(SqlValidatorCatalogReader catalogReader, RelDataTypeFactory typeFactory)
           
 SqlValidator createValidator(SqlValidatorCatalogReader catalogReader, RelDataTypeFactory typeFactory)
          Factory method to create a SqlValidator.
 SqlConformance getConformance()
          Returns the SQL dialect to test.
 DiffRepository getDiffRepos()
           
 SqlOperatorTable getOperatorTable()
          Returns the SqlOperatorTable to use.
 SqlNode parseQuery(String sql)
           
 

Method Detail

convertSqlToRel

RelNode convertSqlToRel(String sql)
Converts a SQL string to a RelNode tree.

Parameters:
sql - SQL statement
Returns:
Relational expression, never null
"Precondition:"
sql != null
"Postcondition:"
return != null

parseQuery

SqlNode parseQuery(String sql)
                   throws Exception
Throws:
Exception

createValidator

SqlValidator createValidator(SqlValidatorCatalogReader catalogReader,
                             RelDataTypeFactory typeFactory)
Factory method to create a SqlValidator.


createCatalogReader

SqlValidatorCatalogReader createCatalogReader(RelDataTypeFactory typeFactory)
Factory method for a SqlValidatorCatalogReader.


createPlanner

RelOptPlanner createPlanner()

getOperatorTable

SqlOperatorTable getOperatorTable()
Returns the SqlOperatorTable to use.


createRelOptSchema

SqlToRelTestBase.MockRelOptSchema createRelOptSchema(SqlValidatorCatalogReader catalogReader,
                                                     RelDataTypeFactory typeFactory)

getConformance

SqlConformance getConformance()
Returns the SQL dialect to test.


assertConvertsTo

void assertConvertsTo(String sql,
                      String plan)
Checks that a SQL statement converts to a given plan.

Parameters:
sql - SQL query
plan - Expected plan

getDiffRepos

DiffRepository getDiffRepos()