clairemcginty commented on PR #16824:
URL: https://github.com/apache/iceberg/pull/16824#issuecomment-4925726440

   > I like the loading better; what does remain is someone to manually test 
this as there's no 1.11 test setup, is there.
   > 
   > @clairemcginty have you done a manual test of this? what does a stack 
trace look like when an unsupported type is encountered?
   
   Yes, I've tested with locally published artifacts!
   
   existing behavior with Iceberg 1.11:
   - **Case: (Iceberg 1.11.0, Avro 1.11, record contains TimestampNanos type) 
-> throws exception during static init**
   ```
   09:42:23.598 [sbt-bg-threads-1] INFO  o.a.iceberg.BaseMetastoreCatalog - 
Table loaded by catalog: local.default.test_iceberg_timestamp_nanos
   Exception in thread "sbt-bg-threads-1" java.lang.NoSuchMethodError: 
'org.apache.avro.LogicalTypes$TimestampNanos 
org.apache.avro.LogicalTypes.timestampNanos()'
        at org.apache.iceberg.avro.TypeToSchema.<clinit>(TypeToSchema.java:50)
        at 
org.apache.iceberg.avro.AvroSchemaUtil.convert(AvroSchemaUtil.java:64)
        at 
org.apache.iceberg.avro.AvroSchemaUtil.convert(AvroSchemaUtil.java:59)
        at org.apache.iceberg.avro.Avro$WriteBuilder.build(Avro.java:210)
   ```
   
   - **Case: (Iceberg 1.11.0, Avro 1.11, record does not contain TimestampNanos 
type) -> throws exception during static init**
   ```
   09:42:23.598 [sbt-bg-threads-1] INFO  o.a.iceberg.BaseMetastoreCatalog - 
Table loaded by catalog: local.default.test_iceberg_timestamp_nanos
   Exception in thread "sbt-bg-threads-1" java.lang.NoSuchMethodError: 
'org.apache.avro.LogicalTypes$TimestampNanos 
org.apache.avro.LogicalTypes.timestampNanos()'
        at org.apache.iceberg.avro.TypeToSchema.<clinit>(TypeToSchema.java:50)
        at 
org.apache.iceberg.avro.AvroSchemaUtil.convert(AvroSchemaUtil.java:64)
        at 
org.apache.iceberg.avro.AvroSchemaUtil.convert(AvroSchemaUtil.java:59)
        at org.apache.iceberg.avro.Avro$WriteBuilder.build(Avro.java:210)
   ```
   
   - **Case: (Iceberg 1.11.0, Avro 1.12, record contains TimestampNanos type) 
-> succeeds**
   
   now testing with local snapshot from this PR:
   
   - **Case: (Iceberg local snapshot, Avro 1.11, record contains TimestampNanos 
type) -> throws exception from TypeUtil#visit on the newly added precondition 
check**
   ```
   [error] java.lang.NullPointerException: TimestampNano is not supported with 
Avro versions older than 1.12
   [error]      at 
org.apache.iceberg.relocated.com.google.common.base.Preconditions.checkNotNull(Preconditions.java:974)
   [error]      at 
org.apache.iceberg.avro.TypeToSchema.primitive(TypeToSchema.java:270)
   [error]      at 
org.apache.iceberg.avro.TypeToSchema$WithTypeToName.primitive(TypeToSchema.java:313)
   [error]      at org.apache.iceberg.types.TypeUtil.visit(TypeUtil.java:792)
   [error]      at org.apache.iceberg.types.TypeUtil.visit(TypeUtil.java:743)
   [error]      at org.apache.iceberg.types.TypeUtil.visit(TypeUtil.java:731)
   [error]      at 
org.apache.iceberg.avro.AvroSchemaUtil.convert(AvroSchemaUtil.java:64)
   [error]      at 
org.apache.iceberg.avro.AvroSchemaUtil.convert(AvroSchemaUtil.java:59)
   [error]      at 
org.apache.iceberg.avro.Avro$WriteBuilder.build(Avro.java:210)
   [error]
   ```
   
   - **Case: (Iceberg 1.11.0, Avro 1.11, record does not contain TimestampNanos 
type) -> succeeds**
   - **Case: Iceberg 1.11.0, Avro 1.12, record contains TimestampNanos type) -> 
succeeds**


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to