[
https://issues.apache.org/jira/browse/AVRO-1316?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13651402#comment-13651402
]
Doug Cutting commented on AVRO-1316:
------------------------------------
Micah, is that with my most recent version of the patch? That should be
back-compatible, in that code compiled against 1.7.4 should run against 1.7.5,
but not vice-versa for schemas longer than 1024 characters.
This might be a reason to bump that back up to a larger value, so that, for
most folks, the compiled code is also forward-compatible, so that for schemas
shorter than 64k bytes, compiling against 1.7.5 will generate code that also
works against 1.7.4 jar files.
We could work harder to only generate the new signature when needed. For
example, if there are more than 16k characters then we could convert the string
to UTF-8 and only use the new encoding if that's over 64kB, otherwise stick
with a single string. Then we'd only use the new signature in cases that
couldn't compile at all before.
> IDL code-generation generates too-long literals for very large schemas
> ----------------------------------------------------------------------
>
> Key: AVRO-1316
> URL: https://issues.apache.org/jira/browse/AVRO-1316
> Project: Avro
> Issue Type: Bug
> Components: java
> Reporter: Jeremy Kahn
> Assignee: Jeremy Kahn
> Priority: Minor
> Labels: patch
> Fix For: 1.7.5
>
> Attachments: AVRO-1316.patch, AVRO-1316.patch, AVRO-1316.patch,
> AVRO-1316.patch, AVRO-1316.patch, AVRO-1316.patch, AVRO-1316.patch
>
>
> 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|http://stackoverflow.com/questions/8323082/size-of-initialisation-string-in-java]).
>
> 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?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira