Index: src/java/org/apache/hcatalog/data/HCatRecordSerDe.java =================================================================== --- src/java/org/apache/hcatalog/data/HCatRecordSerDe.java (revision 1245818) +++ src/java/org/apache/hcatalog/data/HCatRecordSerDe.java (working copy) @@ -250,20 +250,21 @@ for (int i = 0 ; i < l.size() ; i++ ){ list.add(serializeList(l.get(i), (ListObjectInspector) eloi)); } + return list; } else if (eloi.getCategory() == Category.MAP){ List> list = new ArrayList>(l.size()); for (int i = 0 ; i < l.size() ; i++ ){ list.add(serializeMap(l.get(i), (MapObjectInspector) eloi)); } - throw new SerDeException("HCatSerDe map type unimplemented"); + return list; } else { throw new SerDeException(HCatRecordSerDe.class.toString() + " does not know what to do with fields of unknown category: " + eloi.getCategory() + " , type: " + eloi.getTypeName()); } - return l; } + /** * Return an object inspector that can read through the object * that we return from deserialize(). To wit, that means we need Index: src/test/org/apache/hcatalog/data/TestHCatRecordSerDe.java =================================================================== --- src/test/org/apache/hcatalog/data/TestHCatRecordSerDe.java (revision 1245818) +++ src/test/org/apache/hcatalog/data/TestHCatRecordSerDe.java (working copy) @@ -83,14 +83,26 @@ c1_1.add(i2); c1.add(c1_1); rlist.add(c1); + List am = new ArrayList(); + Map am_1 = new HashMap(); + am_1.put("noo","haha"); + am.add(am_1); + rlist.add(am); + List aa = new ArrayList(); + List aa_1 = new ArrayList(); + aa_1.add("bloo"); + aa_1.add("bwahaha"); + aa.add(aa_1); + rlist.add(aa); String typeString = "tinyint,smallint,int,bigint,double,float,string,string," + "struct,array,map,boolean," - + "array,ii2:map>>>>"; + + "array,ii2:map>>>>," + + "array>,array>"; Properties props = new Properties(); - props.put(Constants.LIST_COLUMNS, "ti,si,i,bi,d,f,s,n,r,l,m,b,c1"); + props.put(Constants.LIST_COLUMNS, "ti,si,i,bi,d,f,s,n,r,l,m,b,c1,am,aa"); props.put(Constants.LIST_COLUMN_TYPES, typeString); // props.put(Constants.SERIALIZATION_NULL_FORMAT, "\\N"); // props.put(Constants.SERIALIZATION_FORMAT, "1"); @@ -146,7 +158,7 @@ LazyHCatRecord s6 = new LazyHCatRecord(s4,hrsd.getObjectInspector()); System.out.println("SIX:"+s6.toString()); - + } }