lhjzmn commented on a change in pull request #2532:
URL: https://github.com/apache/hudi/pull/2532#discussion_r579925386



##########
File path: 
hudi-sync/hudi-hive-sync/src/main/java/org/apache/hudi/hive/HoodieHiveClient.java
##########
@@ -343,116 +304,48 @@ public boolean doesTableExist(String tableName) {
    */
   public boolean doesDataBaseExist(String databaseName) {
     try {
-      Database database = client.getDatabase(databaseName);
-      if (database != null && databaseName.equals(database.getName())) {
-        return true;
-      }
+      List<String> databases = client.getAllDatabases();
+      return databases.contains(databaseName.toLowerCase());
     } catch (TException e) {
+      LOG.error("Failed to check if database exists " + databaseName, e);
       throw new HoodieHiveSyncException("Failed to check if database exists " 
+ databaseName, e);
     }
-    return false;
   }
 
-  /**
-   * Execute a update in hive metastore with this SQL.
-   *
-   * @param s SQL to execute
-   */
-  public void updateHiveSQL(String s) {
-    if (syncConfig.useJdbc) {
-      Statement stmt = null;
-      try {
-        stmt = connection.createStatement();
-        LOG.info("Executing SQL " + s);
-        stmt.execute(s);
-      } catch (SQLException e) {
-        throw new HoodieHiveSyncException("Failed in executing SQL " + s, e);
-      } finally {
-        closeQuietly(null, stmt);
-      }
-    } else {
-      updateHiveSQLUsingHiveDriver(s);
+  public void createDataBase(String databaseName, String location, String 
description) {

Review comment:
       Yes, this is a problem. I have changed the spelling of Database used by 
Hive synchronization to Database (the second b is lowercase) and resubmit the 
code.




----------------------------------------------------------------
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:
[email protected]


Reply via email to