-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d43c2fe
commit 040a4f7
Showing
1 changed file
with
18 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,21 @@ | ||
DualInputFormat | ||
=============== | ||
|
||
An input format that returns a single split with a single role | ||
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"); |