/** * Gets the evaluate method for the UDF given the parameter types. * * @param argClasses * The list of the argument types that need to matched with the * evaluate function signature. */ @Override public Method getEvalMethod(List<TypeInfo> argClasses) throws UDFArgumentException { return FunctionRegistry.getMethodInternal(udfClass, "evaluate", false, argClasses); } }
/** * Gets the evaluate method for the UDF given the parameter types. * * @param argClasses * The list of the argument types that need to matched with the * evaluate function signature. */ @Override public Method getEvalMethod(List<TypeInfo> argClasses) throws UDFArgumentException { return FunctionRegistry.getMethodInternal(udfClass, "evaluate", false, argClasses); } }
/** * This method is shared between UDFRegistry and UDAFRegistry. methodName will * be "evaluate" for UDFRegistry, and "aggregate"/"evaluate"/"evaluatePartial" * for UDAFRegistry. * @throws UDFArgumentException */ public static <T> Method getMethodInternal(Class<? extends T> udfClass, String methodName, boolean exact, List<TypeInfo> argumentClasses) throws UDFArgumentException { List<Method> mlist = new ArrayList<Method>(); for (Method m : udfClass.getMethods()) { if (m.getName().equals(methodName)) { mlist.add(m); } } return getMethodInternal(udfClass, mlist, exact, argumentClasses); }
/** * This method is shared between UDFRegistry and UDAFRegistry. methodName will * be "evaluate" for UDFRegistry, and "aggregate"/"evaluate"/"evaluatePartial" * for UDAFRegistry. * @throws UDFArgumentException */ public static <T> Method getMethodInternal(Class<? extends T> udfClass, String methodName, boolean exact, List<TypeInfo> argumentClasses) throws UDFArgumentException { List<Method> mlist = new ArrayList<Method>(); for (Method m : udfClass.getMethods()) { if (m.getName().equals(methodName)) { mlist.add(m); } } return getMethodInternal(udfClass, mlist, exact, argumentClasses); }
Method m = FunctionRegistry.getMethodInternal(udafClass, mList, false, argClasses);
Method m = FunctionRegistry.getMethodInternal(udafClass, mList, false, argClasses);
private void verify(Class udf, String name, TypeInfo ta, TypeInfo tb, Class a, Class b, boolean throwException) { List<TypeInfo> args = new LinkedList<TypeInfo>(); args.add(ta); args.add(tb); Method result = null; try { result = FunctionRegistry.getMethodInternal(udf, name, false, args); } catch (UDFArgumentException e) { assert(throwException); return; } assert(!throwException); assertEquals(2, result.getParameterTypes().length); assertEquals(a, result.getParameterTypes()[0]); assertEquals(b, result.getParameterTypes()[1]); }
/** * Gets the evaluate method for the UDF given the parameter types. * * @param argClasses * The list of the argument types that need to matched with the * evaluate function signature. */ @Override public Method getEvalMethod(List<TypeInfo> argClasses) throws UDFArgumentException { return FunctionRegistry.getMethodInternal(udfClass, "evaluate", false, argClasses); } }
/** * Gets the evaluate method for the UDF given the parameter types. * * @param argClasses * The list of the argument types that need to matched with the * evaluate function signature. */ @Override public Method getEvalMethod(List<TypeInfo> argClasses) throws UDFArgumentException { return FunctionRegistry.getMethodInternal(udfClass, "evaluate", false, argClasses); } }
/** * This method is shared between UDFRegistry and UDAFRegistry. methodName will * be "evaluate" for UDFRegistry, and "aggregate"/"evaluate"/"evaluatePartial" * for UDAFRegistry. * @throws UDFArgumentException */ public static <T> Method getMethodInternal(Class<? extends T> udfClass, String methodName, boolean exact, List<TypeInfo> argumentClasses) throws UDFArgumentException { List<Method> mlist = new ArrayList<Method>(); for (Method m : udfClass.getMethods()) { if (m.getName().equals(methodName)) { mlist.add(m); } } return getMethodInternal(udfClass, mlist, exact, argumentClasses); }
/** * This method is shared between UDFRegistry and UDAFRegistry. methodName will * be "evaluate" for UDFRegistry, and "aggregate"/"evaluate"/"evaluatePartial" * for UDAFRegistry. * @throws UDFArgumentException */ public static <T> Method getMethodInternal(Class<? extends T> udfClass, String methodName, boolean exact, List<TypeInfo> argumentClasses) throws UDFArgumentException { List<Method> mlist = new ArrayList<Method>(); for (Method m : Arrays.asList(udfClass.getMethods())) { if (m.getName().equals(methodName)) { mlist.add(m); } } return getMethodInternal(udfClass, mlist, exact, argumentClasses); }
Method m = FunctionRegistry.getMethodInternal(udafClass, mList, false, argClasses);
Method m = FunctionRegistry.getMethodInternal(udafClass, mList, false, argClasses);