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/21 00:57:30 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_r474348589
##########
File path: hudi-sync/hudi-hive-sync/src/main/java/org/apache/hudi/hive/HiveSyncConfig.java
##########
@@ -71,6 +71,9 @@
@Parameter(names = {"--use-jdbc"}, description = "Hive jdbc connect url")
public Boolean useJdbc = true;
+ @Parameter(names = {"--enable-create-database"}, description = "Create hive database")
Review comment:
"Create hive database" -> "Enable create hive database"
##########
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:
I still have a question here. If we do not allow initializing hive database. Or if the database does not exist. Would affect the subsequent business logic?
----------------------------------------------------------------
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