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

Java: Type promotion not succeeding for long -> float

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.4.1
    • 1.5.0
    • java
    • None

    Description

      A bug reported on the dev email list. I have not confirmed it:

      Hi,

      Avro spec says that writer schema's long can be promoted to reader
      schema's float or double. In my test, I'm getting ErrorAction from
      ResolvingGrammarGenerator.generate() when writer schema is long and
      reader schema expects float. Looking at the source code, when reader
      and writer type are not the same, the switch(readerType) only handles
      Long, Double and Union, not Float. This is the reason I'm getting "Found
      Long, expecting Float" error.

      Best regards,

      Xiaolu

      Attachments

        1. AVRO-706.patch
          3 kB
          Thiruvalluvan M. G.

        Activity

          People

            thiru_mg Thiruvalluvan M. G.
            scott_carey Scott Carey
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: