将数据从HDFS导入Hive表 [英] Importing data from HDFS to Hive table

查看:1137
本文介绍了将数据从HDFS导入Hive表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在HDFS的data / 2011/01/13/0100 /文件中有我的数据,每个文件都包含tab中分隔的数据,比如name,ip,url。

我想在Hive中创建一个表并从hdfs导入数据,表中应包含时间,名称,IP和URL。

如何使用Hive导入这些内容?数据应该采用其他格式,以便我可以导入时间?

解决方案

为了做到这一点,您必须使用分区,在这里阅读更多关于它们的信息:


I have my data in data/2011/01/13/0100/file in HDFS, each of thes file contain data in tab separated, say name, ip , url.

I want to create a table in Hive and import the data from hdfs, table should contain time,name, ip and url.

How can I import these using Hive ? r the data should be in some other format so that I can import the time as well ?

解决方案

To do this you have to use partitions, read more about them here:

这篇关于将数据从HDFS导入Hive表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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