private OGCGeometry getGeometry(DeferredObject arg) {
    Object writable;
    try {
      writable = oi.getPrimitiveWritableObject(arg.get());
    } catch (HiveException e) {
      LOG.error("Failed to get writable", e);
      return null;
    }

    if (writable == null) {
      return null;
    }

    switch (oi.getPrimitiveCategory()) {
    case BINARY:
      return getGeometryFromBytes((BytesWritable) writable);
    case STRING:
      return OGCGeometry.fromText(writable.toString());
    default:
      return null;
    }
  }
Reads the corresponding geometry from the deferred object list
or returns the cached geometry if argument is constant.

@param args
@return
ql/src/java/org/apache/hadoop/hive/ql/udf/esri/HiveGeometryOIHelper.java