- download tarball of hive source
- http://archive.cloudera.com/cdh4/cdh/4/hive-0.10.0-cdh4.5.0.tar.gz (2014. 02. 14)
- tar xfvz hive-0.10.0-cdh4.5.0.tar.gz
- cd hive-0.10.0-cdh4.5.0/src/ql/src/java/org/apache/hadoop/hive/ql/exec/
- vi FunctionRegistry.java
- find 'registerGenericUDF("split", GenericUDFSplit.class);' line
- insert 'registerGenericUDF("yourFunctionName", yourClassName.class);' under above line
- add 'import org.apache.hadoop.hive.ql.udf.generic.yourJavaName;'
- cd ../udf/generic/
- copy yourJavaName.java to here
- change the package of yourJavaName.java to 'package org.apache.hadoop.hive.ql.udf.generic;'
- cd hive-0.10.0-cdh4.5.0/src
- ant
- cd hive-0.10.0-cdh4.5.0/src/build/ql
- copy hive-exec-0.10.0-cdh4.5.0.jar to /opt/cloudera/parcels/CDH/lib/hive/lib
- restart Hive
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.