@Test
  public void testCTASUnsupportedTypeWithAutoConversion() {
    Map<String, Type> notSupportedTypes = ImmutableMap.of(
        "TINYINT", Types.IntegerType.get(),
        "SMALLINT", Types.IntegerType.get(),
        "VARCHAR(1)", Types.StringType.get(),
        "CHAR(1)", Types.StringType.get());

    shell.setHiveSessionValue(InputFormatConfig.SCHEMA_AUTO_CONVERSION, "true");

    for (String notSupportedType : notSupportedTypes.keySet()) {
      shell.executeStatement(String.format("CREATE TABLE source (s %s) STORED AS ORC", notSupportedType));
      shell.executeStatement(String.format(
          "CREATE TABLE target STORED BY ICEBERG %s %s AS SELECT * FROM source",
          testTables.locationForCreateTableSQL(TableIdentifier.of("default", "target")),
          testTables.propertiesForCreateTableSQL(
              ImmutableMap.of(TableProperties.DEFAULT_FILE_FORMAT, fileFormat.toString())
          )
      ));

      org.apache.iceberg.Table icebergTable = testTables.loadTable(TableIdentifier.of("default", "target"));
      Assert.assertEquals(notSupportedTypes.get(notSupportedType), icebergTable.schema().columns().get(0).type());
      shell.executeStatement("DROP TABLE source");
      shell.executeStatement("DROP TABLE target");
    }
  }
Creates Iceberg tables using CTAS, and runs select queries against these new tables to verify table content.
iceberg/iceberg-handler/src/test/java/org/apache/iceberg/mr/hive/TestHiveIcebergCTAS.java