Contributed by Calpont, InfiniDB Community Edition is an open source, scale-up analytics database engine for your data warehousing, business intelligence and read-intensive application needs. Enabled via MySQLTM and purpose-built for an analytical workload with column-oriented technology at its core, the multi-threaded capabilities of InfiniDB Community Edition fully encompass query, transactional support and bulk load operations.  So come on in, grab a download and get started.

             | 

Welcome, Guest
Username Password: Remember me

cpimport thinks there are not enought columns
(1 viewing) (1) Guest
  • Page:
  • 1

TOPIC: cpimport thinks there are not enought columns

cpimport thinks there are not enought columns 1 year, 5 months ago #1303

  • ddesybel
  • OFFLINE
  • Fresh Boarder
  • Posts: 12
  • Karma: 0
Hi guys

Am having a small issue with cpimport. I have a file that has 6 columns delimitered by tabs '\t'. The table I am importing to has 6 columns too.

When trying to use cpimport, it gives me the error:

Error: Data contains wrong number of columns; num columns expected-6; num columns found-5

for every line.

I have attached the .bad output file from cpimport and you can see that each line of the .bad file has 6 columns, however the last 2 columns are empty. Is there an issue with consecutive delimiters at the end of a line?

Attachment tmprawconversionpixelloads.txt not found

Attachments:
Last Edit: 1 year, 5 months ago by ddesybel. Reason: File did not upload

Re:cpimport thinks there are not enought columns 1 year, 5 months ago #1304

  • ddesybel
  • OFFLINE
  • Fresh Boarder
  • Posts: 12
  • Karma: 0
Adding the .err file too...

Attachment tmprawconversionpixelloads-20100902.txt not found

Attachments:

Re:cpimport thinks there are not enought columns 1 year, 5 months ago #1305

  • davestokes
  • OFFLINE
  • Expert Boarder
  • Posts: 116
  • Karma: 2
Let's look at a line from the data:

2010-08-31 21:36:19 0 6319714895254184324 540


head -1 tmprawconversionpixelloads.txt | od -c
0000000 2 0 1 0 - 0 8 - 3 1 2 1 : 3 6
0000020 : 1 9 \t 0 \t 6 3 1 9 7 1 4 8 9 5
0000040 2 5 4 1 8 4 3 2 4 \t 5 4 0 \t \t \n
0000060

There five tabs (\t) but cpimport is not going to handle the two 'missing' columns. If you change the last two columns to zeros, the file will load (s/\t\t/\t0\t0/)

Re:cpimport thinks there are not enought columns 1 year, 5 months ago #1307

  • ddesybel
  • OFFLINE
  • Fresh Boarder
  • Posts: 12
  • Karma: 0
Is that not a bug though? The example cpimport_single,sh replaces NULLs with 0 length strings so I would have thought this would generate the same issue.

If I just put a 0 at the end, will that work, or is it the consecutive delimiters that are the issue? Also, these columns are strings, could I put a single space there instead of a 0?

Re:cpimport thinks there are not enought columns 1 year, 5 months ago #1308

  • ddesybel
  • OFFLINE
  • Fresh Boarder
  • Posts: 12
  • Karma: 0
Just tested the spaces and it worked

Re:cpimport thinks there are not enought columns 1 year, 5 months ago #1309

  • davestokes
  • OFFLINE
  • Expert Boarder
  • Posts: 116
  • Karma: 2
Great!
  • Page:
  • 1
Time to create page: 0.32 seconds