我已经安装了单节点集群hadoop和hive。我能够加载数据并显示在蜂巢中。我想要执行一个创建临时函数的脚本。我需要添加jar文件。jar文件是添加esri-几何学-api.jar空间-sdk-hive-1.0-MODIFIED.jar和HiveUDFs.jar
我引用了:How to write a script file in Hive?,我得到了这个错误:esri-几何学-api.jar不存在
我的配置细节:
$ echo $HADOOP_HOME:/home/hduser/hadoop-1.2.1
$ echo $JAVA_HOME:/usr/lib/java/jdk1.7.0_55
$ echo $:HIVE_HOME:/home/hduser/hadoop-1.2.1/hive-0.9.0-bin
java version "1.7.0_55"
Java(TM) SE Runtime Environment (build 1.7.0_55-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.55-b03, mixed mode)hadoop版本:
Hadoop 1.2.1
Subversion https://svn.apache.org/repos/asf/hadoop/common/branches/branch-1.2 -r 1503152
Compiled by mattf on Mon Jul 22 15:23:09 PDT 2013
From source with checksum 6923c86528809c4e7e6f493b6b413a9a
This command was run using /home/hduser/hadoop-1.2.1/hadoop-core-1.2.1.jar
HIVE VERSION: hive-0.9.0
hduser@ubuntu:~$ echo $HIVE_HOME
/home/hduser/hadoop-1.2.1/hive-0.9.0-bin我有一个单元脚本,我需要按以下方式执行:我有一个在5秒时间间隔内具有经度的数据。
add jar esri-geometry-api.jar spatial-sdk-hive-1.0-MODIFIED.jar HiveUDFs.jar;
create temporary function ST_AsText as 'com.esri.hadoop.hive.ST_AsText';
create temporary function ST_Intersects as 'com.esri.hadoop.hive.ST_Intersects';
create temporary function ST_Length as 'com.esri.hadoop.hive.ST_Length';
create temporary function ST_LineString as 'com.esri.hadoop.hive.ST_LineString';
create temporary function ST_Point as 'com.esri.hadoop.hive.ST_Point';
create temporary function ST_Polygon as 'com.esri.hadoop.hive.ST_Polygon';
create temporary function ST_SetSRID as 'com.esri.hadoop.hive.ST_SetSRID';
create temporary function collect_array as 'com.zombo.GenericUDAFCollectArray';
SELECT
id,
unix_timestamp(dt) - unix_timestamp(fv)
FROM (
SELECT
id, dt, fv
FROM (
SELECT
id, dt,
FIRST_VALUE(dt) OVER (PARTITION BY id ORDER BY dt) as fv,
ROW_NUMBER() OVER (PARTITION BY id ORDER BY dt DESC) as lastrk
FROM
uber
) sub1
WHERE
lastrk = 1
) sub2
WHERE
(unix_timestamp(dt) - unix_timestamp(fv)) < 28800;我的问题如下:
我还添加了hive-site.xml如下所示:
<configuration>
<property>
<name>hive.aux.jars.path</name>
<value>file:///home/hduser/hadoop_jar/HIVEUDFs.jar,
file:///home/hduser/hadoop_jar/esri-geometry-api-1.0.jar,
file:///home/hduser/hadoop_jar/spatial-sdk-json-1.0.1-sources.jar</value>
</property>
</configuration>我将jar文件添加到hadoop文件夹中我的hive目录的lib文件夹中。
发布于 2014-04-29 10:59:32
无法执行脚本的原因是缺少-f选项,执行脚本如下所示:
hduser@ubuntu:~/queries$ hive -f queries.hive添加jar /esri-几何学-api.jar;添加jar /spatial-sdk-hive-1.0-MODIFIED.jar;添加JAR /HiveUDFs.jar;
https://stackoverflow.com/questions/23361796
复制相似问题