简体   繁体   English

使用Pig脚本读取配置单元表

[英]Reading hive table using Pig script

I am trying to read hive table using PIG script but when I run a pig code to read a table in hive its giving me following error: 我正在尝试使用PIG脚本读取配置单元表,但是当我运行清管程序代码读取配置单元中的表时,出现以下错误:

2014-02-12 15:48:36,143 [main] WARN org.apache.hadoop.hive.conf.HiveConf  
    -hive-site.xml not found on CLASSPATH 2014-02-12 15:49:10,781 [main] ERROR
    org.apache.pig.tools.grunt.Grunt - ERROR 2997:  Unable to recreate
    exception from backed error: Error: Found class 
    org.apache.hadoop.mapreduce.TaskAttemptContext, but interface was expected

(Ignore newlines and whitespace added for readability) (忽略换行符和空格以提高可读性)

Hadoop version 1.1.1 Hadoop版本1.1.1

Hive version 0.9.0 Hive 0.9.0版

Pig version 0.10.0 猪版0.10.0

    Pig code
    a = LOAD '/user/hive/warehouse/test' USING 
    org.apache.pig.piggybank.storage.HiveColumnarLoader('name string');

Is it due to some version mismatch ? 是由于某些版本不匹配吗?

Why can't you use hcatalog to access hive metadata in pig? 为什么不能使用hcatalog来访问hcatalog中的配置单元元数据?
Check this for an example 查看示例

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM