protected static class SqlOperatorTest.TesterImpl extends AbstractSqlTester
SqlTester based on a
JDBC connection.SqlTester.ParameterChecker, SqlTester.ResultChecker, SqlTester.TypeChecker, SqlTester.ValidatedNodeConsumer, SqlTester.ValidatedNodeFunction<R>, SqlTester.VmName| 限定符和类型 | 字段和说明 |
|---|---|
static org.apache.calcite.util.TryThreadLocal<org.apache.calcite.rel.type.RelDataTypeSystem> |
THREAD_TYPE_SYSTEM
Assign a type system object to this thread-local, pass the name of the
field as the
CalciteConnectionProperty.TYPE_SYSTEM property,
and any connection you make in the same thread will use your type
system. |
| 构造器和说明 |
|---|
TesterImpl() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
assertExceptionIsThrown(SqlTestFactory factory,
org.apache.calcite.sql.parser.StringAndPos sap,
@Nullable String expectedMsgPattern)
Checks that a query is valid, or, if invalid, throws the right
message at the right location.
|
void |
assertExceptionIsThrown(SqlTestFactory factory,
org.apache.calcite.sql.parser.StringAndPos sap,
@Nullable String expectedMsgPattern,
boolean runtime) |
void |
check(SqlTestFactory factory,
String query,
SqlTester.TypeChecker typeChecker,
SqlTester.ParameterChecker parameterChecker,
SqlTester.ResultChecker resultChecker)
Tests that a SQL query returns a result of expected type and value.
|
void |
checkAggFails(SqlTestFactory factory,
String expr,
String[] inputValues,
String expectedError,
boolean runtime)
Tests that an aggregate expression fails at run time.
|
void |
checkFails(SqlTestFactory factory,
org.apache.calcite.sql.parser.StringAndPos sap,
String expectedError,
boolean runtime)
Tests that a scalar SQL expression fails at run time.
|
assertConvertsTo, buildQuery, buildQuery2, buildQueryAgg, checkAgg, checkColumnType, checkParseEx, checkQueryFails, checkWinAgg, close, convertSqlToRel2, createFieldTrimmer, forEachQuery, getColumnType, getResultType, parseExpression, parseQuery, setFor, trimRelNode, validateAndApply, validateAndThenclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcheck, checkFails, convertSqlToRelpublic static final org.apache.calcite.util.TryThreadLocal<org.apache.calcite.rel.type.RelDataTypeSystem> THREAD_TYPE_SYSTEM
CalciteConnectionProperty.TYPE_SYSTEM property,
and any connection you make in the same thread will use your type
system.public void check(SqlTestFactory factory, String query, SqlTester.TypeChecker typeChecker, SqlTester.ParameterChecker parameterChecker, SqlTester.ResultChecker resultChecker)
SqlTesterSqlTester.TypeChecker
and SqlTester.ResultChecker functors.check 在接口中 SqlTestercheck 在类中 AbstractSqlTesterfactory - Factoryquery - SQL querytypeChecker - Checks whether the result is the expected typeparameterChecker - Checks whether the parameters are of expected
typesresultChecker - Checks whether the result has the expected valuepublic void checkFails(SqlTestFactory factory, org.apache.calcite.sql.parser.StringAndPos sap, String expectedError, boolean runtime)
SqlTestercheckFails 在接口中 SqlTestercheckFails 在类中 AbstractSqlTesterfactory - Factorysap - SQL scalar expressionexpectedError - Pattern for expected error. If !runtime, must
include an error location.runtime - If true, must fail at runtime; if false, must fail at
validate timepublic void checkAggFails(SqlTestFactory factory, String expr, String[] inputValues, String expectedError, boolean runtime)
SqlTestercheckAggFails 在接口中 SqlTestercheckAggFails 在类中 AbstractSqlTesterfactory - Factoryexpr - An aggregate expressioninputValues - Array of input valuesexpectedError - Pattern for expected errorruntime - If true, must fail at runtime; if false, must fail at
validate timepublic void assertExceptionIsThrown(SqlTestFactory factory, org.apache.calcite.sql.parser.StringAndPos sap, @Nullable String expectedMsgPattern)
SqlTesterIf expectedMsgPattern is null, the query must
succeed.
If expectedMsgPattern is not null, the query must
fail, and give an error location of (expectedLine, expectedColumn)
through (expectedEndLine, expectedEndColumn).
assertExceptionIsThrown 在接口中 SqlTesterassertExceptionIsThrown 在类中 AbstractSqlTesterfactory - Factorysap - SQL statementexpectedMsgPattern - If this parameter is null the query must bepublic void assertExceptionIsThrown(SqlTestFactory factory, org.apache.calcite.sql.parser.StringAndPos sap, @Nullable String expectedMsgPattern, boolean runtime)
Copyright © 2012-2023 Apache Software Foundation. All Rights Reserved.