hadoop-common-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bjørn Remseth <la3...@gmail.com>
Subject Using space as field separator fails. How do I fix this?
Date Mon, 04 Apr 2011 09:50:48 GMT
Hi guys

I'm having a problem:  I'm reading a file where fields are terminated
by space (' ', ascii 32) into a table.  I'm not making these files
so I can't easily change this use of ' ' as field separator.

DROP TABLE logdata;

CREATE EXTERNAL TABLE logdata(
      xxx STRING,
      yyy STRING,
      ...
      z_t)
  ROW FORMAT DELIMITED
  FIELDS TERMINATED BY ' '
  STORED AS TEXTFILE;

LOAD DATA LOCAL INPATH '/somewhere/over/the/rainbow.dta' OVERWRITE INTO
TABLE logdata;


This fails: All the data is read into the first field (xxx).  If I
change the field separator to something else, e.g. "," things work
normally and I get to read the fields into their proper places
in the record, but then I have to edit the datafiles first and I don't
really want to do that.

Do you know how I can most easily read my logfiles?

Bjørn



-- 

                                                 (Rmz)

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message