/** * Utility function that calls schema.getFiled(alias), and converts * {@link FrontendException} to {@link SchemaMergeException} * @param schema * @param alias * @return FieldSchema * @throws SchemaMergeException */ private static FieldSchema getFieldSubNameMatchThrowSchemaMergeException( Schema schema, String alias) throws SchemaMergeException { FieldSchema fs = null; try { fs = schema.getFieldSubNameMatch(alias); } catch (FrontendException e) { String msg = "Caught exception finding FieldSchema for alias " + alias; throw new SchemaMergeException(msg, e.getErrorCode(), e); } return fs; }
FieldSchema fs = isSubNameMatch ? getFieldSubNameMatch(alias) : getField(alias);