public static GenericUDAFResolver getGenericUDAFResolver(String functionName) throws SemanticException { if (LOG.isDebugEnabled()) { LOG.debug("Looking up GenericUDAF: " + functionName); } FunctionInfo finfo = getFunctionInfo(functionName); if (finfo == null) { return null; } GenericUDAFResolver result = finfo.getGenericUDAFResolver(); return result; }
public GenericUDAFResolver getGenericUDAFResolver(String functionName) throws SemanticException { FunctionInfo info = getFunctionInfo(functionName); if (info != null) { return info.getGenericUDAFResolver(); } return null; }
public GenericUDAFResolver getGenericUDAFResolver(String functionName) throws SemanticException { FunctionInfo info = getFunctionInfo(functionName); if (info != null) { return info.getGenericUDAFResolver(); } return null; }
public static GenericUDAFResolver getGenericUDAFResolver(String functionName) throws SemanticException { if (LOG.isDebugEnabled()) { LOG.debug("Looking up GenericUDAF: " + functionName); } FunctionInfo finfo = getFunctionInfo(functionName); if (finfo == null) { return null; } GenericUDAFResolver result = finfo.getGenericUDAFResolver(); return result; }
/** * Use this to check if function is ranking function * * @param name * name of a function * @return true if function is a UDAF, has WindowFunctionDescription annotation and the annotations * confirms a ranking function, false otherwise * @throws SemanticException */ public static boolean isRankingFunction(String name) throws SemanticException { FunctionInfo info = getFunctionInfo(name); if (info == null) { return false; } GenericUDAFResolver res = info.getGenericUDAFResolver(); if (res == null) { return false; } WindowFunctionDescription desc = AnnotationUtils.getAnnotation(res.getClass(), WindowFunctionDescription.class); return (desc != null) && desc.rankingFunction(); }
/** * Use this to check if function is ranking function * * @param name * name of a function * @return true if function is a UDAF, has WindowFunctionDescription annotation and the annotations * confirms a ranking function, false otherwise * @throws SemanticException */ public static boolean isRankingFunction(String name) throws SemanticException { FunctionInfo info = getFunctionInfo(name); if (info == null) { return false; } GenericUDAFResolver res = info.getGenericUDAFResolver(); if (res == null) { return false; } WindowFunctionDescription desc = AnnotationUtils.getAnnotation(res.getClass(), WindowFunctionDescription.class); return (desc != null) && desc.rankingFunction(); }
protected void validateUDF(ASTNode expr, boolean isFunction, TypeCheckCtx ctx, FunctionInfo fi, List<ExprNodeDesc> children, GenericUDF genericUDF) throws SemanticException { // Detect UDTF's in nested SELECT, GROUP BY, etc as they aren't // supported if (fi.getGenericUDTF() != null) { throw new SemanticException(ErrorMsg.UDTF_INVALID_LOCATION.getMsg()); } // UDAF in filter condition, group-by caluse, param of funtion, etc. if (fi.getGenericUDAFResolver() != null) { if (isFunction) { throw new SemanticException(ErrorMsg.UDAF_INVALID_LOCATION.getMsg((ASTNode) expr .getChild(0))); } else { throw new SemanticException(ErrorMsg.UDAF_INVALID_LOCATION.getMsg(expr)); } } if (!ctx.getAllowStatefulFunctions() && (genericUDF != null)) { if (FunctionRegistry.isStateful(genericUDF)) { throw new SemanticException(ErrorMsg.UDF_STATEFUL_INVALID_LOCATION.getMsg()); } } }
protected void validateUDF(ASTNode expr, boolean isFunction, TypeCheckCtx ctx, FunctionInfo fi, List<ExprNodeDesc> children, GenericUDF genericUDF) throws SemanticException { // Detect UDTF's in nested SELECT, GROUP BY, etc as they aren't // supported if (fi.getGenericUDTF() != null) { throw new SemanticException(ErrorMsg.UDTF_INVALID_LOCATION.getMsg()); } // UDAF in filter condition, group-by caluse, param of funtion, etc. if (fi.getGenericUDAFResolver() != null) { if (isFunction) { throw new SemanticException(ErrorMsg.UDAF_INVALID_LOCATION.getMsg((ASTNode) expr .getChild(0))); } else { throw new SemanticException(ErrorMsg.UDAF_INVALID_LOCATION.getMsg(expr)); } } if (!ctx.getAllowStatefulFunctions() && (genericUDF != null)) { if (FunctionRegistry.isStateful(genericUDF)) { throw new SemanticException(ErrorMsg.UDF_STATEFUL_INVALID_LOCATION.getMsg()); } } }
public static GenericUDAFResolver getGenericUDAFResolver(String functionName) { if (LOG.isDebugEnabled()) { LOG.debug("Looking up GenericUDAF: " + functionName); } FunctionInfo finfo = mFunctions.get(functionName.toLowerCase()); if (finfo == null) { return null; } GenericUDAFResolver result = finfo.getGenericUDAFResolver(); return result; }
public GenericUDAFResolver getGenericUDAFResolver(String functionName) throws SemanticException { FunctionInfo info = getFunctionInfo(functionName); if (info != null) { return info.getGenericUDAFResolver(); } return null; }
public static GenericUDAFResolver getGenericUDAFResolver(String functionName) throws SemanticException { if (LOG.isDebugEnabled()) { LOG.debug("Looking up GenericUDAF: " + functionName); } FunctionInfo finfo = getFunctionInfo(functionName); if (finfo == null) { return null; } GenericUDAFResolver result = finfo.getGenericUDAFResolver(); return result; }
/** * Use this to check if function is ranking function * * @param name * name of a function * @return true if function is a UDAF, has WindowFunctionDescription annotation and the annotations * confirms a ranking function, false otherwise * @throws SemanticException */ public static boolean isRankingFunction(String name) throws SemanticException { FunctionInfo info = getFunctionInfo(name); if (info == null) { return false; } GenericUDAFResolver res = info.getGenericUDAFResolver(); if (res == null) { return false; } WindowFunctionDescription desc = AnnotationUtils.getAnnotation(res.getClass(), WindowFunctionDescription.class); return (desc != null) && desc.rankingFunction(); }
protected void validateUDF(ASTNode expr, boolean isFunction, TypeCheckCtx ctx, FunctionInfo fi, List<ExprNodeDesc> children, GenericUDF genericUDF) throws SemanticException { // Detect UDTF's in nested SELECT, GROUP BY, etc as they aren't // supported if (fi.getGenericUDTF() != null) { throw new SemanticException(ErrorMsg.UDTF_INVALID_LOCATION.getMsg()); } // UDAF in filter condition, group-by caluse, param of funtion, etc. if (fi.getGenericUDAFResolver() != null) { if (isFunction) { throw new SemanticException(ErrorMsg.UDAF_INVALID_LOCATION.getMsg((ASTNode) expr .getChild(0))); } else { throw new SemanticException(ErrorMsg.UDAF_INVALID_LOCATION.getMsg(expr)); } } if (!ctx.getAllowStatefulFunctions() && (genericUDF != null)) { if (FunctionRegistry.isStateful(genericUDF)) { throw new SemanticException(ErrorMsg.UDF_STATEFUL_INVALID_LOCATION.getMsg()); } } }