Skip to content

An input format that returns a single split with a single row

Notifications You must be signed in to change notification settings

strategist922/DualInputFormat

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

DualInputFormat

An input format that returns a single split with a single row.

Can be used from hive like this.

client.execute ( "add jar "+jarFile);
client.execute("create table  dual  (fake string) "+
        "STORED AS INPUTFORMAT 'com.m6d.dualinputformat.DualInputFormat'"+
        "OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'");
client.execute("load data local inpath '" + p.toString() + "' into table dual");
client.execute("select count(1) as cnt from dual");
String row = client.fetchOne();
assertEquals( "1", row);

client.execute("select * from dual");
row = client.fetchOne();
assertEquals( "", row);

client.execute("drop table dual");

About

An input format that returns a single split with a single row

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published