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

IDL code-generation generates too-long literals for very large schemas

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.7.5
    • Component/s: java
    • Labels:
    • Release Note:
      Correct java compilation error when schema is too large to be stored in a single String constant
    • Tags:
      IDL

      Description

      When I work from a very large IDL schema, the Java code generated includes a schema JSON literal that exceeds the length of the maximum allowed literal string (65535 characters).

      This creates weird Maven errors like: [ERROR] ...FooProtocol.java:[13,89] constant string too long.

      It might seem a little crazy, but a 64-kilobyte JSON protocol isn't outrageous at all for some of the more involved data structures, especially if we're including documentation strings etc.

      I believe the fix should be a bit more sensitivity to the length of the JSON literal (and a willingness to split it into more than one literal, joined by +), but I haven't figured out where that change needs to go. Has anyone else encountered this problem?

        Attachments

        1. AVRO-1316.patch
          13 kB
          Doug Cutting
        2. AVRO-1316.patch
          11 kB
          Doug Cutting
        3. AVRO-1316.patch
          9 kB
          Doug Cutting
        4. AVRO-1316.patch
          15 kB
          Micah Huff
        5. AVRO-1316.patch
          17 kB
          Micah Huff
        6. AVRO-1316.patch
          16 kB
          Micah Huff
        7. AVRO-1316.patch
          15 kB
          Micah Huff

          Issue Links

            Activity

              People

              • Assignee:
                trochee Jeremy Kahn
                Reporter:
                trochee Jeremy Kahn
              • Votes:
                2 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: