public Object getMapValueElement(Object key) {
    if (!parsed) {
      parse();
    }
    // search for the key
    for (int i = 0; i < mapSize; i++) {
      LazyBinaryPrimitive<?, ?> lazyKeyI = uncheckedGetKey(i);
      if (lazyKeyI == null) {
        continue;
      }
      // getWritableObject() will convert LazyPrimitive to actual primitive
      // writable objects.
      Object keyI = lazyKeyI.getWritableObject();
      if (keyI == null) {
        continue;
      }
      if (keyI.equals(key)) {
        // Got a match, return the value
        LazyBinaryObject v = uncheckedGetValue(i);
        return v == null ? v : v.getObject();
      }
    }
    return null;
  }
Get the value in the map for the key.

If there are multiple matches (which is possible in the serialized format),
only the first one is returned.

The most efficient way to get the value for the key is to serialize the key
and then try to find it in the array. We do linear search because in most
cases, user only wants to get one or two values out of the map, and the
cost of building up a HashMap is substantially higher.

@param key
         The key object that we are looking for.
@return The corresponding value object, or NULL if not found
serde/src/java/org/apache/hadoop/hive/serde2/lazybinary/LazyBinaryMap.java