riptano/hive — comment on commit c29ea8afebed9f96023db8a859df95e381b6fe2f
File: cassandra-handler/src/java/org/apache/hadoop/hive/cassandra/input/ColumnFamilyWideRowRecordReader.java line 258
By xedin:

Instead of storing cf names into separate array and then getting an index of the specific cf to get its CfDef, you can just go through ks_def.cf_defs once like this:

private static CfDef findCfDef(KsDef ks_def, String cfName)
{
for (CfDef cfDef : ks_def.cf_defs)
{
if (cfDef.name.equals(cfName))
return cfDef;
}

return null;
}

and in constructor do:

CfDef cf_def = findCfDef(ks_def, cfName);
if (cf_def == null)
throw new RuntimeException("ColumnFamily named " + cfName + " wasn't found in keyspace " + ks_def.name);