Hive UDF Example In Java Upper Case And Lower Case

In this Hive UDF program i wrote an udf for converting a string from Lower case to upper case and upper case to lower case based on condition which string lenght is grater than 5.

Below is the code for converting strings from Upper to lower and lower to upper .

Also Read How to Write a UDF steps


Add Jar

add jar uplow1.jar;

Create a Temporary Function

create temporary function uplow as ‘com.hive.udf.udf';

in the above temporary function uplow represents the temporary function name and com.hive.udf represents the package name.

select uplow(“mahesh chimmiri”) from names;

uplow is temporary function and Mahesh chimmiri is main string here the string length is grater than 5 so that word will converted into Upper Case.


Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

HadoopTpoint © 2017 Frontier Theme