avro-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Felix.徐 <ygnhz...@gmail.com>
Subject Re: Is map schema's key an UTF8 or String type?
Date Wed, 27 Apr 2011 03:39:19 GMT
Key of Map is UTF8 type.

2011/4/27 Weishung Chung <weishung@gmail.com>

> Ok thank you for the answer :)
>
>
> On Tue, Apr 26, 2011 at 4:24 PM, Scott Carey <scott@richrelevance.com>wrote:
>
>> Strings are of Java type CharSequence
>> toString() on CharSequence is consistent between String and Utf8.
>>  However, make sure any map you use has only one implementation of
>> CharSequence in it, since hashCode() and equals() on different CharSequence
>> types may not be consistent.
>>
>> On 4/26/11 2:17 PM, "Weishung Chung" <weishung@gmail.com> wrote:
>>
>> Hello Avro user,
>>
>> I defined a map type in the schema with values of type double.
>> After reading the map from the schema, I realized that the key is of type
>> avro utils.utf8 and cannot be cast to java.lang.String
>>
>> So, the following is not working when trying to loop through the entries
>> of the map.
>>
>> for(Entry<String, Double> entry: map.entrySet())
>>
>> Am I missing something ?
>>
>> Thank you so much,
>>
>>
>

Mime
View raw message