use of org.apache.hadoop.hive.ql.udf.generic.GenericUDFTrim in project hive by apache.
the class TestGenericUDFTrim method testTrim.
public void testTrim() throws HiveException {
GenericUDFTrim udf = new GenericUDFTrim();
ObjectInspector valueOI = PrimitiveObjectInspectorFactory.writableStringObjectInspector;
ObjectInspector[] arguments = { valueOI };
udf.initialize(arguments);
runAndVerify(" Hello World! ", "Hello World!", udf);
runAndVerify("Hello World! ", "Hello World!", udf);
runAndVerify(" Hello World!", "Hello World!", udf);
runAndVerify("Hello World!", "Hello World!", udf);
runAndVerify(" ", "", udf);
}
Aggregations