Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Avro >> mail # dev >> Re: [jira] [Commented] (AVRO-803) Java generated Avro classes make using Avro painful and surprising


Copy link to this message
-
Re: [jira] [Commented] (AVRO-803) Java generated Avro classes make using Avro painful and surprising
Does it work with <stringType>Utf8</stringType> ?  (Sorry, I've been
unable to test many patches recently).

I'm not a big fan of what our docs will say:  "never use the default of
CharSequence, its broken".  But I can live with that.

On 10/10/11 10:07 AM, "Doug Cutting (Commented) (JIRA)" <[EMAIL PROTECTED]>
wrote:

>
>    [
>https://issues.apache.org/jira/browse/AVRO-803?page=com.atlassian.jira.plu
>gin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13124299#comme
>nt-13124299 ]
>
>Doug Cutting commented on AVRO-803:
>-----------------------------------
>
>I'd prefer not to break back-compatibility this time.  It makes it
>impossible for folks to upgrade one project without making source code
>changes to other projects.  If you specify
><stringType>String</stringType> in your pom.xml then all your Map keys
>become java.lang.String.
>                
>> Java generated Avro classes make using Avro painful and surprising
>> ------------------------------------------------------------------
>>
>>                 Key: AVRO-803
>>                 URL: https://issues.apache.org/jira/browse/AVRO-803
>>             Project: Avro
>>          Issue Type: Improvement
>>          Components: java
>>    Affects Versions: 1.5.0
>>         Environment: Any
>>            Reporter: Sam Pullara
>>            Assignee: Doug Cutting
>>             Fix For: 1.6.0
>>
>>         Attachments: AVRO-803.patch, AVRO-803.patch, Foo.java
>>
>>
>> Currently the Avro generated Java classes expose CharSequence in their
>>API. However, you cannot use any old CharSequence when interacting with
>>them. In fact, you have to use the Utf8 class if you want to get
>>consistent results. I think that Avro should work with any CharSequence
>>if that is the API. Here is an example where this happens:
>>
>>https://github.com/spullara/avro-generated-code/blob/master/src/test/java
>>/AnnoyingTest.java
>> That prints out 'false' three times unexpectedly. If you can't get it
>>to print 'true' three times then you should probably change it back to
>>Utf8.
>
>--
>This message is automatically generated by JIRA.
>If you think it was sent incorrectly, please contact your JIRA
>administrators:
>https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
>For more information on JIRA, see: http://www.atlassian.com/software/jira
>
>