You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "Vinay (Jira)" <ji...@apache.org> on 2021/06/05 07:10:00 UTC
[jira] [Commented] (HUDI-1942) HIVE_AUTO_CREATE_DATABASE_OPT_KEY
This should default to true when Hudi synchronizes Hive
[ https://issues.apache.org/jira/browse/HUDI-1942?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17357776#comment-17357776 ]
Vinay commented on HUDI-1942:
-----------------------------
Tried to test code snippet locally
{code:java}
scala> var parameters = Map("hoodie.datasource.hive_sync.auto_create_database" -> "true")
scala> val a = parameters.get("hoodie.datasource.hive_sync.auto_create_database").exists(r => r.toBoolean)
scala> print(a)
true
{code}
This means the only way we will get false value if parameters map does not contain HIVE_AUTO_CREATE_DATABASE_OPT_KEY , one way is to use parameters.getOrElse like we use in `DataSourceUtils.buildHiveSyncConfig` method - https://github.com/apache/hudi/blob/master/hudi-spark-datasource/hudi-spark-common/src/main/java/org/apache/hudi/DataSourceUtils.java#L271
> HIVE_AUTO_CREATE_DATABASE_OPT_KEY This should default to true when Hudi synchronizes Hive
> -----------------------------------------------------------------------------------------
>
> Key: HUDI-1942
> URL: https://issues.apache.org/jira/browse/HUDI-1942
> Project: Apache Hudi
> Issue Type: Bug
> Components: newbie
> Reporter: yao.zhou
> Assignee: Vinay
> Priority: Major
> Labels: easy-fix
> Fix For: 0.8.0, 0.9.0
>
>
> HIVE_AUTO_CREATE_DATABASE_OPT_KEY = "hoodie.datasource.hive_sync.auto_create_database"
> DEFAULT_HIVE_AUTO_CREATE_DATABASE_OPT_KEY = "true"
> in HoodieSparkSqlWriter.buildSyncConfig
> hiveSyncConfig.autoCreateDatabase = parameters.get(HIVE_AUTO_CREATE_DATABASE_OPT_KEY).exists(r => r.toBoolean)
> * This method sets the parameter to false
--
This message was sent by Atlassian Jira
(v8.3.4#803005)