You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@avro.apache.org by GitBox <gi...@apache.org> on 2021/03/31 12:42:34 UTC

[GitHub] [avro] StephenFlavin commented on pull request #1097: AVRO-2872: Fix bug in SpecificCompiler which prevents Logical Types being registered for union fields

StephenFlavin commented on pull request #1097:
URL: https://github.com/apache/avro/pull/1097#issuecomment-811037661


   I'm running into an issue which I think is related but building this PR locally and testing it hasn't fixed the issue.
   I have a schema
   ```
     record MaybeLogicalTypes {
       union {null, date} dateType = null;
       union {null, time_ms} timeMsType = null;
       union {null, timestamp_ms} timestampMsType = null;
     }
     MaybeLogicalTypes getMaybeLogicalTypes();
   ```
   I have server code which returns a `MaybeLogicalTypes` object with all the fields set however when the client code calls 
   ```
   SpecificRequestor.getClient(TestService.class, new HttpTransceiver(url)).getMaybeLogicalTypes()
   ```
   I get an error when ` union {null, date}` or `union {null, time_ms}` or `union {null, timestamp_ms}` is populated.
   e.g. 
   ```
   org.apache.avro.AvroRuntimeException: org.apache.avro.AvroRuntimeException: Unknown datum type java.time.Instant: 2021-03-31T11:26:20.123888Z
                                                   at org.apache.avro.ipc.specific.SpecificRequestor.readError(SpecificRequestor.java:160) ~[avro-ipc-1.10.2.jar:1.10.2]
                                                   at org.apache.avro.ipc.Requestor$Response.getResponse(Requestor.java:566) ~[avro-ipc-1.10.2.jar:1.10.2]
                                                   at org.apache.avro.ipc.Requestor$TransceiverCallback.handleResult(Requestor.java:366) ~[avro-ipc-1.10.2.jar:1.10.2]
                                                   at org.apache.avro.ipc.Requestor$TransceiverCallback.handleResult(Requestor.java:330) ~[avro-ipc-1.10.2.jar:1.10.2]
                                                   at org.apache.avro.ipc.Transceiver.transceive(Transceiver.java:73) ~[avro-ipc-1.10.2.jar:1.10.2]
                                                   at org.apache.avro.ipc.Requestor.request(Requestor.java:152) ~[avro-ipc-1.10.2.jar:1.10.2]
                                                   at org.apache.avro.ipc.Requestor.request(Requestor.java:101) ~[avro-ipc-1.10.2.jar:1.10.2]
                                                   at org.apache.avro.ipc.specific.SpecificRequestor.invoke(SpecificRequestor.java:108) ~[avro-ipc-1.10.2.jar:1.10.2]
   ```
   


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org