Hadoop - 使用PIG加载Hive表 [英] Hadoop - Load Hive tables using PIG

查看:616
本文介绍了Hadoop - 使用PIG加载Hive表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用Pig加载Hive表。我认为我们可以通过 HCatLoader 来实现,但我使用xml文件加载猪。为此,我必须使用 XMLLoader 。我可以使用两个选项来加载Pig中的XML文件。

I want to load Hive tables using Pig. I think we can do this through HCatLoader but I am using xml files to load pig. For this, I have to use XMLLoader. Can I use two options to load XML files in Pig.

我使用自己的UDF从XML文件中提取数据,一旦我们提取所有数据,我必须加载Hive表格中的猪数据。

I am extracting data from XML files using my own UDF and once we extract all the data, I have to load Pig data in Hive tables.

我不能使用HIVE来提取XML数据,因为我收到的XML非常复杂,我写了自己的UDF来解析XML。任何建议或指示我们如何使用PIG数据加载Hive表。

I can't use HIVE to extract the XML data as the XML I received is quite complex and I wrote my own UDF to parse the XML. Any suggestions or pointers how we can load Hive tables using PIG data.

我使用AWS。

推荐答案

您可以使用HCatStorer将猪的数据存储到Hive表中。例如:

You can store data from pig into Hive tables using HCatStorer. For example:

register 's3n://bucket/path/xmlUDF.jar'
xml = LOAD 's3n://bucket/pathtofiles' USING xmlUDF();
STORE xml INTO 'database.table' USING org.apache.hive.hcatalog.pig.HCatStorer();

您的问题不太清楚。你是否希望在猪内使用XML和Hive数据,做些什么,然后将结果存储在Hive中?试图将XML数据存储在Hive中并在其中使用?

Your question isn't quite clear. Are you hoping to work with the XML and Hive data within pig, do something, and then store the result in Hive? Just trying to store the XML data in Hive and work with it there?

这篇关于Hadoop - 使用PIG加载Hive表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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