Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Better readme!

  • Loading branch information...
commit 040a4f7740f76ebea9814b4abd125764b12906a0 1 parent d43c2fe
@edwardcapriolo authored
Showing with 18 additions and 1 deletion.
  1. +18 −1 README.md
View
19 README.md
@@ -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");
Please sign in to comment.
Something went wrong with that request. Please try again.