ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pallav...@apache.org
Subject ambari git commit: AMBARI-18284. Ambari PigView stores the script in HDFS in non UTF-8 format (Jay SenSharma via pallavkul)
Date Tue, 13 Sep 2016 15:52:50 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 fbea1f09b -> fa6e1792f


AMBARI-18284. Ambari PigView stores the script in HDFS in non UTF-8 format (Jay SenSharma
via pallavkul)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/fa6e1792
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/fa6e1792
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/fa6e1792

Branch: refs/heads/branch-2.5
Commit: fa6e1792f051500bef20b367bcb9614aa2f8e3c8
Parents: fbea1f0
Author: Pallav Kulshreshtha <pallav.kul@gmail.com>
Authored: Tue Sep 13 14:14:57 2016 +0530
Committer: Pallav Kulshreshtha <pallav.kul@gmail.com>
Committed: Tue Sep 13 21:21:50 2016 +0530

----------------------------------------------------------------------
 .../org/apache/ambari/view/pig/resources/files/FileService.java  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/fa6e1792/contrib/views/pig/src/main/java/org/apache/ambari/view/pig/resources/files/FileService.java
----------------------------------------------------------------------
diff --git a/contrib/views/pig/src/main/java/org/apache/ambari/view/pig/resources/files/FileService.java
b/contrib/views/pig/src/main/java/org/apache/ambari/view/pig/resources/files/FileService.java
index 9dea2a2..509b20e 100644
--- a/contrib/views/pig/src/main/java/org/apache/ambari/view/pig/resources/files/FileService.java
+++ b/contrib/views/pig/src/main/java/org/apache/ambari/view/pig/resources/files/FileService.java
@@ -164,7 +164,7 @@ public class FileService extends BaseService {
       filePath = sanitizeFilePath(filePath);
       LOG.info("Rewriting file {}", filePath);
       FSDataOutputStream output = getHdfsApi().create(filePath, true);
-      output.writeBytes(request.file.getFileContent());
+      output.write(request.file.getFileContent().getBytes("UTF-8"));
       output.close();
       return Response.status(204).build();
     } catch (WebApplicationException ex) {
@@ -189,7 +189,7 @@ public class FileService extends BaseService {
       try {
         FSDataOutputStream output = getHdfsApi().create(request.file.getFilePath(), false);
         if (request.file.getFileContent() != null) {
-          output.writeBytes(request.file.getFileContent());
+          output.write(request.file.getFileContent().getBytes("UTF-8"));
         }
         output.close();
       } catch (FileAlreadyExistsException ex) {


Mime
View raw message