private static FunctionInfo handleCastForParameterizedType(TypeInfo ti, FunctionInfo fi) { SettableUDF udf = (SettableUDF) fi.getGenericUDF(); try { udf.setTypeInfo(ti); } catch (UDFArgumentException e) { throw new RuntimeException(e); } return new FunctionInfo( fi.getFunctionType(), fi.getDisplayName(), (GenericUDF) udf, fi.getResources()); }
private static FunctionInfo handleCastForParameterizedType(TypeInfo ti, FunctionInfo fi) { SettableUDF udf = (SettableUDF) fi.getGenericUDF(); try { udf.setTypeInfo(ti); } catch (UDFArgumentException e) { throw new RuntimeException(e); } return new FunctionInfo( fi.getFunctionType(), fi.getDisplayName(), (GenericUDF) udf, fi.getResources()); }
/** * Verify that UDF not in whitelist can't be accessed * @throws Exception */ @Test (expected=SemanticException.class) public void testUdfNotInWhiteList() throws Exception { Set<String> funcNames = FunctionRegistry.getFunctionNames(); funcNames.remove("reflect"); FunctionRegistry.setupPermissionsForBuiltinUDFs(funcNames.toString(), ""); assertEquals("reflect", FunctionRegistry.getFunctionInfo("reflect").getDisplayName()); }
/** * Verify that UDF in the whitelist can be access * @throws Exception */ @Test public void testUdfInWhiteList() throws Exception { Set<String> funcNames = FunctionRegistry.getFunctionNames(); funcNames.remove("reflect"); FunctionRegistry.setupPermissionsForBuiltinUDFs(funcNames.toString(), ""); assertEquals("substr", FunctionRegistry.getFunctionInfo("substr").getDisplayName()); }
functionInfo.getDisplayName(), // FUNCTION_NAME "", // REMARKS (functionInfo.isGenericUDTF() ?
/** * Test malformatted udf list setting */ @Test (expected=SemanticException.class) public void testMalformattedListProperty() throws Exception { FunctionRegistry.setupPermissionsForBuiltinUDFs(",,", " ,reflect,"); assertEquals("reflect", FunctionRegistry.getFunctionInfo("reflect").getDisplayName()); }
/** * Verify that UDF in blacklist can't be accessed * @throws Exception */ @Test (expected=SemanticException.class) public void testUdfInBlackList() throws Exception { FunctionRegistry.setupPermissionsForBuiltinUDFs("", "reflect"); assertEquals("reflect", FunctionRegistry.getFunctionInfo("reflect").getDisplayName()); }
/** * Verify that UDF in whitelist and blacklist can't be accessed * @throws Exception */ @Test (expected=SemanticException.class) public void testUdfInBlackAndWhiteList() throws Exception { FunctionRegistry.setupPermissionsForBuiltinUDFs("reflect", "reflect"); assertEquals("reflect", FunctionRegistry.getFunctionInfo("reflect").getDisplayName()); }
/** * Verify that UDF in the whitelist can be access * @throws Exception */ @Test public void testDefaultWhiteList() throws Exception { assertEquals("", new HiveConf().getVar(ConfVars.HIVE_SERVER2_BUILTIN_UDF_WHITELIST)); assertEquals("", new HiveConf().getVar(ConfVars.HIVE_SERVER2_BUILTIN_UDF_BLACKLIST)); FunctionRegistry.setupPermissionsForBuiltinUDFs("", ""); assertEquals("substr", FunctionRegistry.getFunctionInfo("substr").getDisplayName()); }
private static FunctionInfo handleCastForParameterizedType(TypeInfo ti, FunctionInfo fi) { SettableUDF udf = (SettableUDF) fi.getGenericUDF(); try { udf.setTypeInfo(ti); } catch (UDFArgumentException e) { throw new RuntimeException(e); } return new FunctionInfo( fi.isNative(), fi.getDisplayName(), (GenericUDF) udf, fi.getResources()); }
LOG.info( "Skipping logging of UDF type to audit log - " + "displayName: " + e.getUDF().getDisplayName()); break; default:
LOG.info( "Skipping logging of UDF type to audit log - " + "displayName: " + e.getUDF().getDisplayName()); break; default:
functionInfo.getDisplayName(), // FUNCTION_NAME "", // REMARKS (functionInfo.isGenericUDTF() ?
functionInfo.getDisplayName(), // FUNCTION_NAME "", // REMARKS (functionInfo.isGenericUDTF() ?
functionInfo.getDisplayName(), // FUNCTION_NAME "", // REMARKS (functionInfo.isGenericUDTF() ?
functionInfo.getDisplayName(), // FUNCTION_NAME "", // REMARKS (functionInfo.isGenericUDTF() ?
functionInfo.getDisplayName(), // FUNCTION_NAME "", // REMARKS (functionInfo.isGenericUDTF() ?