private IcebergDecimalObjectInspector(int precision, int scale) {
    super(new DecimalTypeInfo(precision, scale));
  }
@Test
  public void testIcebergDecimalObjectInspector() {
    HiveDecimalObjectInspector oi = IcebergDecimalObjectInspector.get(38, 18);

    assertThat(oi.getCategory()).isEqualTo(ObjectInspector.Category.PRIMITIVE);
    assertThat(oi.getPrimitiveCategory())
        .isEqualTo(PrimitiveObjectInspector.PrimitiveCategory.DECIMAL);

    assertThat(oi.getTypeInfo()).isEqualTo(new DecimalTypeInfo(38, 18));
    assertThat(oi.getTypeName())
        .isEqualTo(TypeInfoFactory.decimalTypeInfo.getTypeName(), oi.getTypeName());

    assertThat(oi.precision()).isEqualTo(38);
    assertThat(oi.scale()).isEqualTo(18);

    assertThat(oi.getJavaPrimitiveClass()).isEqualTo(HiveDecimal.class);
    assertThat(oi.getPrimitiveWritableClass()).isEqualTo(HiveDecimalWritable.class);

    assertThat(oi.copyObject(null)).isNull();
    assertThat(oi.getPrimitiveJavaObject(null)).isNull();
    assertThat(oi.getPrimitiveWritableObject(null)).isNull();

    HiveDecimal one = HiveDecimal.create(BigDecimal.ONE);

    assertThat(oi.getPrimitiveJavaObject(BigDecimal.ONE)).isEqualTo(one);
    assertThat(oi.getPrimitiveWritableObject(BigDecimal.ONE))
        .isEqualTo(new HiveDecimalWritable(one));

    HiveDecimal copy = (HiveDecimal) oi.copyObject(one);

    assertThat(copy).isEqualTo(one);
    assertThat(copy).isNotSameAs(one);

    assertThat(oi.preferWritable()).isFalse();
  }