You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "James Violette (JIRA)" <ji...@apache.org> on 2014/02/18 23:47:22 UTC

[jira] [Updated] (PHOENIX-53) CSV loader fails on empty line

     [ https://issues.apache.org/jira/browse/PHOENIX-53?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

James Violette updated PHOENIX-53:
----------------------------------

    Attachment: incubator-phoenix-csv-commons.patch

This file incorporates the Apache commons-csv library in the CSVCommonsLoader, and called from PhoenixRuntime.

> CSV loader fails on empty line
> ------------------------------
>
>                 Key: PHOENIX-53
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-53
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 2.2.3
>            Reporter: James Violette
>              Labels: patch
>             Fix For: 2.2.3
>
>         Attachments: incubator-phoenix-csv-commons.patch
>
>
> in org.apache.phoenix.util.CSVLoader, the upsert fails if it encounters an empty line.  This occurs if all lines end with the new line character and the reader returns an empty line at the end.
> A fix is to add a guard while reading the next line.
> 	public void upsert(CSVReader reader) throws Exception {
>    ...
>     		while ((nextLine = reader.readNext()) != null) {
>     			if (nextLine.length==0) {
>     				continue;
>     			}



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Re: [jira] [Updated] (PHOENIX-53) CSV loader fails on empty line

Posted by James Taylor <ja...@apache.org>.
Thanks for the patch, James. I like the idea - looks like JIRA is down at
the moment, so I can't take a look yet. Does the Apache commons-csv library
support custom delimiters? Any reason why the scripts can't be adapted to
the new library?

Thanks,
James


On Tue, Feb 18, 2014 at 2:47 PM, James Violette (JIRA) <ji...@apache.org>wrote:

>
>      [
> https://issues.apache.org/jira/browse/PHOENIX-53?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel]
>
> James Violette updated PHOENIX-53:
> ----------------------------------
>
>     Attachment: incubator-phoenix-csv-commons.patch
>
> This file incorporates the Apache commons-csv library in the
> CSVCommonsLoader, and called from PhoenixRuntime.
>
> > CSV loader fails on empty line
> > ------------------------------
> >
> >                 Key: PHOENIX-53
> >                 URL: https://issues.apache.org/jira/browse/PHOENIX-53
> >             Project: Phoenix
> >          Issue Type: Bug
> >    Affects Versions: 2.2.3
> >            Reporter: James Violette
> >              Labels: patch
> >             Fix For: 2.2.3
> >
> >         Attachments: incubator-phoenix-csv-commons.patch
> >
> >
> > in org.apache.phoenix.util.CSVLoader, the upsert fails if it encounters
> an empty line.  This occurs if all lines end with the new line character
> and the reader returns an empty line at the end.
> > A fix is to add a guard while reading the next line.
> >       public void upsert(CSVReader reader) throws Exception {
> >    ...
> >               while ((nextLine = reader.readNext()) != null) {
> >                       if (nextLine.length==0) {
> >                               continue;
> >                       }
>
>
>
> --
> This message was sent by Atlassian JIRA
> (v6.1.5#6160)
>