hive-0.7.1-cdh3u5 ,add "sort_array" function

In eclipse put all the hive-0.7.1-cdh3u5 lib to the project lib directory and add this to be a build path.

find the source code for sort_arry function from latest version hive

http://svn.apache.org/repos/asf/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFSortArray.java



create the HIVE_HOME/auxlib directory,put the jar file to this directory,

for the best,in the hive-0.7.1-cdh3u5/conf/hive-env.sh file,add "export HIVE_AUX_JARS_PATH=$HIVE_HOME/auxlib" to this file

click the hive command and run

create temporary function sort_array as'org.apache.hadoop.hive.ql.udf.generic.GenericUDFSortArray'; 

select sort_array(array(2,1,3,5)) from tmp1.test123; will work

DROP TEMPORARY FUNCTION IF EXISTS sort_array

show functions


你可能感兴趣的:(hive-0.7.1-cdh3u5 ,add "sort_array" function)