throw new TeiidRuntimeException("failed to load UDF"); //$NON-NLS-1$
}
}
public static Command helpTranslate(String vdbFileName, String udf, List<FunctionMethod> pushdowns, String sql) {
TranslationUtility util = getTranslationUtility(vdbFileName, null);
Collection <FunctionMethod> methods = new ArrayList<FunctionMethod>();
if (udf != null) {
try {
methods.addAll(FunctionMetadataReader.loadFunctionMethods(TranslationHelper.class.getResource(udf).openStream()));
} catch (JAXBException e) {
throw new TeiidRuntimeException("failed to load UDF"); //$NON-NLS-1$
} catch (IOException e) {
throw new TeiidRuntimeException("failed to load UDF"); //$NON-NLS-1$
}
}
if (pushdowns != null) {
methods.addAll(pushdowns);
}
util.setUDF(methods);
return util.parseCommand(sql);
}