You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/03/06 16:38:11 UTC

[GitHub] [spark] wangyum commented on a change in pull request #23992: [SPARK-27074][SQL] Refactor HiveClientImpl.runHive

wangyum commented on a change in pull request #23992: [SPARK-27074][SQL] Refactor HiveClientImpl.runHive
URL: https://github.com/apache/spark/pull/23992#discussion_r263028604
 
 

 ##########
 File path: sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveClientImpl.scala
 ##########
 @@ -711,14 +711,26 @@ private[hive] class HiveClientImpl(
   protected def runHive(cmd: String, maxRows: Int = 1000): Seq[String] = withHiveState {
     logDebug(s"Running hiveql '$cmd'")
     if (cmd.toLowerCase(Locale.ROOT).startsWith("set")) { logDebug(s"Changing config: $cmd") }
+
+    def runProcessor(proc: CommandProcessor, tokens: Array[String], cmd_1: String): Seq[String] = {
+      if (state.out != null) {
+        // scalastyle:off println
+        state.out.println(tokens(0) + " " + cmd_1)
+        // scalastyle:on println
+      }
+      Seq(proc.run(cmd_1).getResponseCode.toString)
+    }
+
     try {
       val cmd_trimmed: String = cmd.trim()
       val tokens: Array[String] = cmd_trimmed.split("\\s+")
       // The remainder of the command.
       val cmd_1: String = cmd_trimmed.substring(tokens(0).length()).trim()
       val proc = shim.getCommandProcessor(tokens(0), conf)
       proc match {
-        case driver: Driver =>
+        // HIVE-18238(Hive 3.0.0) changed the close() function return type.
+        // This change is not compatible with the built-in Hive.
+        case driver: Driver if version != hive.v3_1 =>
 
 Review comment:
   Error message:
   ```java
   [info] org.apache.spark.sql.hive.client.VersionsSuite *** ABORTED *** (5 minutes, 8 seconds)
   [info]   java.lang.NoSuchMethodError: org.apache.hadoop.hive.ql.Driver.close()I
   [info]   at org.apache.spark.sql.hive.client.HiveClientImpl.$anonfun$runHive$1(HiveClientImpl.scala:744)
   [info]   at org.apache.spark.sql.hive.client.HiveClientImpl.$anonfun$withHiveState$1(HiveClientImpl.scala:277)
   [info]   at org.apache.spark.sql.hive.client.HiveClientImpl.liftedTree1$1(HiveClientImpl.scala:215)
   [info]   at org.apache.spark.sql.hive.client.HiveClientImpl.retryLocked(HiveClientImpl.scala:214)
   [info]   at org.apache.spark.sql.hive.client.HiveClientImpl.withHiveState(HiveClientImpl.scala:260)
   [info]   at org.apache.spark.sql.hive.client.HiveClientImpl.runHive(HiveClientImpl.scala:712)
   [info]   at org.apache.spark.sql.hive.client.HiveClientImpl.runSqlHive(HiveClientImpl.scala:702)
   [info]   at org.apache.spark.sql.hive.client.VersionsSuite.$anonfun$new$64(VersionsSuite.scala:591)
   ```

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org