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 shouldSupportAllPrimitiveTypeNames() {
    // Given:
    final Set<String> typeNames = ImmutableSet.of(
        "INT",
        "VARCHAR",
        "BOOLEAN",
        "BIGINT",
        "DOUBLE",
        "STRING",
        "TIMESTAMP"
    );

    // When:
    final List<Boolean> missing = typeNames.stream()
        .map(SqlPrimitiveType::isPrimitiveTypeName)
        .filter(x -> !x)
        .collect(Collectors.toList());

    // Then:
    assertThat(missing, is(empty()));
  }