/** * Returns whether a GenericUDF is stateful or not. */ public static boolean isStateful(GenericUDF genericUDF) { UDFType genericUDFType = AnnotationUtils.getAnnotation(genericUDF.getClass(), UDFType.class); if (genericUDFType != null && genericUDFType.stateful()) { return true; } if (genericUDF instanceof GenericUDFBridge) { GenericUDFBridge bridge = (GenericUDFBridge) genericUDF; UDFType bridgeUDFType = AnnotationUtils.getAnnotation(bridge.getUdfClass(), UDFType.class); if (bridgeUDFType != null && bridgeUDFType.stateful()) { return true; } } if (genericUDF instanceof GenericUDFMacro) { GenericUDFMacro macro = (GenericUDFMacro) (genericUDF); return macro.isStateful(); } return false; }
/** * Returns whether a GenericUDF is stateful or not. */ public static boolean isStateful(GenericUDF genericUDF) { UDFType genericUDFType = AnnotationUtils.getAnnotation(genericUDF.getClass(), UDFType.class); if (genericUDFType != null && genericUDFType.stateful()) { return true; } if (genericUDF instanceof GenericUDFBridge) { GenericUDFBridge bridge = (GenericUDFBridge) genericUDF; UDFType bridgeUDFType = AnnotationUtils.getAnnotation(bridge.getUdfClass(), UDFType.class); if (bridgeUDFType != null && bridgeUDFType.stateful()) { return true; } } if (genericUDF instanceof GenericUDFMacro) { GenericUDFMacro macro = (GenericUDFMacro) (genericUDF); return macro.isStateful(); } return false; }
@Override public boolean isDeterministic() { try { UDFType udfType = hiveFunctionWrapper.getUDFClass().getAnnotation(UDFType.class); return udfType != null && udfType.deterministic() && !udfType.stateful(); } catch (ClassNotFoundException e) { throw new RuntimeException(e); } } }
@Override public boolean isDeterministic() { try { UDFType udfType = hiveFunctionWrapper.getUDFClass().getAnnotation(UDFType.class); return udfType != null && udfType.deterministic() && !udfType.stateful(); } catch (ClassNotFoundException e) { throw new RuntimeException(e); } } }
/** * Returns whether a GenericUDF is stateful or not. */ public static boolean isStateful(GenericUDF genericUDF) { UDFType genericUDFType = AnnotationUtils.getAnnotation(genericUDF.getClass(), UDFType.class); if (genericUDFType != null && genericUDFType.stateful()) { return true; } if (genericUDF instanceof GenericUDFBridge) { GenericUDFBridge bridge = (GenericUDFBridge) genericUDF; UDFType bridgeUDFType = AnnotationUtils.getAnnotation(bridge.getUdfClass(), UDFType.class); if (bridgeUDFType != null && bridgeUDFType.stateful()) { return true; } } if (genericUDF instanceof GenericUDFMacro) { GenericUDFMacro macro = (GenericUDFMacro) (genericUDF); return macro.isStateful(); } return false; }