Hive UDF to compartible DB UDF conversion and unit test