Class FrameworksTest


  • public class FrameworksTest
    extends java.lang.Object
    Unit tests for methods in Frameworks.
    • Constructor Detail

      • FrameworksTest

        public FrameworksTest()
    • Method Detail

      • testOptimize

        public void testOptimize()
      • testCreateRootSchemaWithNoMetadataSchema

        public void testCreateRootSchemaWithNoMetadataSchema()
        Unit test to test create root schema which has no "metadata" schema.
      • testTypeSystem

        public void testTypeSystem()
        Tests that validation (specifically, inferring the result of adding two DECIMAL(19, 0) values together) happens differently with a type system that allows a larger maximum precision for decimals.

        Test case for [CALCITE-413] Add RelDataTypeSystem plugin, allowing different max precision of a DECIMAL.

        Also tests the plugin system, by specifying implementations of a plugin interface with public and private constructors.

      • checkTypeSystem

        private void checkTypeSystem​(int expected,
                                     org.apache.calcite.tools.FrameworkConfig config)
      • testSchemaPath

        public void testSchemaPath()
        Test for Path.
      • testJdbcValues

        public void testJdbcValues()
                            throws java.lang.Exception
        Test case for [CALCITE-1996] VALUES syntax.

        With that bug, running a VALUES query would succeed before running a query that reads from a JDBC table, but fail after it. Before, the plan would use EnumerableValues, but after, it would use JdbcRules.JdbcValues, and would generate invalid SQL syntax.

        Even though the SQL generator has been fixed, we are still interested in how JDBC convention gets lodged in the planner's state.

        Throws:
        java.lang.Exception
      • testPushProjectToScan

        public void testPushProjectToScan()
                                   throws java.lang.Exception
        Test case for [CALCITE-3228] Error while applying rule ProjectScanRule:interpreter

        This bug appears under the following conditions: 1) have an aggregate with group by and multi aggregate calls. 2) the aggregate can be removed during optimization. 3) all aggregate calls are simplified to the same reference.

        Throws:
        java.lang.Exception
      • executeQuery

        private void executeQuery​(org.apache.calcite.tools.FrameworkConfig config,
                                  java.lang.String query,
                                  boolean debug)
                           throws org.apache.calcite.tools.RelConversionException,
                                  org.apache.calcite.sql.parser.SqlParseException,
                                  org.apache.calcite.tools.ValidationException
        Throws:
        org.apache.calcite.tools.RelConversionException
        org.apache.calcite.sql.parser.SqlParseException
        org.apache.calcite.tools.ValidationException