is COLUMN SEP a single char or string var?

3 views
Skip to first unread message

Robert Johnson

unread,
Jun 17, 2010, 10:58:00 PM6/17/10
to CloudBase
It is listed in the docs as a string.

However, I have some data that is separated by <~>
When I write a CREATE TABLE using the COLUMN SEP '<~>' I don't get any
results when I then do a select * from that table.

However, if I change the COLUMN SEP to '~' I get rows loaded except
for rows that already contain a ~ on them, in which case those rows
fail due to column count mismatch

what is the appropriate way to parse data that is structured yet
separated by a multi-character separator string?

Tarandeep Singh

unread,
Jun 18, 2010, 1:43:35 AM6/18/10
to cloudba...@googlegroups.com
column sep can be string having multiple chars.
I created a text file having these 3 lines-

abc<~>def
pqr<~>123
lmn<~>xyz

Then I created a table-
create table multi (c1 varchar, c2 varchar) column sep '<~>' import data from '/home/tsingh/multi'

The select sql gives correct result-

select * from multi

abc   def
pqr   123
lmn   xyz

Can you check the chars that you are using as sep are the same in your data file. If you still can't get it working, could you send a txt file containing few rows. I will check it here..

-Tarandeep



--
You received this message because you are subscribed to the Google Groups "CloudBase" group.
To post to this group, send email to cloudba...@googlegroups.com.
To unsubscribe from this group, send email to cloudbase-use...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cloudbase-users?hl=en.


Reply all
Reply to author
Forward
0 new messages