You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by 王鹏飞 <wp...@gmail.com> on 2015/01/13 07:15:24 UTC
Hive create table line terminated by '\n'
At default hive table lines terminated by only supports '\n' right now;But
if there is a column that contains a '\n',how could i do ? Hive split the
column and went wrong,Is there any solutions ? Thank you.
Re: Hive create table line terminated by '\n'
Posted by 王鹏飞 <wp...@gmail.com>.
Can you give me a simple example like table only contains one string
column,and in that sting column it contains '\n' as the content ?
On Wed, Jan 14, 2015 at 1:42 AM, Xuefu Zhang <xz...@cloudera.com> wrote:
> Consider using dataformat other than TEXT such as sequence file.
>
> On Mon, Jan 12, 2015 at 10:54 PM, 王鹏飞 <wp...@gmail.com> wrote:
>
>> Thank you,maybe i didn't express my question explicitly.I know the hive
>> create table clause,and there exists FIELDS TERMINATED BY etc.
>> For example,if i use FIELDS TERMINATED BY ' ,',what if the ' ,' is
>> contained in One field,hive will use the rule to separate One field.
>> You might suggested me to change the fields terminator,But how about the
>> lines terminator?The Lines Terminator only support '\n',So the problem is
>> what could i do if one column or field contains the '\n'?
>>
>> On Tue, Jan 13, 2015 at 2:25 PM, Xiaoyong Zhu <xi...@microsoft.com>
>> wrote:
>>
>>> I guess you could use fields terminated by clause..
>>>
>>> CREATE TABLE IF NOT EXISTS default.table_name
>>>
>>> ROW FORMAT DELIMITED
>>>
>>> FIELDS TERMINATED BY '\001'
>>>
>>> COLLECTION ITEMS TERMINATED BY '\002'
>>>
>>> MAP KEYS TERMINATED BY '\003'
>>>
>>> STORED AS TEXTFILE
>>>
>>>
>>>
>>>
>>>
>>> Xiaoyong
>>>
>>>
>>>
>>> *From:* 王鹏飞 [mailto:wpf5511@gmail.com]
>>> *Sent:* Tuesday, January 13, 2015 2:15 PM
>>> *To:* user@hive.apache.org
>>> *Subject:* Hive create table line terminated by '\n'
>>>
>>>
>>>
>>> At default hive table lines terminated by only supports '\n' right
>>> now;But if there is a column that contains a '\n',how could i do ? Hive
>>> split the column and went wrong,Is there any solutions ? Thank you.
>>>
>>
>>
>
Re: Hive create table line terminated by '\n'
Posted by Xuefu Zhang <xz...@cloudera.com>.
Consider using dataformat other than TEXT such as sequence file.
On Mon, Jan 12, 2015 at 10:54 PM, 王鹏飞 <wp...@gmail.com> wrote:
> Thank you,maybe i didn't express my question explicitly.I know the hive
> create table clause,and there exists FIELDS TERMINATED BY etc.
> For example,if i use FIELDS TERMINATED BY ' ,',what if the ' ,' is
> contained in One field,hive will use the rule to separate One field.
> You might suggested me to change the fields terminator,But how about the
> lines terminator?The Lines Terminator only support '\n',So the problem is
> what could i do if one column or field contains the '\n'?
>
> On Tue, Jan 13, 2015 at 2:25 PM, Xiaoyong Zhu <xi...@microsoft.com>
> wrote:
>
>> I guess you could use fields terminated by clause..
>>
>> CREATE TABLE IF NOT EXISTS default.table_name
>>
>> ROW FORMAT DELIMITED
>>
>> FIELDS TERMINATED BY '\001'
>>
>> COLLECTION ITEMS TERMINATED BY '\002'
>>
>> MAP KEYS TERMINATED BY '\003'
>>
>> STORED AS TEXTFILE
>>
>>
>>
>>
>>
>> Xiaoyong
>>
>>
>>
>> *From:* 王鹏飞 [mailto:wpf5511@gmail.com]
>> *Sent:* Tuesday, January 13, 2015 2:15 PM
>> *To:* user@hive.apache.org
>> *Subject:* Hive create table line terminated by '\n'
>>
>>
>>
>> At default hive table lines terminated by only supports '\n' right
>> now;But if there is a column that contains a '\n',how could i do ? Hive
>> split the column and went wrong,Is there any solutions ? Thank you.
>>
>
>
Re: Hive create table line terminated by '\n'
Posted by 王鹏飞 <wp...@gmail.com>.
Thank you,maybe i didn't express my question explicitly.I know the hive
create table clause,and there exists FIELDS TERMINATED BY etc.
For example,if i use FIELDS TERMINATED BY ' ,',what if the ' ,' is
contained in One field,hive will use the rule to separate One field.
You might suggested me to change the fields terminator,But how about the
lines terminator?The Lines Terminator only support '\n',So the problem is
what could i do if one column or field contains the '\n'?
On Tue, Jan 13, 2015 at 2:25 PM, Xiaoyong Zhu <xi...@microsoft.com>
wrote:
> I guess you could use fields terminated by clause..
>
> CREATE TABLE IF NOT EXISTS default.table_name
>
> ROW FORMAT DELIMITED
>
> FIELDS TERMINATED BY '\001'
>
> COLLECTION ITEMS TERMINATED BY '\002'
>
> MAP KEYS TERMINATED BY '\003'
>
> STORED AS TEXTFILE
>
>
>
>
>
> Xiaoyong
>
>
>
> *From:* 王鹏飞 [mailto:wpf5511@gmail.com]
> *Sent:* Tuesday, January 13, 2015 2:15 PM
> *To:* user@hive.apache.org
> *Subject:* Hive create table line terminated by '\n'
>
>
>
> At default hive table lines terminated by only supports '\n' right now;But
> if there is a column that contains a '\n',how could i do ? Hive split the
> column and went wrong,Is there any solutions ? Thank you.
>
RE: Hive create table line terminated by '\n'
Posted by Xiaoyong Zhu <xi...@microsoft.com>.
I guess you could use fields terminated by clause..
CREATE TABLE IF NOT EXISTS default.table_name
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\001'
COLLECTION ITEMS TERMINATED BY '\002'
MAP KEYS TERMINATED BY '\003'
STORED AS TEXTFILE
Xiaoyong
From: 王鹏飞 [mailto:wpf5511@gmail.com]
Sent: Tuesday, January 13, 2015 2:15 PM
To: user@hive.apache.org
Subject: Hive create table line terminated by '\n'
At default hive table lines terminated by only supports '\n' right now;But if there is a column that contains a '\n',how could i do ? Hive split the column and went wrong,Is there any solutions ? Thank you.