public static FieldType toFieldType(SqlTypeNameSpec sqlTypeName) {
    return toFieldType(
        Preconditions.checkArgumentNotNull(
            SqlTypeName.get(sqlTypeName.getTypeName().getSimple()),
            "Failed to find Calcite type with name '%s'",
            sqlTypeName.getTypeName().getSimple()));
  }
@Test
  public void testFieldTypeNotFound() {
    RelDataType relDataType = dataTypeFactory.createUnknownType();
    thrown.expect(IllegalArgumentException.class);
    thrown.expectMessage("Cannot find a matching Beam FieldType for Calcite type: UNKNOWN");
    CalciteUtils.toFieldType(relDataType);
  }