public static SqlPrimitiveType of(final String typeName) {
    switch (typeName.toUpperCase()) {
      case INT:
        return SqlPrimitiveType.of(SqlBaseType.INTEGER);
      case VARCHAR:
        return SqlPrimitiveType.of(SqlBaseType.STRING);
      default:
        try {
          final SqlBaseType sqlType = SqlBaseType.valueOf(typeName.toUpperCase());
          return SqlPrimitiveType.of(sqlType);
        } catch (final IllegalArgumentException e) {
          throw new SchemaException("Unknown primitive type: " + typeName, e);
        }
    }
  }
@Test
  public void shouldThrowOnArrayType() {
    // When:
    final Exception e = assertThrows(
        SchemaException.class,
        () -> SqlPrimitiveType.of(SqlBaseType.ARRAY)
    );

    // Then:
    assertThat(e.getMessage(), containsString("Invalid primitive type: ARRAY"));
  }