Package org.apache.calcite.test
Tests for Calcite.
-
Interface Summary Interface Description CalciteAssert.ConnectionPostProcessor Connection post processorCalciteAssert.PreparedStatementConsumer We want a consumer which can throw SqlExceptionDiffRepository.Filter Callback to filter strings before returning them.RelMetadataTest.ColType Custom metadata interface.RelMetadataTest.ColType.Handler Handler API.SqlToRelTestBase.Tester Helper class which contains default implementations of methods used for running sql-to-rel conversion tests.SqlValidatorTestCase.Tester Encapsulates differences between test environments, for example, which SQL parser or validator to use. -
Class Summary Class Description AbstractPigTest Common methods inheritable by all Pig-specific test classes.BabelParserTest Tests the "Babel" SQL parser, that understands all dialects of SQL.BabelQuidemTest Unit tests for the Babel SQL parser.BabelQuidemTest.BabelCommandHandler Command handler that adds a "!explain-validated-on dialect..." command (seeBabelQuidemTest.ExplainValidatedCommand
).BabelQuidemTest.ExplainValidatedCommand Command that prints the validated parse tree of a SQL statement.BabelTest Unit tests for Babel framework.BookstoreSchema A Schema representing a bookstore.BookstoreSchema.Author BookstoreSchema.Book BookstoreSchema.Coordinate BookstoreSchema.Page BookstoreSchema.Place CalciteAssert Fluid DSL for testing Calcite connections and queries.CalciteAssert.AddSchemaPostProcessor AddsSchema
and sets it as default.CalciteAssert.AddSchemaSpecPostProcessor AddsCalciteAssert.SchemaSpec
(set of schemes) to a connection.CalciteAssert.AssertMetaData Fluent interface for building a metadata query to be tested.CalciteAssert.AssertQuery Fluent interface for building a query to be tested.CalciteAssert.AssertThat Result of callingCalciteAssert.that()
.CalciteAssert.ConnectionFactory Abstract implementation of connection factory whosewith
methods throw.CalciteAssert.DefaultSchemaPostProcessor Sets a default schema name.CalciteAssert.MapConnectionFactory Connection factory that uses a given map of (name, value) pairs and optionally an initial schema.CalciteAssert.NopAssertQuery Implementation ofCalciteAssert.AssertQuery
that does nothing.CalciteAssert.PoolingConnectionFactory Connection factory that uses the same instance of connections.CalciteAssert.PropBuilder Builds aProperties
containing connection property settings.CalciteAssert.ResultSetFormatter Converts aResultSet
to string.CalciteHandler Extension toHandler
that can execute commands using Calcite.CalciteResourceTest Tests the generated implementation ofCalciteResource
(mostly a sanity check for the resource-generation infrastructure).CalciteSqlOperatorTest Embodiment ofSqlOperatorBaseTest
that generates SQL statements and executes them using Calcite.CalciteSuite Calcite test suite.CassandraAdapterTest Tests for theorg.apache.calcite.adapter.cassandra
package.CollectionTypeTest CollectionTypeTest.NestedCollectionTable Table that returns columns which include complicated collection type via the ScannableTable interface.CollectionTypeTest.NestedCollectionWithAnyTypeTable Table that returns columns which include complicated collection type via the ScannableTable interface.ConnectionSpec Information necessary to create a JDBC connection.CoreQuidemTest Test that runs every Quidem file in the "core" module as a test.CountriesTableFunction A table function that returns all countries in the world.CsvTest Unit test of the Calcite adapter for CSV.CsvTest.Worker<E> Receives commands on a queue and executes them on its own thread.DiffRepository A collection of resources used by tests.DiffTestCase DiffTestCase is an abstract base for JUnit tests which produce multi-line output to be verified by diffing against a pre-existing reference file.DruidAdapterIT Tests for theorg.apache.calcite.adapter.druid
package.DruidAdapterIT2 Tests for theorg.apache.calcite.adapter.druid
package.DruidDateRangeRulesTest Unit tests forDateRangeRules
algorithms.DruidDateRangeRulesTest.Fixture2 Common expressions across tests.ElasticsearchChecker Internal util methods for ElasticSearch testsExampleFunctionTest Unit tests for example user-defined functions.ExceptionMessageTest Test cases to check that necessary information from underlying exceptions is correctly propagated viaSQLException
s.ExceptionMessageTest.Entry Entries made available in the reflective TestSchema.ExceptionMessageTest.TestSchema Simple reflective schema that provides valid and invalid entries.FilteratorTest Unit test forFilterator
.Fluent Fluent API to perform Piglet test actions.FoodMartLatticeStatisticProvider Implementation ofLatticeStatisticProvider
that has hard-coded values for various attributes in the FoodMart lattice.FoodMartQuerySet Set of queries against the FoodMart database.FoodMartQuerySet.FoodmartColumn JSON column element.FoodMartQuerySet.FoodmartQuery JSON query element.FoodMartQuerySet.FoodmartRoot JSON root element.FoodmartTest Test case that runs the FoodMart reference queries.HepPlannerTest HepPlannerTest is a unit test forHepPlanner
.InduceGroupingTypeTest Unit test forAggregate.Group.induce(ImmutableBitSet, List)
.InterpreterTest Unit tests forInterpreter
.JdbcAdapterTest Tests for theorg.apache.calcite.adapter.jdbc
package.JdbcAdapterTest.LockWrapper Acquires a lock, and releases it when closed.JdbcFrontJdbcBackLinqMiddleTest Tests for a JDBC front-end and JDBC back-end where the processing is not pushed down to JDBC (as inJdbcFrontJdbcBackTest
) but is executed in a pipeline of linq4j operators.JdbcFrontJdbcBackTest Tests for a JDBC front-end and JDBC back-end.JdbcFrontLinqBackTest Tests for a JDBC front-end (with some quite complex SQL) and Linq4j back-end (based on in-memory collections).JdbcTest Tests for using Calcite via JDBC.JdbcTest.AbstractModifiableTable Abstract base class for implementations ofModifiableTable
.JdbcTest.AbstractModifiableView Abstract base class for implementations ofModifiableView
.JdbcTest.AutoTempDriver Mock driver that has a handler that stores the results of each query in a temporary table.JdbcTest.Customer JdbcTest.Department JdbcTest.Dependent JdbcTest.EmpDeptTableFactory Factory for EMP and DEPT tables.JdbcTest.Employee JdbcTest.Event JdbcTest.FoodmartJdbcSchema JdbcTest.FoodmartSchema JdbcTest.HandlerDriver Mock driver that a givenHandler
.JdbcTest.HrSchema JdbcTest.LingualEmp JdbcTest.LingualSchema JdbcTest.Location JdbcTest.MockDdlDriver Mock driver that can execute a trivial DDL statement.JdbcTest.MySchema Schema containing dummy tables.JdbcTest.MySchemaFactory Schema factory that createsJdbcTest.MySchema
objects.JdbcTest.MyTable Dummy table.JdbcTest.MyTable2 Another dummy table.JdbcTest.SalesFact LatticeTest Unit test for lattices.LinqFrontJdbcBackTest Tests for a linq4j front-end and JDBC back-end.Matchers Matchers for testing SQL queries.Matchers.ComposingMatcher<F,T> Matcher that transforms the input value using a function before passing to another matcher.Matchers.IsWithin<T extends java.lang.Number> Is the numeric value within a given difference another value?MaterializationTest Unit test for the materialized view rewrite mechanism.MaterializationTest.HrFKUKSchema Hr schema with FK-UK relationship.MaterializationTest.TableNameVisitor Implementation of RelVisitor to extract substituted table names.MockRelOptCost MockRelOptCost is a mock implementation of theRelOptCost
interface.MockRelOptPlanner MockRelOptPlanner is a mock implementation of theRelOptPlanner
interface.MockSqlOperatorTable Mock operator table for testing purposes.MockSqlOperatorTable.DedupFunction "DEDUP" user-defined function.MockSqlOperatorTable.RampFunction "RAMP" user-defined function.ModelTest Unit test for data models.MongoAdapterIT Used to trigger integration tests from maven (thus class name is suffixed withIT
).MongoAssertions Util class which needs to be in the same package asCalciteAssert
due to package-private visibility.MultiJdbcSchemaJoinTest Test case for joining tables from two different JDBC databases.MultiJdbcSchemaJoinTest.TempDb Pool of temporary databases.MutableRelTest Tests forMutableRel
sub-classes.PigAdapterTest Tests for theorg.apache.calcite.adapter.pig
package.PigletTest Unit tests for Piglet.PigRelBuilderStyleTest Tests for theorg.apache.calcite.adapter.pig
package that tests the building ofPigRel
relational expressions usingRelBuilder
and associated factories inPigRelFactories
.PigRelBuilderTest Unit test forPigRelBuilder
.PlusSuite Suite consisting of all tests in thecalcite-plus
module.QuidemTest Test that runs every Quidem file as a test.QuidemTest.QuidemConnectionFactory Quidem connection factory for Calcite's built-in test schemas.ReflectiveSchemaTest Unit tests forReflectiveSchema
.ReflectiveSchemaTest.AllPrivate All field are private, therefore the resulting record has no fields.ReflectiveSchemaTest.BadType Table that has a field that cannot be recognized as a SQL type.ReflectiveSchemaTest.CatchallSchema Object whose fields are relations.ReflectiveSchemaTest.DateColumnSchema Schema that contains a table with a date column.ReflectiveSchemaTest.EmployeeWithHireDate Extension toJdbcTest.Employee
with ahireDate
column.ReflectiveSchemaTest.EveryType Record that has a field of every interesting type.ReflectiveSchemaTest.IntAndString Table that has integer and string fieldsReflectiveSchemaTest.IntHolder Custom java class that holds just a single field.RelBuilderTest Unit test forRelBuilder
.RelMdColumnOriginsTest Test case for CALCITE-542.RelMetadataTest Unit test forDefaultRelMetadataProvider
.RelMetadataTest.BrokenColTypeImpl Implementation ofRelMetadataTest.ColType
that has no fall-back forRelNode
.RelMetadataTest.ColTypeImpl A provider forRelMetadataTest.ColType
via reflection.RelMetadataTest.MyRelMetadataQuery Extension toRelMetadataQuery
to supportRelMetadataTest.ColType
.RelMetadataTest.PartialColTypeImpl A provider forRelMetadataTest.ColType
via reflection.RelOptRulesTest Unit test for rules inorg.apache.calcite.rel
and subpackages.RelOptTestBase RelOptTestBase is an abstract base for tests which exercise a planner and/or rules viaDiffRepository
.RexImplicationCheckerTest Unit tests forRexImplicationChecker
.RexImplicationCheckerTest.Fixture Contains all the nourishment a test case could possibly need.RexProgramBuilderBase This class provides helper methods to build rex expressions.RexProgramBuilderBase.DummyTestDataContext Dummy data context for test.RexProgramTest Unit tests forRexProgram
andRexProgramBuilder
.RexTransformerTest Tests transformations on rex nodes.ScannableTableTest Unit test forScannableTable
.ScannableTableTest.BeatlesFilterableTable Table that returns two columns via theFilterableTable
interface.ScannableTableTest.BeatlesProjectableFilterableTable Table that returns two columns via theFilterableTable
interface.ScannableTableTest.BeatlesTable Table that returns two columns via the ScannableTable interface.ScannableTableTest.SimpleTable Table that returns one column via theScannableTable
interface.ServerParserTest Tests SQL parser extensions for DDL.ServerQuidemTest Unit tests for server and DDL.ServerTest Unit tests for server and DDL.ServerUnParserTest Extension toServerParserTest
that ensures that every expression can un-parse successfully.SparkAdapterTest Tests for using Calcite with Spark as an internal engine, as implemented by theorg.apache.calcite.adapter.spark
package.SplunkAdapterTest Unit test of the Calcite adapter for Splunk.SqlAdvisorJdbcTest Tests forSqlAdvisor
.SqlFunctionsTest Unit test for the methods inSqlFunctions
that implement SQL functions.SqlJsonFunctionsTest Unit test for the methods inSqlFunctions
that implement JSON processing functions.SqlLimitsTest Unit test for SQL limits.SqlLineTest Tests that we can invoke SqlLine on a Calcite connection.SqlOperatorBindingTest Unit tests forRexProgram
andRexProgramBuilder
.SqlTestGen Utility to generate a SQL script from validator test.SqlTestGen.SqlValidatorSpooler Subversive subclass, which spools results to a writer rather than running tests.SqlTestGen.SqlValidatorSpooler.MyInvocationHandler Handles the methods inSqlValidator
that are called from validator tests.SqlToRelConverterExtendedTest RunsSqlToRelConverterTest
with extensions.SqlToRelConverterTest Unit test forSqlToRelConverter
.SqlToRelConverterTest.RelValidityChecker Visitor that checks that everyRelNode
in a tree is valid.SqlToRelTestBase SqlToRelTestBase is an abstract base for tests which involve conversion from SQL to relational algebra.SqlToRelTestBase.DelegatingRelOptTable Table that delegates to a given table.SqlToRelTestBase.FarragoTestValidator Validator for testing.SqlToRelTestBase.MockRelOptSchema Mock implementation ofRelOptSchema
.SqlToRelTestBase.TesterImpl Default implementation ofSqlToRelTestBase.Tester
, using mock classesSqlToRelTestBase.MockRelOptSchema
andMockRelOptPlanner
.SqlValidatorDynamicTest Concrete child class ofSqlValidatorTestCase
, containing lots of unit tests.SqlValidatorFeatureTest SqlValidatorFeatureTest verifies that features can be independently enabled or disabled.SqlValidatorMatchTest Validation tests for theMATCH_RECOGNIZE
clause.SqlValidatorTest Concrete child class ofSqlValidatorTestCase
, containing lots of unit tests.SqlValidatorTestCase An abstract base class for implementing tests againstSqlValidator
.SqlValidatorTestCase.Sql Fluent testing API.SqlValidatorTestCase.TesterConfigurationRule Enables to configureSqlValidatorTestCase.tester
behavior on a per-test basis.StreamTest Tests for streaming queries.StreamTest.BaseOrderStreamTable Base table for the Orders table.StreamTest.InfiniteOrdersStreamTableFactory Mock table that returns a stream of orders from a fixed array.StreamTest.InfiniteOrdersTable Table representing an infinitely larger ORDERS stream.StreamTest.OrdersHistoryTable Table representing the history of the ORDERS stream.StreamTest.OrdersStreamTableFactory Mock table that returns a stream of orders from a fixed array.StreamTest.OrdersTable Table representing the ORDERS stream.StreamTest.ProductsTable Table representing the PRODUCTS relation.StreamTest.ProductsTableFactory Mocks a simple relation to use for stream joining test.TableFunctionTest Tests for user-defined table functions.TableInRootSchemaTest Test case for issue 85.TableInRootSchemaTest.SimpleTable Table with columns (A, B).UdfTest Tests for user-defined functions; includes user-defined aggregate functions but user-defined table functions are inTableFunctionTest
.UdfTest.ArrayAppendScalarFunction Base class for functions that append arrays.UdtTest Tests for user-defined types. -
Enum Summary Enum Description CalciteAssert.Config Connection configuration.CalciteAssert.DatabaseInstance Information necessary to create a JDBC connection.CalciteAssert.SchemaSpec Specification for common test schemas. -
Annotation Types Summary Annotation Type Description WithLex Annotation that indicates that test method should be run with given lex configuration.