I think we should handle both, if NULL then write NULL to csv and if blank then write "" to csv, this will solve null vs blank.
Please let me know is it possible? Thanks, Laxmi Lal On Tue, Sep 25, 2018 at 8:17 AM, Kasper Sørensen < [email protected]> wrote: > CSV files do not have a way to represent null values, so they automatically > become blank. They're just text files and there is no way that a text file > can distinguish between a blank and a null. I guess we could introduce a > system property or something like that, which could turn all blanks into > null. But I imagine that then you would ask the inverse question about how > to represent blank strings as non-null? :-) > > Den tor. 20. sep. 2018 kl. 21.48 skrev Laxmi Lal Menaria < > [email protected]>: > > > Hi All, > > > > I am trying to write MSSQL data to csv files and use Apache MetaModel for > > the same, It is working fine for most of the case but failed when I > restore > > the csv to Test database. > > > > When I compare the both database I got that BLANK values are migrated to > > NULL values. This should not happens due to data integrity. > > > > I look the metamodel code and found that it is converting the NULL values > > to BLANK > > > > (CsvInsertBuilder) > > > > for(int i = 0; i < stringValues.length; ++i) { > > stringValues[i] = values[i] == null ? "" : values[i].toString(); > > } > > > > So please let me know how can I separate both values NULL and BLANK. > > > > -- > > > > Thanks, > > Laxmilal Menaria | +91 982 955 3793 | http://laxmilalmenaria.com/ > > > -- Thanks, Laxmilal Menaria | +91 982 955 3793 | http://laxmilalmenaria.com/
