public static ResourceSchema convert(Schema icebergSchema) throws IOException {
    ResourceSchema result = new ResourceSchema();
    result.setFields(convertFields(icebergSchema.columns()));
    return result;
  }
@Test
  public void testPrimitive() throws IOException {
    Schema icebergSchema =
        new Schema(
            optional(1, "b", BooleanType.get()),
            optional(2, "i", IntegerType.get()),
            optional(3, "l", LongType.get()),
            optional(4, "f", FloatType.get()),
            optional(5, "d", DoubleType.get()),
            optional(6, "dec", DecimalType.of(0, 2)),
            optional(7, "s", StringType.get()),
            optional(8, "bi", BinaryType.get()));

    ResourceSchema pigSchema = SchemaUtil.convert(icebergSchema);
    assertThat(pigSchema.toString())
        .isEqualTo(
            "b:boolean,i:int,l:long,f:float,d:double,dec:bigdecimal,s:chararray,bi:bytearray");
  }