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/09/01 00:22:29 UTC
[GitHub] [hudi] yanghua commented on a change in pull request #1968: [HUDI-1192] Make create hive database automatically configurable
yanghua commented on a change in pull request #1968:
URL: https://github.com/apache/hudi/pull/1968#discussion_r480492617
##########
File path: hudi-sync/hudi-hive-sync/src/main/java/org/apache/hudi/hive/HiveSyncTool.java
##########
@@ -117,11 +117,13 @@ private void syncHoodieTable(String tableName, boolean useRealtimeInputFormat) {
boolean tableExists = hoodieHiveClient.doesTableExist(tableName);
// check if the database exists else create it
- try {
- hoodieHiveClient.updateHiveSQL("create database if not exists " + cfg.databaseName);
- } catch (Exception e) {
- // this is harmless since table creation will fail anyways, creation of DB is needed for in-memory testing
- LOG.warn("Unable to create database", e);
+ if (cfg.enableCreateDatabase) {
+ try {
+ hoodieHiveClient.updateHiveSQL("create database if not exists " + cfg.databaseName);
Review comment:
Yes, I have discussed with @liujinhui1994 off-line about this issue and asked him to find a way to check whether the database exists or not.
----------------------------------------------------------------
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