Skip to content
This repository was archived by the owner on May 9, 2024. It is now read-only.

Commit 5cd6a63

Browse files
lianchengAndrew Or
authored andcommitted
[SQL] [TEST] [MINOR] Follow-up of PR apache#6493, use Guava API to ensure Java 6 friendliness
This is a follow-up of PR apache#6493, which has been reverted in branch-1.4 because it uses Java 7 specific APIs and breaks Java 6 build. This PR replaces those APIs with equivalent Guava ones to ensure Java 6 friendliness. cc andrewor14 pwendell, this should also be back ported to branch-1.4. Author: Cheng Lian <[email protected]> Closes apache#6547 from liancheng/override-log4j and squashes the following commits: c900cfd [Cheng Lian] Addresses Shixiong's comment 72da795 [Cheng Lian] Uses Guava API to ensure Java 6 friendliness
1 parent 89f21f6 commit 5cd6a63

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/HiveThriftServer2Suites.scala

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ package org.apache.spark.sql.hive.thriftserver
1919

2020
import java.io.File
2121
import java.net.URL
22-
import java.nio.charset.StandardCharsets
23-
import java.nio.file.{Files, Paths}
2422
import java.sql.{Date, DriverManager, Statement}
2523

2624
import scala.collection.mutable.ArrayBuffer
@@ -29,6 +27,8 @@ import scala.concurrent.{Await, Promise}
2927
import scala.sys.process.{Process, ProcessLogger}
3028
import scala.util.{Random, Try}
3129

30+
import com.google.common.base.Charsets.UTF_8
31+
import com.google.common.io.Files
3232
import org.apache.hadoop.hive.conf.HiveConf.ConfVars
3333
import org.apache.hive.jdbc.HiveDriver
3434
import 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+
UTF_8)
451452

452453
tempLog4jConf + File.pathSeparator + sys.props("java.class.path")
453454
}

0 commit comments

Comments
 (0)