[
https://issues.apache.org/jira/browse/AVRO-36?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12716770#action_12716770
]
Scott Carey commented on AVRO-36:
---------------------------------
I can think of two common cases.
1. The default is true binary data completely unrelated to strings. In this
case URL encoding is messy and unintuitive, essentially '%' delimited hex.
Arrays of numbers or hex are the most 'natural' text representations for this
kind of data for programmers.
2. The data is related to strings, perhaps a non-UTF-8 encoding like ASCII or
8859-1 http://en.wikipedia.org/wiki/ISO_8859-1 . For these, URL encoding is
the most 'natural' fit in my opinion.
Base 64 is complicated and a lot harder for humans to decode than any of the
above. Its only benefit is space efficiency, but hex is only 50% larger.
Both types could be supported simultaneously, for example:
The first use case can be satisfied with "hexdefault" (or the array one)
{code}
{"name": "foo", "type": "bytes", "hexdefault": "A8C11F00"}
{code}
The second with URL encoding
{code}
{"name": "bar", "type": "bytes", "default": "%2Fdefault%2F%00"}
{code}
> binary default values do not decode base64
> ------------------------------------------
>
> Key: AVRO-36
> URL: https://issues.apache.org/jira/browse/AVRO-36
> Project: Avro
> Issue Type: Bug
> Components: java
> Reporter: Doug Cutting
> Assignee: Doug Cutting
>
> The specification says that default values for binary data are base64 encoded
> text, but the Java implementation uses the raw bytes of the textual value,
> and does not perform base64 decoded as specified.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.