Github user gatorsmile commented on a diff in the pull request: https://github.com/apache/spark/pull/16787#discussion_r99460986 --- Diff: sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveClientImpl.scala --- @@ -778,6 +780,22 @@ private[hive] class HiveClientImpl( } + +} + +private[hive] object HiveClientImpl { + private lazy val shimDefault = IsolatedClientLoader.hiveVersion( + HiveUtils.hiveExecutionVersion) match { + case hive.v12 => new Shim_v0_12() + case hive.v13 => new Shim_v0_13() + case hive.v14 => new Shim_v0_14() + case hive.v1_0 => new Shim_v1_0() + case hive.v1_1 => new Shim_v1_1() + case hive.v1_2 => new Shim_v1_2() + } + + private lazy val hiveConf = new HiveConf(classOf[SessionState]) --- End diff -- Something like this? ```Scala def toHiveTable(table: CatalogTable, conf: Option[HiveConf] = None, shim: Shim = shimDefault) ... conf.foreach(c => hiveTable.setOwner(c.getUser)) ```
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org