private Shortcut getShortcutFieldPath(HollowDataset dataset, HollowSchema schema) { if(schema.getSchemaType() == SchemaType.OBJECT) { HollowObjectSchema objSchema = (HollowObjectSchema)schema; if(objSchema.numFields() == 1) { if(objSchema.getFieldType(0) == FieldType.REFERENCE) { HollowSchema refSchema = dataset.getSchema(objSchema.getReferencedType(0)); if(refSchema != null) { Shortcut childShortcut = getShortcutFieldPath(dataset, refSchema); if(childShortcut != null) { String[] shortcutPathTypes = new String[childShortcut.getPathTypes().length+1]; String[] shortcutPath = new String[childShortcut.getPath().length+1]; shortcutPathTypes[0] = objSchema.getName(); shortcutPath[0] = objSchema.getFieldName(0); System.arraycopy(childShortcut.getPath(), 0, shortcutPath, 1, childShortcut.getPath().length); System.arraycopy(childShortcut.getPathTypes(), 0, shortcutPathTypes, 1, childShortcut.getPathTypes().length); return new Shortcut(shortcutPathTypes, shortcutPath, childShortcut.getType()); } } } else { return new Shortcut(new String[] { objSchema.getName() }, new String[] { objSchema.getFieldName(0) }, objSchema.getFieldType(0)); } } } return null; }