@@ -19,8 +19,6 @@ package org.apache.spark.sql.hive.thriftserver
19
19
20
20
import java .io .File
21
21
import java .net .URL
22
- import java .nio .charset .StandardCharsets
23
- import java .nio .file .{Files , Paths }
24
22
import java .sql .{Date , DriverManager , Statement }
25
23
26
24
import scala .collection .mutable .ArrayBuffer
@@ -29,6 +27,8 @@ import scala.concurrent.{Await, Promise}
29
27
import scala .sys .process .{Process , ProcessLogger }
30
28
import scala .util .{Random , Try }
31
29
30
+ import com .google .common .base .Charsets
31
+ import com .google .common .io .Files
32
32
import org .apache .hadoop .hive .conf .HiveConf .ConfVars
33
33
import org .apache .hive .jdbc .HiveDriver
34
34
import org .apache .hive .service .auth .PlainSaslHelper
@@ -441,13 +441,14 @@ abstract class HiveThriftServer2Test extends SparkFunSuite with BeforeAndAfterAl
441
441
val tempLog4jConf = Utils .createTempDir().getCanonicalPath
442
442
443
443
Files .write(
444
- Paths .get(s " $tempLog4jConf/log4j.properties " ),
445
444
""" log4j.rootCategory=INFO, console
446
445
|log4j.appender.console=org.apache.log4j.ConsoleAppender
447
446
|log4j.appender.console.target=System.err
448
447
|log4j.appender.console.layout=org.apache.log4j.PatternLayout
449
448
|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 )
451
452
452
453
tempLog4jConf + File .pathSeparator + sys.props(" java.class.path" )
453
454
}
0 commit comments