Class SqlToRelTestBase

  • Direct Known Subclasses:
    RelMetadataTest, RelOptTestBase, SqlToRelConverterTest

    public abstract class SqlToRelTestBase
    extends java.lang.Object
    SqlToRelTestBase is an abstract base for tests which involve conversion from SQL to relational algebra.

    SQL statements to be translated can use the schema defined in MockCatalogReader; note that this is slightly different from Farrago's SALES schema. If you get a parser or validator error from your test SQL, look down in the stack until you see "Caused by", which will usually tell you the real error.

    • Constructor Detail

      • SqlToRelTestBase

        public SqlToRelTestBase()
    • Method Detail

      • createTester

        protected SqlToRelTestBase.Tester createTester​(org.apache.calcite.sql.validate.SqlConformance conformance)
      • getDiffRepos

        protected DiffRepository getDiffRepos()
        Returns the default diff repository for this test, or null if there is no repository.

        The default implementation returns null.

        Sub-classes that want to use a diff repository can override. Sub-sub-classes can override again, inheriting test cases and overriding selected test results.

        And individual test cases can override by providing a different tester object.

        Returns:
        Diff repository
      • assertValid

        public static void assertValid​(org.apache.calcite.rel.RelNode rel)
        Checks that every node of a relational expression is valid.
        Parameters:
        rel - Relational expression