You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2020/08/25 22:02:37 UTC

[GitHub] [hudi] zhedoubushishi commented on a change in pull request #1975: [HUDI-1194][WIP] Reorganize HoodieHiveClient based on the way to call Hive API

zhedoubushishi commented on a change in pull request #1975:
URL: https://github.com/apache/hudi/pull/1975#discussion_r476780680



##########
File path: hudi-spark/src/main/scala/org/apache/hudi/DataSourceOptions.scala
##########
@@ -303,8 +305,28 @@ object DataSourceWriteOptions {
   val DEFAULT_HIVE_PARTITION_EXTRACTOR_CLASS_OPT_VAL = classOf[SlashEncodedDayPartitionValueExtractor].getCanonicalName
   val DEFAULT_HIVE_ASSUME_DATE_PARTITION_OPT_VAL = "false"
   val DEFAULT_USE_PRE_APACHE_INPUT_FORMAT_OPT_VAL = "false"
+  val DEFAULT_HIVE_CLIENT_CLASS_OPT_VAL = classOf[HoodieHiveJDBCClient].getCanonicalName
+
+  @deprecated
+  val HIVE_USE_JDBC_OPT_KEY = "hoodie.datasource.hive_sync.use_jdbc"
+  @deprecated
   val DEFAULT_HIVE_USE_JDBC_OPT_VAL = "true"
 
+  def translateUseJDBCToHiveClientClass(optParams: Map[String, String]) : Map[String, String] = {
+    if (optParams.contains(HIVE_USE_JDBC_OPT_KEY) && !optParams.contains(HIVE_CLIENT_CLASS_OPT_KEY)) {
+      log.warn(HIVE_USE_JDBC_OPT_KEY + " is deprecated and will be removed in a later release; Please use " + HIVE_CLIENT_CLASS_OPT_KEY)
+      if (optParams(HIVE_USE_JDBC_OPT_KEY).equals("true")) {
+        optParams ++ Map(HIVE_CLIENT_CLASS_OPT_KEY -> DEFAULT_HIVE_CLIENT_CLASS_OPT_VAL)
+      } else if (optParams(HIVE_USE_JDBC_OPT_KEY).equals("false")) {
+        optParams ++ Map(HIVE_CLIENT_CLASS_OPT_KEY -> classOf[HoodieHiveDriverClient].getCanonicalName)

Review comment:
       Sure. Here I just want to keep it the same behavior as before. Will add a comment.




----------------------------------------------------------------
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