Package org.apache.calcite.tools
Class FrameworksTest
- java.lang.Object
-
- org.apache.calcite.tools.FrameworksTest
-
public class FrameworksTest extends java.lang.Object
Unit tests for methods inFrameworks
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FrameworksTest.HiveLikeTypeSystem
Dummy type system, similar to Hive's, accessed via an INSTANCE member.static class
FrameworksTest.HiveLikeTypeSystem2
Dummy type system, similar to Hive's, accessed via a public default constructor.private static class
FrameworksTest.TableImpl
Modifiable, filterable table.
-
Constructor Summary
Constructors Constructor Description FrameworksTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
checkTypeSystem(int expected, org.apache.calcite.tools.FrameworkConfig config)
private void
executeQuery(org.apache.calcite.tools.FrameworkConfig config, java.lang.String query, boolean debug)
void
testCreateRootSchemaWithNoMetadataSchema()
Unit test to test create root schema which has no "metadata" schema.void
testFrameworksValidatorWithIdentifierExpansion()
Tests that the validator expands identifiers by default.void
testJdbcValues()
Test case for [CALCITE-1996] VALUES syntax.void
testOptimize()
void
testSchemaPath()
Test forPath
.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.void
testUpdate()
Test case for [CALCITE-2039] AssertionError when pushing project to ProjectableFilterableTable using UPDATE viaFrameworks
.
-
-
-
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)
-
testFrameworksValidatorWithIdentifierExpansion
public void testFrameworksValidatorWithIdentifierExpansion() throws java.lang.Exception
Tests that the validator expands identifiers by default.Test case for [CALCITE-593] Validator in Frameworks should expand identifiers.
- Throws:
java.lang.Exception
-
testSchemaPath
public void testSchemaPath()
Test forPath
.
-
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 useJdbcRules.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
-
testUpdate
public void testUpdate() throws java.lang.Exception
Test case for [CALCITE-2039] AssertionError when pushing project to ProjectableFilterableTable using UPDATE viaFrameworks
.- 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
-
-