toSoi.setStructFieldData(to, toFields.get(i), converted);
}
return to;
case MAP:
MapObjectInspector fromMoi = (MapObjectInspector) fromOi;
SettableMapObjectInspector toMoi = (SettableMapObjectInspector) toOi;
to = toMoi.create(); // do not reuse
for (Map.Entry<?, ?> entry : fromMoi.getMap(from).entrySet()) {
Object convertedKey = convert(entry.getKey(),
fromMoi.getMapKeyObjectInspector(),
toMoi.getMapKeyObjectInspector());
Object convertedValue = convert(entry.getValue(),
fromMoi.getMapValueObjectInspector(),
toMoi.getMapValueObjectInspector());
toMoi.put(to, convertedKey, convertedValue);
}
return to;
case LIST:
ListObjectInspector fromLoi = (ListObjectInspector) fromOi;
List<?> fromList = fromLoi.getList(from);