Details
-
Bug
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
1.10.2
-
None
-
None
-
Avro Version
- Avro IPC [1.10.2]
- Avro maven plugin [1.10.2]
Java Version [11]
Description
Steps to replicate:
1. Use the maven plugin with the following avdl
@namespace("org.example") protocol TestService { record MaybeLogicalTypes { union {null, date} dateType = null; union {null, time_ms} timeMsType = null; union {null, timestamp_ms} timestampMsType = null; } MaybeLogicalTypes getMaybeLogicalTypes(); }
2. Implement the TestService that returns a MaybeLogicalTypes object with the values populated and start a server e.g.
Responder responder = new SpecificResponder(TestService.class, testServiceImpl); Server server = new NettyServer(responder, new InetSocketAddress("127.0.0.1", port)); server.start();
3. Run the client code to request a MaybeLogicalTypes object.
SpecificRequestor.getClient(TestService.class, new HttpTransceiver(url)).getMaybeLogicalTypes()
The client will error when any of the fields are populated, e.g. timestamp_ms
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]
Attachments
Issue Links
- relates to
-
AVRO-2872 'conversions' array is not populated for Avro Union Logicaltype fields
- Patch Available