Shawn Chang created HUDI-6913:
---------------------------------

             Summary: Can't use default database name
                 Key: HUDI-6913
                 URL: https://issues.apache.org/jira/browse/HUDI-6913
             Project: Apache Hudi
          Issue Type: Bug
            Reporter: Shawn Chang


Hudi can't infer default database name when running hive sync.

 
"hoodie.datasource.hive_sync.database" has a default value of "default" but it 
would use infer function to read "hoodie.database.name" before using default 
value.
 
And "hoodie.database.name" is set to an empty string by default, which is 
considered non-null by java `Option` class so Hudi would continue to use the 
empty string instead of "default" to run hive sync, and cause exceptions below:
 
{code:java}
Caused by: org.apache.hudi.exception.HoodieException: Got runtime exception 
when hive syncing hudi_basic_test_mor51667
  at org.apache.hudi.hive.HiveSyncTool.syncHoodieTable(HiveSyncTool.java:168)
  at 
org.apache.hudi.sync.common.util.SyncUtilHelpers.runHoodieMetaSync(SyncUtilHelpers.java:79)
  ... 90 more
Caused by: java.lang.IllegalArgumentException: databaseName cannot be null or 
empty
  at com.google.common.base.Preconditions.checkArgument(Preconditions.java:92)
  at 
com.amazonaws.glue.catalog.metastore.GlueMetastoreClientDelegate.tableExists(GlueMetastoreClientDelegate.java:417)
  at 
com.amazonaws.glue.catalog.metastore.AWSCatalogMetastoreClient.tableExists(AWSCatalogMetastoreClient.java:1644)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:498)
  at 
org.apache.hadoop.hive.metastore.HiveMetaStoreClient$SynchronizedHandler.invoke(HiveMetaStoreClient.java:2350)
  at com.sun.proxy.$Proxy89.tableExists(Unknown Source)
  at 
org.apache.hudi.hive.HoodieHiveSyncClient.tableExists(HoodieHiveSyncClient.java:250)
  at org.apache.hudi.hive.HiveSyncTool.syncHoodieTable(HiveSyncTool.java:241)
  at org.apache.hudi.hive.HiveSyncTool.doSync(HiveSyncTool.java:191)
  at org.apache.hudi.hive.HiveSyncTool.syncHoodieTable(HiveSyncTool.java:165) 
{code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to