You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "CTTY (via GitHub)" <gi...@apache.org> on 2023/10/03 02:13:43 UTC
[PR] [HUDI-6913] Set default database name correctly [hudi]
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: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [HUDI-6913] Set default database name correctly [hudi]
Posted by "bvaradar (via GitHub)" <gi...@apache.org>.
bvaradar merged PR #9816:
URL: https://github.com/apache/hudi/pull/9816
--
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: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [HUDI-6913] Set default database name correctly [hudi]
Posted by "CTTY (via GitHub)" <gi...@apache.org>.
CTTY commented on PR #9816:
URL: https://github.com/apache/hudi/pull/9816#issuecomment-1744120561
Hi @danny0405 , here is a detailed explanation:
1. There are two database configs: `hoodie.datasource.hive_sync.database` and `hoodie.database.name`, `hoodie.datasource.hive_sync.database`'s infer function would use `hoodie.database.name` to infer its value
2. `hoodie.database.name` accepts empty values and `hoodie.datasource.hive_sync.database` doesn't
3. This [LOC](https://github.com/apache/hudi/blob/b77286f176f1a606c807139042c2bd1f56883016/hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/hudi/HoodieSparkSqlWriter.scala#L184) would set `hoodie.database.name` to empty by default, and it would be persisted to `hoodie.properties` file.
4. Once the empty `hoodie.database.name` is persisted to table config, `hoodie.datasource.hive_sync.database` would always use the persisted empty value as its default value due to the infer function, which is not acceptable to hive metastore
The root cause for this issue is that there is discrepency between `hoodie.datasource.hive_sync.database` and `hoodie.database.name`
--
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: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [HUDI-6913] Set default database name correctly [hudi]
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #9816:
URL: https://github.com/apache/hudi/pull/9816#issuecomment-1744273184
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "daf35cf0842bd3a5023236681e9e16be4f25c795",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "daf35cf0842bd3a5023236681e9e16be4f25c795",
"triggerType" : "PUSH"
}, {
"hash" : "aca621efd5d0cea2c9a706b801cc0ce42de55dbb",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=20200",
"triggerID" : "aca621efd5d0cea2c9a706b801cc0ce42de55dbb",
"triggerType" : "PUSH"
}, {
"hash" : "2aae93ee3acfe7983f00d24dd23a4734544711a4",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=20201",
"triggerID" : "2aae93ee3acfe7983f00d24dd23a4734544711a4",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* daf35cf0842bd3a5023236681e9e16be4f25c795 UNKNOWN
* 2aae93ee3acfe7983f00d24dd23a4734544711a4 Azure: [SUCCESS](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=20201)
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
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: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [HUDI-6913] Set default database name correctly [hudi]
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #9816:
URL: https://github.com/apache/hudi/pull/9816#issuecomment-1744066014
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "daf35cf0842bd3a5023236681e9e16be4f25c795",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "daf35cf0842bd3a5023236681e9e16be4f25c795",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* daf35cf0842bd3a5023236681e9e16be4f25c795 UNKNOWN
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
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: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [HUDI-6913] Set default database name correctly [hudi]
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #9816:
URL: https://github.com/apache/hudi/pull/9816#issuecomment-1744102623
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "daf35cf0842bd3a5023236681e9e16be4f25c795",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "daf35cf0842bd3a5023236681e9e16be4f25c795",
"triggerType" : "PUSH"
}, {
"hash" : "aca621efd5d0cea2c9a706b801cc0ce42de55dbb",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=20200",
"triggerID" : "aca621efd5d0cea2c9a706b801cc0ce42de55dbb",
"triggerType" : "PUSH"
}, {
"hash" : "2aae93ee3acfe7983f00d24dd23a4734544711a4",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "2aae93ee3acfe7983f00d24dd23a4734544711a4",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* daf35cf0842bd3a5023236681e9e16be4f25c795 UNKNOWN
* aca621efd5d0cea2c9a706b801cc0ce42de55dbb Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=20200)
* 2aae93ee3acfe7983f00d24dd23a4734544711a4 UNKNOWN
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
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: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [HUDI-6913] Set default database name correctly [hudi]
Posted by "danny0405 (via GitHub)" <gi...@apache.org>.
danny0405 commented on PR #9816:
URL: https://github.com/apache/hudi/pull/9816#issuecomment-1744086972
> And hoodie.database.name is set to an empty string by default and by mistake
In which case Hudi will do this replacement with empty string or null?
--
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: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [HUDI-6913] Set default database name correctly [hudi]
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #9816:
URL: https://github.com/apache/hudi/pull/9816#issuecomment-1744108645
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "daf35cf0842bd3a5023236681e9e16be4f25c795",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "daf35cf0842bd3a5023236681e9e16be4f25c795",
"triggerType" : "PUSH"
}, {
"hash" : "aca621efd5d0cea2c9a706b801cc0ce42de55dbb",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=20200",
"triggerID" : "aca621efd5d0cea2c9a706b801cc0ce42de55dbb",
"triggerType" : "PUSH"
}, {
"hash" : "2aae93ee3acfe7983f00d24dd23a4734544711a4",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=20201",
"triggerID" : "2aae93ee3acfe7983f00d24dd23a4734544711a4",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* daf35cf0842bd3a5023236681e9e16be4f25c795 UNKNOWN
* aca621efd5d0cea2c9a706b801cc0ce42de55dbb Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=20200)
* 2aae93ee3acfe7983f00d24dd23a4734544711a4 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=20201)
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
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: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [HUDI-6913] Set default database name correctly [hudi]
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #9816:
URL: https://github.com/apache/hudi/pull/9816#issuecomment-1744096840
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "daf35cf0842bd3a5023236681e9e16be4f25c795",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "daf35cf0842bd3a5023236681e9e16be4f25c795",
"triggerType" : "PUSH"
}, {
"hash" : "aca621efd5d0cea2c9a706b801cc0ce42de55dbb",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "aca621efd5d0cea2c9a706b801cc0ce42de55dbb",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* daf35cf0842bd3a5023236681e9e16be4f25c795 UNKNOWN
* aca621efd5d0cea2c9a706b801cc0ce42de55dbb UNKNOWN
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot run azure` re-run the last Azure build
</details>
--
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: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org