You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "the-other-tim-brown (via GitHub)" <gi...@apache.org> on 2023/08/28 14:47:07 UTC
[GitHub] [hudi] the-other-tim-brown opened a new pull request, #9561: [HUDI-6763] Optimize collect calls
the-other-tim-brown opened a new pull request, #9561:
URL: https://github.com/apache/hudi/pull/9561
### Change Logs
Updates the code to only call the collect method once if possible.
### Impact
Reduces overhead of generating the commit stats
### Risk level (write none, low medium or high below)
None
### 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
[GitHub] [hudi] danny0405 merged pull request #9561: [HUDI-6763] Optimize collect calls
Posted by "danny0405 (via GitHub)" <gi...@apache.org>.
danny0405 merged PR #9561:
URL: https://github.com/apache/hudi/pull/9561
--
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
[GitHub] [hudi] hudi-bot commented on pull request #9561: [HUDI-6763] Optimize collect calls
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #9561:
URL: https://github.com/apache/hudi/pull/9561#issuecomment-1695858497
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "e25b5976befb314bb8165c0ac460111ef2e76438",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "e25b5976befb314bb8165c0ac460111ef2e76438",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* e25b5976befb314bb8165c0ac460111ef2e76438 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
[GitHub] [hudi] hudi-bot commented on pull request #9561: [HUDI-6763] Optimize collect calls
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #9561:
URL: https://github.com/apache/hudi/pull/9561#issuecomment-1696232409
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "e25b5976befb314bb8165c0ac460111ef2e76438",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=19522",
"triggerID" : "e25b5976befb314bb8165c0ac460111ef2e76438",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* e25b5976befb314bb8165c0ac460111ef2e76438 Azure: [SUCCESS](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=19522)
<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
[GitHub] [hudi] hudi-bot commented on pull request #9561: [HUDI-6763] Optimize collect calls
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #9561:
URL: https://github.com/apache/hudi/pull/9561#issuecomment-1695874220
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "e25b5976befb314bb8165c0ac460111ef2e76438",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=19522",
"triggerID" : "e25b5976befb314bb8165c0ac460111ef2e76438",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* e25b5976befb314bb8165c0ac460111ef2e76438 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=19522)
<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
[GitHub] [hudi] danny0405 commented on a diff in pull request #9561: [HUDI-6763] Optimize collect calls
Posted by "danny0405 (via GitHub)" <gi...@apache.org>.
danny0405 commented on code in PR #9561:
URL: https://github.com/apache/hudi/pull/9561#discussion_r1308112238
##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/table/action/commit/BaseSparkCommitActionExecutor.java:
##########
@@ -286,24 +286,24 @@ protected String getCommitActionType() {
@Override
protected void setCommitMetadata(HoodieWriteMetadata<HoodieData<WriteStatus>> result) {
- result.setCommitMetadata(Option.of(CommitUtils.buildMetadata(result.getWriteStatuses().map(WriteStatus::getStat).collectAsList(),
+ List<HoodieWriteStat> writeStats = result.getWriteStatuses().map(WriteStatus::getStat).collectAsList();
+ result.setWriteStats(writeStats);
+ result.setCommitMetadata(Option.of(CommitUtils.buildMetadata(writeStats,
result.getPartitionToReplaceFileIds(),
extraMetadata, operationType, getSchemaToStoreInCommit(), getCommitActionType())));
}
@Override
protected void commit(Option<Map<String, String>> extraMetadata, HoodieWriteMetadata<HoodieData<WriteStatus>> result) {
Review Comment:
Should be a mistake, the extraMetadata is kind of hacky in the first place.
--
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
[GitHub] [hudi] nsivabalan commented on a diff in pull request #9561: [HUDI-6763] Optimize collect calls
Posted by "nsivabalan (via GitHub)" <gi...@apache.org>.
nsivabalan commented on code in PR #9561:
URL: https://github.com/apache/hudi/pull/9561#discussion_r1310896302
##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/table/action/commit/BaseSparkCommitActionExecutor.java:
##########
@@ -286,24 +286,24 @@ protected String getCommitActionType() {
@Override
protected void setCommitMetadata(HoodieWriteMetadata<HoodieData<WriteStatus>> result) {
- result.setCommitMetadata(Option.of(CommitUtils.buildMetadata(result.getWriteStatuses().map(WriteStatus::getStat).collectAsList(),
+ List<HoodieWriteStat> writeStats = result.getWriteStatuses().map(WriteStatus::getStat).collectAsList();
+ result.setWriteStats(writeStats);
+ result.setCommitMetadata(Option.of(CommitUtils.buildMetadata(writeStats,
result.getPartitionToReplaceFileIds(),
extraMetadata, operationType, getSchemaToStoreInCommit(), getCommitActionType())));
}
@Override
protected void commit(Option<Map<String, String>> extraMetadata, HoodieWriteMetadata<HoodieData<WriteStatus>> result) {
Review Comment:
yeah, I don't see a need for it.
btw, in general, there are two code paths which we have been punting to refactor and fix it propery.
auto cmmit enabled and auto commit disabled.
this is auto commit enabled code path.
both deltastreamer and spark datasource writer goes thru auto commit disabled code path.
just fyi
--
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
[GitHub] [hudi] the-other-tim-brown commented on a diff in pull request #9561: [HUDI-6763] Optimize collect calls
Posted by "the-other-tim-brown (via GitHub)" <gi...@apache.org>.
the-other-tim-brown commented on code in PR #9561:
URL: https://github.com/apache/hudi/pull/9561#discussion_r1307528467
##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/table/action/commit/BaseSparkCommitActionExecutor.java:
##########
@@ -286,24 +286,24 @@ protected String getCommitActionType() {
@Override
protected void setCommitMetadata(HoodieWriteMetadata<HoodieData<WriteStatus>> result) {
- result.setCommitMetadata(Option.of(CommitUtils.buildMetadata(result.getWriteStatuses().map(WriteStatus::getStat).collectAsList(),
+ List<HoodieWriteStat> writeStats = result.getWriteStatuses().map(WriteStatus::getStat).collectAsList();
+ result.setWriteStats(writeStats);
+ result.setCommitMetadata(Option.of(CommitUtils.buildMetadata(writeStats,
result.getPartitionToReplaceFileIds(),
extraMetadata, operationType, getSchemaToStoreInCommit(), getCommitActionType())));
}
@Override
protected void commit(Option<Map<String, String>> extraMetadata, HoodieWriteMetadata<HoodieData<WriteStatus>> result) {
Review Comment:
@nsivabalan and @codope I noticed that we don't use `extraMetadata` at all in the method body. Is that intentional?
--
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