if (o instanceof Boolean || o instanceof Integer ||
o instanceof Double || o instanceof String) {
if (typeSig.equals("Z") && o instanceof Integer) {
Integer i = (Integer)o;
if (i == 0) {
return new MirroredPrimitiveImpl(Boolean.FALSE, typeSig);
} else {
return new MirroredPrimitiveImpl(Boolean.TRUE, typeSig);
}
} else {
return new MirroredPrimitiveImpl(o, typeSig);
}
} else if (o instanceof ObjectId) {
// It may be a string.
Object newObject = session.getTODHandler().getObjectById((ObjectId)o);
if (newObject instanceof String) {
return new MirroredPrimitiveImpl(newObject, typeSig);
} else {
// It's not a string, but some other object.
String instantiatedType = ObjectInspector.getTypeSignature(session, (ObjectId)o);
if (instantiatedType == null) {
instantiatedType = typeSig;