Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 302994 - FlatFile Dataset chokes if all lines don't have same comma count
Summary: FlatFile Dataset chokes if all lines don't have same comma count
Status: CLOSED FIXED
Alias: None
Product: Data Tools
Classification: Tools
Component: Enablement:ODA (show other bugs)
Version: Ganymede   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 1.9   Edit
Assignee: Bin Feng CLA
QA Contact: Xiaoying Gu CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-16 15:54 EST by Chris Miami CLA
Modified: 2011-05-31 19:04 EDT (History)
5 users (show)

See Also:
bpayton: iplog+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Miami CLA 2010-02-16 15:54:31 EST
Build Identifier: M20090211-1700

The flatfile UI accurately parses the csv file I gave it but when it tries to preview the data, fails with an invalid csv exception.

The reason it fails is that only the first 3 fields are treated as required by the logger which creates the file. The trailing 3 are treated as optional, and are not always present.  It doesn't place trailing commas there.

The easiest and most awesome solution would be if the flatfile adaptor could treat any missing trailing columns as NULL, the way Oracles SQL*Loader uses "TRAILING NULLCOLS" in its CSV specifications.

I am setting the severity to "Major feature is broken" because SQL*Loader, which was written in like the 1890's, does it so BIRT should be able to handle it too... :-)

Reproducible: Always

Steps to Reproduce:
1. Create a CSV file with the following 2 lines:
One,Two,Three,Four,Five,Six
1,2,3,4,
2. Create a flat file dataset
3. Try to preview it
Comment 1 Chris Miami CLA 2010-02-16 16:08:44 EST
I looked for the source to try to help out but I cannot find it.

The page http://www.eclipse.org/birt/phoenix/build/buildInstructions.php  indicates that the code should be in org.eclipse.birt.report.data.oda.flatfile, but when I navigate to http://dev.eclipse.org/viewcvs/index.cgi/source/?root=BIRT_Project, there is no such package!!

So, sorry - I'dda helped but I can't find the code.
Comment 2 Lin Zhu CLA 2010-02-21 02:35:05 EST
flatfile is now part of Dtp project under /cvsroot/datatools/connectivity in CVS.

It is a valid enhancement for flatfile.
Comment 3 Bin Feng CLA 2011-04-21 02:18:10 EDT
Add "Use trailing null columns" checkbox to flatfile datasource select folder page. 
End users can dis/enable trailing null columns function by de/selecting the checkbox. 
If trailing null columns is disabled, the flat file driver behavior is consistent with that prior to this enhancement. Default is disabled. 
If trailing null columns is enabled, null value will be returned for the missing columns in the data row in flatfile.