ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From niti...@apache.org
Subject ambari git commit: AMBARI-20990 : writing query properly to hdfs file for handling unicode characters. (nitirajrathore)
Date Fri, 12 May 2017 03:25:05 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 68704077b -> 57a6d15f6


AMBARI-20990 : writing query properly to hdfs file for handling unicode characters. (nitirajrathore)


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

Branch: refs/heads/branch-2.5
Commit: 57a6d15f6b1a140f062d15da75a6acaab1ccc77c
Parents: 6870407
Author: Nitiraj Singh Rathore <nitiraj.rathore@gmail.com>
Authored: Fri May 12 08:52:02 2017 +0530
Committer: Nitiraj Singh Rathore <nitiraj.rathore@gmail.com>
Committed: Fri May 12 08:52:02 2017 +0530

----------------------------------------------------------------------
 .../ambari/view/hive2/resources/files/FileService.java       | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/57a6d15f/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/files/FileService.java
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/files/FileService.java
b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/files/FileService.java
index 64880bb..88f8df1 100644
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/files/FileService.java
+++ b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/files/FileService.java
@@ -185,9 +185,9 @@ public class FileService extends BaseService {
     try {
       filePath = sanitizeFilePath(filePath);
       LOG.debug("Rewriting file " + filePath);
-      FSDataOutputStream output = getSharedObjectsFactory().getHdfsApi().create(filePath,
true);
-      output.writeBytes(request.file.getFileContent());
-      output.close();
+      HdfsApi hdfsApi = getSharedObjectsFactory().getHdfsApi();
+      HdfsUtil.putStringToFile(hdfsApi, filePath,
+          request.file.getFileContent());
       return Response.status(204).build();
     } catch (WebApplicationException ex) {
       throw ex;
@@ -209,7 +209,7 @@ public class FileService extends BaseService {
       try {
         FSDataOutputStream output = getSharedObjectsFactory().getHdfsApi().create(request.file.getFilePath(),
false);
         if (request.file.getFileContent() != null) {
-          output.writeBytes(request.file.getFileContent());
+          output.write(request.file.getFileContent().getBytes());
         }
         output.close();
       } catch (FileAlreadyExistsException ex) {


Mime
View raw message