CTTY opened a new pull request, #9816:
URL: https://github.com/apache/hudi/pull/9816
### Change Logs
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 and by
mistake, 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:
```
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)
```
### Impact
_Describe any public API or user-facing feature change or any performance
impact._
### Risk level (write none, low medium or high below)
_If medium or high, explain what verification was done to mitigate the
risks._
### Documentation Update
_Describe any necessary documentation update if there is any new feature,
config, or user-facing change_
- _The config description must be updated if new configs are added or the
default value of the configs are changed_
- _Any new feature or user-facing change requires updating the Hudi website.
Please create a Jira ticket, attach the
ticket number here and follow the
[instruction](https://hudi.apache.org/contribute/developer-setup#website) to
make
changes to the website._
### Contributor's checklist
- [ ] Read through [contributor's
guide](https://hudi.apache.org/contribute/how-to-contribute)
- [ ] Change Logs and Impact were stated clearly
- [ ] Adequate tests were added if applicable
- [ ] CI passed
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]