LazyObject<?> [] fields = getFields();
boolean [] fieldsInited = getFieldInited();
if (!fieldsInited[fieldID]) {
ByteArrayRef ref = null;
ColumnMapping colMap = columnsMapping.get(fieldID);
if (colMap.hbaseRowKey) {
ref = new ByteArrayRef();
ref.setData(result.getRow());
} else {
if (colMap.qualifierName == null) {
// it is a column family
// primitive type for Map<Key, Value> can be stored in binary format. Pass in the
// qualifier prefix to cherry pick the qualifiers that match the prefix instead of picking
// up everything
((LazyHBaseCellMap) fields[fieldID]).init(
result, colMap.familyNameBytes, colMap.binaryStorage, colMap.qualifierPrefixBytes);
} else {
// it is a column i.e. a column-family with column-qualifier
byte [] res = result.getValue(colMap.familyNameBytes, colMap.qualifierNameBytes);
if (res == null) {
return null;
} else {
ref = new ByteArrayRef();
ref.setData(res);
}
}
}
if (ref != null) {
fields[fieldID].init(ref, 0, ref.getData().length);
}
}
// Has to be set last because of HIVE-3179: NULL fields would not work otherwise
fieldsInited[fieldID] = true;