pig-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From da...@apache.org
Subject svn commit: r1766169 - in /pig/trunk: CHANGES.txt contrib/piggybank/java/src/main/java/org/apache/pig/piggybank/storage/CSVExcelStorage.java contrib/piggybank/java/src/test/java/org/apache/pig/piggybank/test/storage/TestCSVExcelStorage.java
Date Sat, 22 Oct 2016 00:27:46 GMT
Author: daijy
Date: Sat Oct 22 00:27:46 2016
New Revision: 1766169

URL: http://svn.apache.org/viewvc?rev=1766169&view=rev
Log:
PIG-5045: CSVExcelStorage Load: A Quoted Field with a Single Escaped Quote """" Becomes ""
This should become " instead

Modified:
    pig/trunk/CHANGES.txt
    pig/trunk/contrib/piggybank/java/src/main/java/org/apache/pig/piggybank/storage/CSVExcelStorage.java
    pig/trunk/contrib/piggybank/java/src/test/java/org/apache/pig/piggybank/test/storage/TestCSVExcelStorage.java

Modified: pig/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/pig/trunk/CHANGES.txt?rev=1766169&r1=1766168&r2=1766169&view=diff
==============================================================================
--- pig/trunk/CHANGES.txt (original)
+++ pig/trunk/CHANGES.txt Sat Oct 22 00:27:46 2016
@@ -48,6 +48,9 @@ OPTIMIZATIONS
  
 BUG FIXES
 
+PIG-5045: CSVExcelStorage Load: A Quoted Field with a Single Escaped Quote """" Becomes ""
This should become " instead
+  (szita via daijy)
+
 PIG-5026: Remove src/META-INF/services/org.apache.hadoop.mapreduce.protocol.ClientProtocolProvider
(nkollar via daijy)
 
 PIG-5041: RoundRobinPartitioner is not deterministic when order of input records change (rohini)

Modified: pig/trunk/contrib/piggybank/java/src/main/java/org/apache/pig/piggybank/storage/CSVExcelStorage.java
URL: http://svn.apache.org/viewvc/pig/trunk/contrib/piggybank/java/src/main/java/org/apache/pig/piggybank/storage/CSVExcelStorage.java?rev=1766169&r1=1766168&r2=1766169&view=diff
==============================================================================
--- pig/trunk/contrib/piggybank/java/src/main/java/org/apache/pig/piggybank/storage/CSVExcelStorage.java
(original)
+++ pig/trunk/contrib/piggybank/java/src/main/java/org/apache/pig/piggybank/storage/CSVExcelStorage.java
Sat Oct 22 00:27:46 2016
@@ -580,7 +580,7 @@ public class CSVExcelStorage extends Pig
                 }
             } else if (b == DOUBLE_QUOTE) {
                 // Does a double quote immediately follow?                  
-                if ((i < recordLen-1) && (buf[i+1] == DOUBLE_QUOTE)) {
+                if ((i < recordLen-1) && (buf[i+1] == DOUBLE_QUOTE) &&
(fieldBuffer.position() != 0)) {
                     fieldBuffer.put(b);
                     nextTupleSkipChar = true;
                     continue;

Modified: pig/trunk/contrib/piggybank/java/src/test/java/org/apache/pig/piggybank/test/storage/TestCSVExcelStorage.java
URL: http://svn.apache.org/viewvc/pig/trunk/contrib/piggybank/java/src/test/java/org/apache/pig/piggybank/test/storage/TestCSVExcelStorage.java?rev=1766169&r1=1766168&r2=1766169&view=diff
==============================================================================
--- pig/trunk/contrib/piggybank/java/src/test/java/org/apache/pig/piggybank/test/storage/TestCSVExcelStorage.java
(original)
+++ pig/trunk/contrib/piggybank/java/src/test/java/org/apache/pig/piggybank/test/storage/TestCSVExcelStorage.java
Sat Oct 22 00:27:46 2016
@@ -218,7 +218,7 @@ public class TestCSVExcelStorage  {
         Util.registerMultiLineQuery(pig, script);
         Iterator<Tuple> it = pig.openIterator("a");
         Assert.assertEquals(Util.createTuple(new String[] {"foo,\"bar\",baz"}), it.next());
-        Assert.assertEquals(Util.createTuple(new String[] {"\"\"\"\""}), it.next());
+        Assert.assertEquals(Util.createTuple(new String[] {"\"\"\""}), it.next());
     }
 
     // Handle newlines in fields



Mime
View raw message