Author: olga Date: Tue Oct 14 16:50:40 2008 New Revision: 704740 URL: http://svn.apache.org/viewvc?rev=704740&view=rev Log: PIG-494: invlaid UTF-8 handling in PigStorage
Modified: incubator/pig/branches/types/CHANGES.txt incubator/pig/branches/types/src/org/apache/pig/builtin/PigStorage.java incubator/pig/branches/types/src/org/apache/pig/builtin/Utf8StorageConverter.java Modified: incubator/pig/branches/types/CHANGES.txt URL: http://svn.apache.org/viewvc/incubator/pig/branches/types/CHANGES.txt?rev=704740&r1=704739&r2=704740&view=diff ============================================================================== --- incubator/pig/branches/types/CHANGES.txt (original) +++ incubator/pig/branches/types/CHANGES.txt Tue Oct 14 16:50:40 2008 @@ -284,3 +284,5 @@ PIG-475: missing heartbeats (shravanmn via olgan) PIG-468: make determine Schema work for BinStorage (pradeepk via olgan) + + PIG-494: invalid handling of UTF-8 data in PigStorage (pradeepk via olgan) Modified: incubator/pig/branches/types/src/org/apache/pig/builtin/PigStorage.java URL: http://svn.apache.org/viewvc/incubator/pig/branches/types/src/org/apache/pig/builtin/PigStorage.java?rev=704740&r1=704739&r2=704740&view=diff ============================================================================== --- incubator/pig/branches/types/src/org/apache/pig/builtin/PigStorage.java (original) +++ incubator/pig/branches/types/src/org/apache/pig/builtin/PigStorage.java Tue Oct 14 16:50:40 2008 @@ -179,7 +179,7 @@ case DataType.CHARARRAY: // oddly enough, writeBytes writes a string - mOut.write(((String)field).getBytes()); + mOut.write(((String)field).getBytes("UTF-8")); break; case DataType.MAP: Modified: incubator/pig/branches/types/src/org/apache/pig/builtin/Utf8StorageConverter.java URL: http://svn.apache.org/viewvc/incubator/pig/branches/types/src/org/apache/pig/builtin/Utf8StorageConverter.java?rev=704740&r1=704739&r2=704740&view=diff ============================================================================== --- incubator/pig/branches/types/src/org/apache/pig/builtin/Utf8StorageConverter.java (original) +++ incubator/pig/branches/types/src/org/apache/pig/builtin/Utf8StorageConverter.java Tue Oct 14 16:50:40 2008 @@ -85,7 +85,7 @@ public String bytesToCharArray(byte[] b) throws IOException { if(b == null) return null; - return new String(b); + return new String(b, "UTF-8"); } public Double bytesToDouble(byte[] b) throws IOException {