Your last sentence answered it for me.
I was getting string instead of string / string per the spec.
Thanks

      From: Elliot West <[email protected]>
 To: Telco Phone <[email protected]>; [email protected] 
 Sent: Saturday, March 4, 2017 12:13 PM
 Subject: Re: Decode Avro map with java
   
I think what you're seeing is the value type only, which may contain null and 
is thus represented as an Avro union of null and string. The key type of an 
Avro may is assumed to be string according to the specification.
On Sat, 4 Mar 2017 at 13:37, Telco Phone <[email protected]> wrote:

I am trying to get to the key AND value data type for a java Map.
Given the orginal java converted to avro
private java.util.Map<java.lang.String,java.lang.String> testmap;

I am using the following in Java to decode.
   // Print out the schema   System.err.println("Map class type " 
+f.schema().toString());
   // Print out datatype for key / value   for (Schema st : 
f.schema().getValueType().getTypes())           System.err.println("ST is " + 
st.getName());
With a result of:
Map class type 
{"type":"map","values":["null",{"type":"string","avro.java.string":"String"}],"avro.java.string":"String","default":null}ST
 is nullST is string

Should I not get both the orginal <string,string> ?? (From the above testmap)

Thanks in advance....


   

Reply via email to