如何将xls数据从多个xls文件加载到配置单元中? [英] How to load xls data from multiple xls file into hive?

查看:95
本文介绍了如何将xls数据从多个xls文件加载到配置单元中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我需要针对8个xls文件中的一组数据集执行一些查询。每个xls文件都有多个表单,查询只涉及其中一张表。



数据集可以在这里下载: http://www.census.gov/hhes/www/hlthins/data/utilization/tables.html

我的任务中没有使用hadoop的商业发行版,只有一个主VM和一个VM在Hmith中搭配Hadoop,Hive,Pig。

我是Hadoop和大数据的新手,所以如果任何人都可以指导我如何继续下去,我会非常感激。



如果您需要关于查询的信息或任何其他信息,请告知我们。

谢谢。

在配置单元中,您无法直接将数据从xls加载到表中,就像您对txt或csv文件所做的那样。

您有两种选择:


  1. 编写一个应用程序(例如Java)读取xls文件并将它们转换为可直接加载到配置单元的文本或csv文件。

OR


  1. 您可以创建您自己的serde(序列化器或反序列化器),您可以使用它来分析要加载到表中的xls数据。
  2. 两者都有其优点和缺点,但如果您打算使用与HIVE交互的应用程序进行加载,查询,转换等,您可以选择1。但是,如果您打算通过脚本/批处理等进行操作,则可以选择2。

    I am learning to use Hadoop for performing Big Data related operations.

    I need to perform some queries on a collection of data sets split across 8 xls files. Each xls file has multiple sheets and the query concerns only one of the sheets.

    The dataset can be downloaded here : http://www.census.gov/hhes/www/hlthins/data/utilization/tables.html

    I am not using any commerical distro of hadoop for my tasks, just have one master and a slave VM set up in VmWare with Hadoop, Hive, Pig in them.

    I am a novice with Hadoop and Big Data, so if anyone could guide me with how to proceed further I'd be very grateful.

    If you need information on the queries or anything else let me know.

    Thanks.

    解决方案

    In hive you cannot Load data into the tables from xls directly, as you do for a txt or csv files.

    You have two options:

    1. Write an application (eg, Java) to read the xls files and convert them into text or csv files that can be loaded directly into a hive.

    OR

    1. You can create your own serde (Serializer or Deserializer) that you provide to parse your xls data to be loaded into a table.

    Both have their pros and cons, but If you intend to use an application interacting with HIVE for loading, querying, transforming etc. You can go with option 1. But, if you intend to do via scripts/batch etc you can go with option 2.

    这篇关于如何将xls数据从多个xls文件加载到配置单元中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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