Uploaded image for project: 'Apache Avro'
  1. Apache Avro
  2. AVRO-3102

Avro Java IPC SpecificRequestor fails to convert union null + logical type fields

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 1.10.2
    • None
    • java, logical types
    • 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

          Activity

            People

              Unassigned Unassigned
              StephenFlavin Stephen Flavin
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: