@Override
void write(Object obj) throws IOException {
long rawDataSize = 0;
if (obj != null) {
MapObjectInspector insp = (MapObjectInspector) inspector;
// this sucks, but it will have to do until we can get a better
// accessor in the MapObjectInspector.
Map<?, ?> valueMap = insp.getMap(obj);
// Don't use getMapSize(), it's inconsistent for some object inspectors
int len = valueMap.size();
lengths.write(len);
for(Map.Entry<?, ?> entry: valueMap.entrySet()) {
childrenWriters[0].write(entry.getKey());