Uploaded image for project: 'Apache Gora'
  1. Apache Gora
  2. GORA-32

Map type with long values generates non-compilable Java class

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.1-incubating
    • Fix Version/s: 0.2
    • Component/s: schema
    • Labels:
      None

      Description

      I have the following Avro JSON schema:

      {
      "type": "record",
      "name": "Request",
      "namespace": "ch.test.generated",
      "fields" : [
      {
      "name": "data",
      "type":

      { "type": "map", "values": "long" }

      }
      ]
      }

      Compiling the schema I get a Java class that does not compile. The problem is that primitive types are not allowed in generic maps:

      ...
      public Map<Utf8, long> getData()

      { return (Map<Utf8, long>) get(0); }

      ...

      The issue seems to be that in the GoraCompiler class the unboxed types are used.

        Attachments

        1. GORA-32.patch
          3 kB
          Yves Langisch
        2. unboxing.patch
          3 kB
          Yves Langisch

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              ylangisc Yves Langisch
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: