Skip to content

Latest commit

 

History

History
33 lines (23 loc) · 597 Bytes

README.md

File metadata and controls

33 lines (23 loc) · 597 Bytes

HiveUDTF

This Hive UDTF will duplicate the first input column

a. How to build the jar

mvn package

##b. Prepare a Hive table with sample data

In Hive CLI, create a test table:

create table testudtf(a string, b string) ROW FORMAT DELIMITED FIELDS TERMINATED BY ",";

Put below data for above Hive table:

echo "abc,xyz" > test.csv

##c. Test UDTF

ADD JAR ~/target/DoubleColumn-1.0.0.jar;
CREATE TEMPORARY FUNCTION double_column AS 'openkb.hive.udtf.DoubleColumn'; 
SELECT double_column(a,b) as (a1,a2,b) FROM testudtf;

Result:
abc	abc	xyz