Skip to content

Commit 6bc1142

Browse files
committed
[hive-udf] Adding code, classes and compilation instruction
1 parent 9ac7985 commit 6bc1142

File tree

5 files changed

+32
-1
lines changed

5 files changed

+32
-1
lines changed

hcatalog/README

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
Blog URL: http://gethue.tumblr.com/post/56804308712/hadoop-tutorial-how-to-access-hive-in-pig-with
1+
Blog URL
2+
========
3+
4+
[How to access Hive in Pig with HCatalog in Hue](http://gethue.tumblr.com/post/56804308712/hadoop-tutorial-how-to-access-hive-in-pig-with)
5+

hive-udf/README

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Blog URL
2+
========
3+
Coming soon
4+
5+
git clone https://github.com/romainr/hadoop-tutorials-examples.git
6+
cd hive-udf
7+
8+
# Just use myudf.jar
9+
10+
# Or compile it with:
11+
javac -cp $(ls /usr/lib/hive/lib/hive-exec*.jar):/usr/lib/hadoop/hadoop-common.jar org/hue/udf/MyUpper.java
12+
jar -cf myudfs.jar -C . .
13+

hive-udf/myudfs.jar

2.38 KB
Binary file not shown.

hive-udf/org/hue/udf/MyUpper.class

664 Bytes
Binary file not shown.

hive-udf/org/hue/udf/MyUpper.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
package org.hue.udf;
3+
4+
import org.apache.hadoop.hive.ql.exec.UDF;
5+
import org.apache.hadoop.io.Text;
6+
7+
8+
public final class MyUpper extends UDF {
9+
public Text evaluate(final Text s) {
10+
if (s == null) { return null; }
11+
return new Text(s.toString().toUpperCase());
12+
}
13+
}
14+

0 commit comments

Comments
 (0)