HyukjinKwon commented on a change in pull request #25335: 
[SPARK-28601][CORE][SQL] Use StandardCharsets.UTF_8 instead of "UTF-8" string 
representation, and get rid of UnsupportedEncodingException
URL: https://github.com/apache/spark/pull/25335#discussion_r310364108
 
 

 ##########
 File path: 
sql/hive-thriftserver/v2.3.5/src/main/java/org/apache/hive/service/cli/operation/HiveCommandOperation.java
 ##########
 @@ -69,16 +71,16 @@ private void setupSessionIO(SessionState sessionState) {
       LOG.info("Putting temp output to file " + 
sessionState.getTmpOutputFile().toString());
       sessionState.in = null; // hive server's session input stream is not used
       // open a per-session file in auto-flush mode for writing temp results
-      sessionState.out = new PrintStream(new 
FileOutputStream(sessionState.getTmpOutputFile()), true, "UTF-8");
+      sessionState.out = new PrintStream(new 
FileOutputStream(sessionState.getTmpOutputFile()), true, UTF_8.name());
       // TODO: for hadoop jobs, progress is printed out to session.err,
       // we should find a way to feed back job progress to client
-      sessionState.err = new PrintStream(System.err, true, "UTF-8");
+      sessionState.err = new PrintStream(System.err, true, UTF_8.name());
     } catch (IOException e) {
       LOG.error("Error in creating temp output file ", e);
       try {
         sessionState.in = null;
-        sessionState.out = new PrintStream(System.out, true, "UTF-8");
-        sessionState.err = new PrintStream(System.err, true, "UTF-8");
+        sessionState.out = new PrintStream(System.out, true, UTF_8.name());
+        sessionState.err = new PrintStream(System.err, true, UTF_8.name());
 
 Review comment:
   I think he meant hadoop 3.2 due to this code path. Actually lately Yuming 
added a way to use hadoop 3.2 profile in PR builder as of 
https://github.com/apache/spark/pull/24045
   It doesn't look quite likely hadoop 3.2 build will fail because of this 
change though.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to