@@ -19,8 +19,6 @@ package org.apache.spark.sql.hive.thriftserver
1919
2020import java .io .File
2121import java .net .URL
22- import java .nio .charset .StandardCharsets
23- import java .nio .file .{Files , Paths }
2422import java .sql .{Date , DriverManager , Statement }
2523
2624import scala .collection .mutable .ArrayBuffer
@@ -29,6 +27,8 @@ import scala.concurrent.{Await, Promise}
2927import scala .sys .process .{Process , ProcessLogger }
3028import scala .util .{Random , Try }
3129
30+ import com .google .common .base .Charsets
31+ import com .google .common .io .Files
3232import org .apache .hadoop .hive .conf .HiveConf .ConfVars
3333import org .apache .hive .jdbc .HiveDriver
3434import org .apache .hive .service .auth .PlainSaslHelper
@@ -441,13 +441,14 @@ abstract class HiveThriftServer2Test extends SparkFunSuite with BeforeAndAfterAl
441441 val tempLog4jConf = Utils .createTempDir().getCanonicalPath
442442
443443 Files .write(
444- Paths .get(s " $tempLog4jConf/log4j.properties " ),
445444 """ log4j.rootCategory=INFO, console
446445 |log4j.appender.console=org.apache.log4j.ConsoleAppender
447446 |log4j.appender.console.target=System.err
448447 |log4j.appender.console.layout=org.apache.log4j.PatternLayout
449448 |log4j.appender.console.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{1}: %m%n
450- """ .stripMargin.getBytes(StandardCharsets .UTF_8 ))
449+ """ .stripMargin,
450+ new File (s " $tempLog4jConf/log4j.properties " ),
451+ Charsets .UTF_8 )
451452
452453 tempLog4jConf + File .pathSeparator + sys.props(" java.class.path" )
453454 }
0 commit comments