Class SqlTests


public abstract class SqlTests extends Object
Utility methods.
  • Field Details

  • Constructor Details

    • SqlTests

      public SqlTests()
  • Method Details

    • getTypeString

      public static String getTypeString(RelDataType sqlType)
      Helper function to get the string representation of a RelDataType (include precision/scale but no charset or collation).
      sqlType - Type
      String representation of type
    • getTypes

      public static List<RelDataType> getTypes(RelDataTypeFactory typeFactory)
      Returns a list of typical types.
    • generateAggQuery

      public static String generateAggQuery(String expr, String[] inputValues)
    • generateAggQueryWithMultipleArgs

      public static String generateAggQueryWithMultipleArgs(String expr, String[][] inputValues)
    • generateWinAggQuery

      public static String generateWinAggQuery(String expr, String windowSpec, String[] inputValues)
    • checkEx

      public static void checkEx(@Nullable Throwable ex, @Nullable String expectedMsgPattern, StringAndPos sap, SqlTests.Stage stage)
      Checks whether an exception matches the expected pattern. If sap contains an error location, checks this too.
      ex - Exception thrown
      expectedMsgPattern - Expected pattern
      sap - Query and (optional) position in query
      stage - Query processing stage