These are chat archives for nrinaudo/kantan.csv

11th
Oct 2017
gthernandez
@gthernandez
Oct 11 2017 16:41
Howdy Nicolas. Im getting an error randomly when parsing a CSV. I dont know if its a bug in Kantan, or if it may be a timing issue on my side (buffered stream does not hand data to internal reader fast enough?)
OutOfBounds: 0 is not a valid index
Just want to know if you have seen the error before. It very well could be my csv has an unfinished quote somewhere in it.
gthernandez
@gthernandez
Oct 11 2017 16:55
Ah, found the bug. Figures after hitting my head against the wall for the last four days, as soon as I give up and login to this I find whats going wrong.
The issue is that when resource iterator is parsing through and creating rows with internal reader, it takes the entire rest of the file as one of the rows.
gthernandez
@gthernandez
Oct 11 2017 17:04
Ok, The line its catching on might be the issue,
The cell its catching on starts with a double quote, but kantan isnt ending the cell at the end of the "
I think its cause its like
"words"/,
Does Kantan require quoted cells to end like: ",
Nicolas Rinaudo
@nrinaudo
Oct 11 2017 17:29
I'd have to check, but I'm pretty sure the csv specifications require that
That being said, it's possible that one of the alternate engines used by kantan.csv deal with this weird mutation - you can have a look at the documentation on how do use jackson or other third party csv parsing libraries
gthernandez
@gthernandez
Oct 11 2017 18:23
Ok. You have great documentation by the way. I only picked up Scala and your code last wednesday. Its been great.
Nicolas Rinaudo
@nrinaudo
Oct 11 2017 19:50
wow, thanks :)
do let me know if you manage to work your issue out. From the looks of it you're getting weird CSV data and I'm pretty sure the default CSV reader can't deal with it, but we can swap it out for another one