配置单元添加JAR不起作用 [英] Hive Adding JAR Not Working

查看:496
本文介绍了配置单元添加JAR不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图导入一个带有引号字段的文件。我发现了关于csv-serde JAR并尝试使用它来取得最小的成功。



我从以下地址下载了JAR:
https://github.com/ogrodnek/csv-serde



我添加到我的HDFS系统的/ tmp目录中。



当我尝试从Ambari中使用View to HIVE时,我设置了以下内容:

  ADD JAR /tmp/csv-serde-1.1.2-0.11.0-all.jar; 

这会抛出文件不存在的错误:


H110无法提交语句。处理语句时出错:
/tmp/csv-serde-1.1.2-0.11.0-all.jar不存在[ERROR_STATUS]

然后从终端调用配置单元尝试:


添加JAR /tmp/csv-serde-1.1.2 -0.11.0-all.jar;

成功。然后我创建我的EXTERNAL TABLE,然后选择一些字段,以确保它在CLI配置单元环境和所有作品中都很好。

然后我回到Hive View从Ambari内部,当我在桌子上运行任何类型的操作时,我得到:


H110无法提交语句。编译语句时出错:
FAILED:RuntimeException
MetaException(message:java.lang.ClassNotFoundException类
com.bizo.hive.serde.csv.CSVSerde找不到)[ERROR_STATUS]


当我尝试从MS SQL通过ODBC驱动器查询时,我也遇到了同样的错误。



我在这个论坛上查看了多个帖子,关于如何添加.jar和this以及如何:


/ usr / lib / hive


该目录不会在基本操作系统级别或HDFS文件系统的群集中退出。在哪里,以及如何,我应该把.jar文件放在我能够在蜂房CLI以外的地方查询我的表?

例如在HDFS中存在jar:

  hive>添加jar hdfs:///tmp/csv-serde-1.1.2 -0.11.0-all.jar在; 

确实返回

 转换为本地hdfs:///tmp/csv-serde-1.1.2-0.11.0-all.jar 
添加了[/ tmp / d6528831-4f3c-41e4-a4cf-121a63796a0f_resources / csv -serde-1.1.2-0.11.0-all.jar]到类路径
添加资源:[hdfs:///tmp/csv-serde-1.1.2-0.11.0-all.jar]

示例如果本地文件系统中存在jar

  hive>添加jar文件:///tmp/csv-serde-1.1.2-0.11.0-all.jar; 

...


I am trying to import a file that has the fields quoted. I found out about the csv-serde JAR and have attempted to use this to minimal success.

I downloaded the JAR from: https://github.com/ogrodnek/csv-serde

I added to my HDFS system in the /tmp directory.

When I try to use the View to HIVE from within Ambari I set the following:

ADD JAR /tmp/csv-serde-1.1.2-0.11.0-all.jar;

This throws an error that the file does not exist:

H110 Unable to submit statement. Error while processing statement: /tmp/csv-serde-1.1.2-0.11.0-all.jar does not exist [ERROR_STATUS]

I then try from terminal calling hive:

hive> ADD JAR /tmp/csv-serde-1.1.2-0.11.0-all.jar;

This succeeds. I then create my EXTERNAL TABLE and then select some fields to make sure it is good from within the CLI hive environment and all works.

I then go back to the Hive View from within Ambari and when I run any type of operation on the table I get:

H110 Unable to submit statement. Error while compiling statement: FAILED: RuntimeException MetaException(message:java.lang.ClassNotFoundException Class com.bizo.hive.serde.csv.CSVSerde not found) [ERROR_STATUS]

When I try to query this from MS SQL via the ODBC drive I also get the same error.

I have looked at multiple posts on this forum about adding so and so .jar and this and that to:

/usr/lib/hive

That directory does not exit on my cluster either in the base OS level or in the HDFS file system. Where exactly, and how, should I put the .jar file such that I can query my tables outside of the hive CLI?

解决方案

example if jar exist in HDFS:

hive>add jar hdfs:///tmp/csv-serde-1.1.2-0.11.0-all.jar;

did return

converting to local hdfs:///tmp/csv-serde-1.1.2-0.11.0-all.jar
Added [/tmp/d6528831-4f3c-41e4-a4cf-121a63796a0f_resources/csv-serde-1.1.2-0.11.0-all.jar] to class path
Added resources: [hdfs:///tmp/csv-serde-1.1.2-0.11.0-all.jar]

example if jar exist in local filesystem

hive>add jar file:///tmp/csv-serde-1.1.2-0.11.0-all.jar;

...

这篇关于配置单元添加JAR不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆