将 xlsx 文件加载到 Pig [英] Load xlsx file into Pig

查看:36
本文介绍了将 xlsx 文件加载到 Pig的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么方法可以将 .xlsx 文件加载到 Pig 中?我需要使用 excel 文件 [.xlsx] 作为输入在 PIG 中执行操作,但我找不到任何可用于此目的的内置函数.?

Is there any way to load .xlsx files into Pig? I need to perform an operation in PIG using the excel file [.xlsx] as input, but i couldn't find any built-in functions available for this purpose.?

实现这一目标的任何帮助都是可观的.

Any help to achieve this would be appreciable.

谢谢,

推荐答案

试试这个,

首先将xlsx文件转换成csv然后执行以下操作,

First convert the xlsx file into csv then do the following,

REGISTER Location\to\piggybank.jar

Data = load 'Location\to\csv\file' using org.apache.pig.piggybank.storage.CSVExcelStorage(',', 'NO_MULTILINE', 'NOCHANGE', 'SKIP_INPUT_HEADER') as (col1,col2,..);

它 (CSVExcelStorage) 对我有用.希望它有效.

It (CSVExcelStorage) worked for me. Hope it works.

这篇关于将 xlsx 文件加载到 Pig的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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