-1
這是我的數據:阿帕奇豬CsvExcelStorage
"2001-08-10 01:09:29","3820166553","<P><TABLE border=0 cellSpacing=0 cellPadding=0 width="100%"><TBODY><TR><TD style="BACKGROUND-COLOR: #eee">
<TABLE border=0 cellSpacing=0 cellPadding=0 align=center><TBODY><TR><TD style="BACKGROUND-COLOR: #fff" class=maincontent><TABLE style="MARGIN: 0px auto" border=0 cellSpacing=0 cellPadding=0 width=580 align=center><TBODY><TR><TD colSpan=2><A href="general/forms/YHMN?ci=0c01026bd7fbc394&ags=D778083&cn=KOBY&pfnn="><IMG border=0 alt="Thanks for contacting us click here button" src="http:/edm/tcp-images/yhan-edm-banner-purple_button.jpg" width=580 height=255></A></TD></TR><TR><TD style="PADDING-BOTTOM: 35px; PADDING-LEFT: 32px; PADDING-RIGHT: 32px; PADDING-TOP: 35px" colSpan=2><P style="TEXT-ALIGN: left; LINE-HEIGHT: 18px; MARGIN-TOP: 0px; FONT-FAMILY: Arial, Helvetica, sans-serif; COLOR: #414141; FONT-SIZE: 14px" align=left></P><P style="TEXT-ALIGN: left; LINE-HEIGHT: 18px; FONT-FAMILY: Arial, Helvetica, sans-serif; COLOR: #414141; FONT-SIZE: 14px" align=left>If...",,"778083"
豬腳本:
stage = LOAD '/filename' USING org.apache.pig.piggybank.storage.CSVExcelStorage(',','YES_MULTILINE','UNIX','READ_INPUT_HEADER') as (col1,col2,col3,col4,col5);
col3_data=FOREACH stage GENERATE col3;
DUMP col3_data;
輸出:
(<P><TABLE border=0 cellSpacing=0 cellPadding=0 width=100%"><TBODY><TR><TD style=BACKGROUND-COLOR: #eee">
<TABLE border=0 cellSpacing=0 cellPadding=0 align=center><TBODY><TR><TD style=BACKGROUND-COLOR: #fff" class=maincontent><TABLE style=MARGIN: 0px auto" border=0 cellSpacing=0 cellPadding=0 width=580 align=center><TBODY><TR><TD colSpan=2><A href=general/forms/YHMN?ci=0c01026bd7fbc394&ags=D778083&cn=KOBY&pfnn="><IMG border=0 alt=Thanks for contacting us click here button" src=http:/edm/tcp-images/yhan-edm-banner-purple_button.jpg" width=580 height=255></A></TD></TR><TR><TD style=PADDING-BOTTOM: 35px; PADDING-LEFT: 32px; PADDING-RIGHT: 32px; PADDING-TOP: 35px" colSpan=2><P style=TEXT-ALIGN: left; LINE-HEIGHT: 18px; MARGIN-TOP: 0px; FONT-FAMILY: Arial)
我使用csvExcelStorage加載我的數據文件在豬裏。文件中的一列有行尾字符。數據文件看起來像
"2015-08-17 23:55:59","12345","<P>this is test data,
<TR>
<\TR><BODY>Text-Align: Arial, Roman,feed this; end of input...","column 4"
負荷聲明如下:
stage=LOAD '/data/file' using csvExcelStorage(',','YES_MULTILINE','NOCHANGE','READ_INPUT_HEADER') as (col1,col2,col3,col4)
當我傾倒數據加載之後我收到以下
col3 = <P>this is test data,
<TR>
<\TR><BODY>"Text-Align: Arial
和
col4 = Roman
因此col3
包含不完整的數據,而col4
有錯誤的數據。
請幫助確定這裏有什麼問題。
豬哪個版本的?你可以將階段別名的DUMP結果添加到問題中嗎? –