Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

A better README.

  • Loading branch information...
commit f34380f80ad769af479846c49b8ebff2c59ecd22 1 parent 4c29639
@edwardcapriolo authored
Showing with 22 additions and 0 deletions.
  1. +22 −0 README.md
View
22 README.md
@@ -0,0 +1,22 @@
+hive-collect
+=========
+
+ FSDataOutputStream o = this.getFileSystem().create(p);
+ BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(o));
+ bw.write("twelve\t12\n");
+ bw.write("twelve\t1\n");
+ bw.write("eleven\t11\n");
+ bw.write("eleven\t10\n");
+ bw.close();
+
+ String jarFile;
+ jarFile = GenericUDAFCollect.class.getProtectionDomain().getCodeSource().getLocation().getFile();
+ client.execute("add jar " + jarFile);
+ client.execute("create temporary function collect as 'com.jointhegrid.udf.collect.GenericUDAFCollect'");
+ client.execute("create table collecttest (str string, countVal int) row format delimited fields terminated by '09' lines terminated by '10'");
+ client.execute("load data local inpath '" + p.toString() + "' into table collecttest");
+
+ client.execute("select collect(str) FROM collecttest");
+ List<String> expected = Arrays.asList("[\"twelve\",\"eleven\"]");
+ assertEquals(expected, client.fetchAll());
+
Please sign in to comment.
Something went wrong with that request. Please try again.