public void testLevenshteinWrongLength() throws HiveException { @SuppressWarnings("resource") GenericUDFLevenshtein udf = new GenericUDFLevenshtein(); ObjectInspector valueOI0 = PrimitiveObjectInspectorFactory.writableHiveVarcharObjectInspector; ObjectInspector[] arguments = { valueOI0 }; try { udf.initialize(arguments); assertTrue("levenshtein test. UDFArgumentLengthException is expected", false); } catch (UDFArgumentLengthException e) { assertEquals("levenshtein test", "levenshtein requires 2 argument(s), got 1", e.getMessage()); } }
public void testSoundexWrongLength() throws HiveException { @SuppressWarnings("resource") GenericUDFSoundex udf = new GenericUDFSoundex(); ObjectInspector valueOI0 = PrimitiveObjectInspectorFactory.writableHiveVarcharObjectInspector; ObjectInspector valueOI1 = PrimitiveObjectInspectorFactory.writableHiveVarcharObjectInspector; ObjectInspector[] arguments = { valueOI0, valueOI1 }; try { udf.initialize(arguments); assertTrue("soundex test. UDFArgumentLengthException is expected", false); } catch (UDFArgumentLengthException e) { assertEquals("soundex test", "soundex requires 1 argument, got 2", e.getMessage()); } }
} catch (UDFArgumentLengthException e) { throw new SemanticException(ErrorMsg.INVALID_ARGUMENT_LENGTH.getMsg( expr, e.getMessage()), e); } catch (UDFArgumentException e) { throw new SemanticException(ErrorMsg.INVALID_ARGUMENT.getMsg(expr, e
} catch (UDFArgumentLengthException e) { throw new SemanticException(ErrorMsg.INVALID_ARGUMENT_LENGTH.getMsg( expr, e.getMessage()), e); } catch (UDFArgumentException e) { throw new SemanticException(ErrorMsg.INVALID_ARGUMENT.getMsg(expr, e
} catch (UDFArgumentLengthException e) { throw new SemanticException(ErrorMsg.INVALID_ARGUMENT_LENGTH.getMsg( expr, e.getMessage())); } catch (UDFArgumentException e) { throw new SemanticException(ErrorMsg.INVALID_ARGUMENT.getMsg(expr, e
} catch (UDFArgumentLengthException e) { throw new SemanticException(ErrorMsg.INVALID_ARGUMENT_LENGTH.getMsg( expr, e.getMessage())); } catch (UDFArgumentException e) { throw new SemanticException(ErrorMsg.INVALID_ARGUMENT.getMsg(expr, e