private void runAndVerifyStr(String str, Long expResult, UDFCrc32 udf) throws HiveException { Text t = str != null ? new Text(str) : null; LongWritable output = (LongWritable) udf.evaluate(t); if (expResult == null) { assertNull(output); } else { assertNotNull(output); assertEquals("crc32() test ", expResult.longValue(), output.get()); } }
private void runAndVerifyBin(byte[] binV, Long expResult, UDFCrc32 udf) throws HiveException { BytesWritable binWr = binV != null ? new BytesWritable(binV) : null; LongWritable output = (LongWritable) udf.evaluate(binWr); if (expResult == null) { assertNull(output); } else { assertNotNull(output); assertEquals("crc32() test ", expResult.longValue(), output.get()); } } }