Package org.apache.calcite.sql.test
Class SqlTests
java.lang.Object
org.apache.calcite.sql.test.SqlTests
Utility methods.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumStage of query processing.static classType checker which compares types to a specified string. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SqlTester.TypeCheckerChecker which enforces that a data type is nullable.static final SqlTester.ParameterCheckerChecker that allows any number or type of parameters.static final SqlTester.ResultCheckerChecker that allows any result.static final SqlTester.TypeCheckerChecker which allows any type.static final SqlTester.TypeCheckerstatic final SqlTester.TypeChecker -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcheckEx(@Nullable Throwable ex, @Nullable String expectedMsgPattern, StringAndPos sap, SqlTests.Stage stage) Checks whether an exception matches the expected pattern.static StringgenerateAggQuery(String expr, String[] inputValues) static StringgenerateAggQueryWithMultipleArgs(String expr, String[][] inputValues) static StringgenerateWinAggQuery(String expr, String windowSpec, String[] inputValues) static List<RelDataType>getTypes(RelDataTypeFactory typeFactory) Returns a list of typical types.static StringgetTypeString(RelDataType sqlType) Helper function to get the string representation of a RelDataType (include precision/scale but no charset or collation).
-
Field Details
-
INTEGER_TYPE_CHECKER
-
BOOLEAN_TYPE_CHECKER
-
ANY_TYPE_CHECKER
Checker which allows any type. -
ANY_NULLABLE_TYPE_CHECKER
Checker which enforces that a data type is nullable. -
ANY_PARAMETER_CHECKER
Checker that allows any number or type of parameters. -
ANY_RESULT_CHECKER
Checker that allows any result.
-
-
Constructor Details
-
SqlTests
public SqlTests()
-
-
Method Details
-
getTypeString
Helper function to get the string representation of a RelDataType (include precision/scale but no charset or collation).- Parameters:
sqlType- Type- Returns:
- String representation of type
-
getTypes
Returns a list of typical types. -
generateAggQuery
-
generateAggQueryWithMultipleArgs
-
generateWinAggQuery
-
checkEx
public static void checkEx(@Nullable Throwable ex, @Nullable String expectedMsgPattern, StringAndPos sap, SqlTests.Stage stage) Checks whether an exception matches the expected pattern. Ifsapcontains an error location, checks this too.- Parameters:
ex- Exception thrownexpectedMsgPattern- Expected patternsap- Query and (optional) position in querystage- Query processing stage
-