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 Taylor (JIRA)" <ji...@apache.org> on 2014/03/01 11:06:19 UTC

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

    [ https://issues.apache.org/jira/browse/PHOENIX-53?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13917007#comment-13917007 ] 

James Taylor commented on PHOENIX-53:
-------------------------------------

Thanks for the patch, [~jviolette123], but I'm getting errors when I try to apply it. If I remove the /dev/null lines, I get closer, but it looks like you need to get the latest on master and regenerate the diff. How are you generating the diff, btw? Are you using git diff?

fatal: git apply: bad git-diff - expected /dev/null on line 1368
jtaylor-ltm3:incubator-phoenix jtaylor$ git apply patch.diff
patch.diff:13: trailing whitespace.
	<dependency>
patch.diff:14: trailing whitespace.
	    <groupId>org.apache.commons.csv</groupId>
patch.diff:15: trailing whitespace.
	    <artifactId>commons-csv</artifactId>
patch.diff:16: trailing whitespace.
	    <version>1.0-SNAPSHOT</version>
patch.diff:17: trailing whitespace.
	    <scope>system</scope>
error: patch failed: phoenix-core/pom.xml:197
error: phoenix-core/pom.xml: patch does not apply
error: patch failed: phoenix-core/src/main/java/org/apache/phoenix/map/reduce/MapReduceJob.java:32
error: phoenix-core/src/main/java/org/apache/phoenix/map/reduce/MapReduceJob.java: patch does not apply
error: patch failed: phoenix-core/src/main/java/org/apache/phoenix/util/CSVLoader.java:1
error: phoenix-core/src/main/java/org/apache/phoenix/util/CSVLoader.java: patch does not apply
error: patch failed: phoenix-core/src/main/java/org/apache/phoenix/util/PhoenixRuntime.java:144
error: phoenix-core/src/main/java/org/apache/phoenix/util/PhoenixRuntime.java: patch does not apply
error: patch failed: phoenix-core/src/test/java/org/apache/phoenix/end2end/CSVLoaderTest.java:1
error: phoenix-core/src/test/java/org/apache/phoenix/end2end/CSVLoaderTest.java: patch does not apply


> 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, 3.0.0
>            Reporter: James Violette
>              Labels: patch
>             Fix For: 2.2.3, 3.0.0
>
>         Attachments: commons-csv-1.0-SNAPSHOT.jar, incubator-phoenix-commons-csv-rev1.patch, incubator-phoenix-commons-csv-rev2-3.0.0.patch, 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)