private Map<Object,Object> nextMap(
      ColumnVector vector, int row, MapTypeInfo schema, Object previous) {
    if (vector.isRepeating) {
      row = 0;
    }
    if (vector.noNulls || !vector.isNull[row]) {
      MapColumnVector map = (MapColumnVector) vector;
      int length = (int) map.lengths[row];
      int offset = (int) map.offsets[row];
      TypeInfo keyType = schema.getMapKeyTypeInfo();
      TypeInfo valueType = schema.getMapValueTypeInfo();
      LinkedHashMap<Object,Object> result;
      if (previous == null || previous.getClass() != LinkedHashMap.class) {
        result = new LinkedHashMap<Object,Object>(length);
      } else {
        result = (LinkedHashMap<Object,Object>) previous;
        // I couldn't think of a good way to reuse the keys and value objects
        // without even more allocations, so take the easy and safe approach.
        result.clear();
      }
      for(int e=0; e < length; ++e) {
        result.put(nextValue(map.keys, e + offset, keyType, null),
                   nextValue(map.values, e + offset, valueType, null));
      }
      return result;
    } else {
      return null;
    }
  }
If the current batch is empty, get a new one.
@return true if we have rows available.
ql/src/java/org/apache/hadoop/hive/ql/io/BatchToRowReader.java