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 2025/09/23 15:49:11 UTC
[PR] perf: Avoid creating properties objects per row in writers [hudi]
the-other-tim-brown opened a new pull request, #13975:
URL: https://github.com/apache/hudi/pull/13975
### Describe the issue this Pull Request addresses
<!-- Either describe the issue inline here with motivation behind the changes
(or) link to an issue by including `Closes #<issue-number>` for context.
If this PR includes changes to the storage format, public APIs,
or has breaking changes, use `!` (e.g., feat!: ...) -->
The writer paths currently invoke a `new Properties()` per row but the callers tend to already have a `Properties` object present. This leads to unnecessary object creation and can impact the latency of the writes.
### Summary and Changelog
<!-- Short, plain-English summary of what users gain or what changed in behavior.
Followed by a detailed log of all the changes. Highlight if any code was copied. -->
The change simply passes in the properties that are present in the caller or uses the `CollectionUtils.emptyProps()` when the write is called without `Properties` set.
### Impact
<!-- Describe any public API or user-facing feature change or any performance impact. -->
Avoids unnecessary object creation to make writer path leaner.
### Risk Level
<!-- Accepted values: none, low, medium or high. Other than `none`, explain the risk.
If medium or high, explain what verification was done to mitigate the risks. -->
None
### Documentation Update
<!-- Describe any necessary documentation update if there is any new feature, config, or user-facing change. If not, put "none".
- 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 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)
- [ ] Enough context is provided in the sections above
- [ ] Adequate tests were added if applicable
--
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] perf: Avoid creating properties objects per row in writers [hudi]
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #13975:
URL: https://github.com/apache/hudi/pull/13975#issuecomment-3335266489
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "71ceaf7a349040157202a7dd7d43778ef3ba1c86",
"status" : "DELETED",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=8765",
"triggerID" : "71ceaf7a349040157202a7dd7d43778ef3ba1c86",
"triggerType" : "PUSH"
}, {
"hash" : "438133b39399ca49a34305f3c57c3556a368d01c",
"status" : "DELETED",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=8806",
"triggerID" : "438133b39399ca49a34305f3c57c3556a368d01c",
"triggerType" : "PUSH"
}, {
"hash" : "696cd606d9f4f9c887c6127c419490108be08ca1",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=8824",
"triggerID" : "696cd606d9f4f9c887c6127c419490108be08ca1",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 696cd606d9f4f9c887c6127c419490108be08ca1 Azure: [SUCCESS](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=8824)
<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] perf: Avoid creating properties objects per row in writers [hudi]
Posted by "danny0405 (via GitHub)" <gi...@apache.org>.
danny0405 merged PR #13975:
URL: https://github.com/apache/hudi/pull/13975
--
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] perf: Avoid creating properties objects per row in writers [hudi]
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #13975:
URL: https://github.com/apache/hudi/pull/13975#issuecomment-3334950746
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "71ceaf7a349040157202a7dd7d43778ef3ba1c86",
"status" : "DELETED",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=8765",
"triggerID" : "71ceaf7a349040157202a7dd7d43778ef3ba1c86",
"triggerType" : "PUSH"
}, {
"hash" : "438133b39399ca49a34305f3c57c3556a368d01c",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=8806",
"triggerID" : "438133b39399ca49a34305f3c57c3556a368d01c",
"triggerType" : "PUSH"
}, {
"hash" : "696cd606d9f4f9c887c6127c419490108be08ca1",
"status" : "PENDING",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=8824",
"triggerID" : "696cd606d9f4f9c887c6127c419490108be08ca1",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 438133b39399ca49a34305f3c57c3556a368d01c Azure: [SUCCESS](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=8806)
* 696cd606d9f4f9c887c6127c419490108be08ca1 Azure: [PENDING](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=8824)
<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] perf: Avoid creating properties objects per row in writers [hudi]
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #13975:
URL: https://github.com/apache/hudi/pull/13975#issuecomment-3324609505
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "71ceaf7a349040157202a7dd7d43778ef3ba1c86",
"status" : "PENDING",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=8765",
"triggerID" : "71ceaf7a349040157202a7dd7d43778ef3ba1c86",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 71ceaf7a349040157202a7dd7d43778ef3ba1c86 Azure: [PENDING](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=8765)
<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] perf: Avoid creating properties objects per row in writers [hudi]
Posted by "danny0405 (via GitHub)" <gi...@apache.org>.
danny0405 commented on code in PR #13975:
URL: https://github.com/apache/hudi/pull/13975#discussion_r2373863361
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/io/HoodieWriteMergeHandle.java:
##########
@@ -407,16 +407,16 @@ public void write(HoodieRecord<T> oldRecord) {
}
}
- protected void writeToFile(HoodieKey key, HoodieRecord<T> record, Schema schema, Properties prop, boolean shouldPreserveRecordMetadata) throws IOException {
+ protected void writeToFile(HoodieKey key, HoodieRecord<T> record, Schema schema, Properties props, boolean shouldPreserveRecordMetadata) throws IOException {
if (shouldPreserveRecordMetadata) {
// NOTE: `FILENAME_METADATA_FIELD` has to be rewritten to correctly point to the
// file holding this record even in cases when overall metadata is preserved
HoodieRecord populatedRecord = record.updateMetaField(schema, HoodieRecord.FILENAME_META_FIELD_ORD, newFilePath.getName());
- fileWriter.write(key.getRecordKey(), populatedRecord, writeSchemaWithMetaFields);
+ fileWriter.write(key.getRecordKey(), populatedRecord, writeSchemaWithMetaFields, props);
Review Comment:
is this a bug fix?
--
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] perf: Avoid creating properties objects per row in writers [hudi]
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #13975:
URL: https://github.com/apache/hudi/pull/13975#issuecomment-3330744291
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "71ceaf7a349040157202a7dd7d43778ef3ba1c86",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=8765",
"triggerID" : "71ceaf7a349040157202a7dd7d43778ef3ba1c86",
"triggerType" : "PUSH"
}, {
"hash" : "438133b39399ca49a34305f3c57c3556a368d01c",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "438133b39399ca49a34305f3c57c3556a368d01c",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 71ceaf7a349040157202a7dd7d43778ef3ba1c86 Azure: [SUCCESS](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=8765)
* 438133b39399ca49a34305f3c57c3556a368d01c 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] perf: Avoid creating properties objects per row in writers [hudi]
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #13975:
URL: https://github.com/apache/hudi/pull/13975#issuecomment-3330960902
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "71ceaf7a349040157202a7dd7d43778ef3ba1c86",
"status" : "DELETED",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=8765",
"triggerID" : "71ceaf7a349040157202a7dd7d43778ef3ba1c86",
"triggerType" : "PUSH"
}, {
"hash" : "438133b39399ca49a34305f3c57c3556a368d01c",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=8806",
"triggerID" : "438133b39399ca49a34305f3c57c3556a368d01c",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 438133b39399ca49a34305f3c57c3556a368d01c Azure: [SUCCESS](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=8806)
<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] perf: Avoid creating properties objects per row in writers [hudi]
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #13975:
URL: https://github.com/apache/hudi/pull/13975#issuecomment-3324603891
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "71ceaf7a349040157202a7dd7d43778ef3ba1c86",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "71ceaf7a349040157202a7dd7d43778ef3ba1c86",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 71ceaf7a349040157202a7dd7d43778ef3ba1c86 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] perf: Avoid creating properties objects per row in writers [hudi]
Posted by "the-other-tim-brown (via GitHub)" <gi...@apache.org>.
the-other-tim-brown commented on code in PR #13975:
URL: https://github.com/apache/hudi/pull/13975#discussion_r2373871743
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/io/HoodieWriteMergeHandle.java:
##########
@@ -407,16 +407,16 @@ public void write(HoodieRecord<T> oldRecord) {
}
}
- protected void writeToFile(HoodieKey key, HoodieRecord<T> record, Schema schema, Properties prop, boolean shouldPreserveRecordMetadata) throws IOException {
+ protected void writeToFile(HoodieKey key, HoodieRecord<T> record, Schema schema, Properties props, boolean shouldPreserveRecordMetadata) throws IOException {
if (shouldPreserveRecordMetadata) {
// NOTE: `FILENAME_METADATA_FIELD` has to be rewritten to correctly point to the
// file holding this record even in cases when overall metadata is preserved
HoodieRecord populatedRecord = record.updateMetaField(schema, HoodieRecord.FILENAME_META_FIELD_ORD, newFilePath.getName());
- fileWriter.write(key.getRecordKey(), populatedRecord, writeSchemaWithMetaFields);
+ fileWriter.write(key.getRecordKey(), populatedRecord, writeSchemaWithMetaFields, props);
Review Comment:
The props are only used when converting the payload based hoodie records. I think at this point though, the expectation is everything is a HoodieAvroIndexedRecord. I wanted to let CI run to confirm this was the case. I thought it was odd we had an unused variable here.
--
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] perf: Avoid creating properties objects per row in writers [hudi]
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #13975:
URL: https://github.com/apache/hudi/pull/13975#issuecomment-3324869120
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "71ceaf7a349040157202a7dd7d43778ef3ba1c86",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=8765",
"triggerID" : "71ceaf7a349040157202a7dd7d43778ef3ba1c86",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 71ceaf7a349040157202a7dd7d43778ef3ba1c86 Azure: [SUCCESS](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=8765)
<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] perf: Avoid creating properties objects per row in writers [hudi]
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #13975:
URL: https://github.com/apache/hudi/pull/13975#issuecomment-3330748761
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "71ceaf7a349040157202a7dd7d43778ef3ba1c86",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=8765",
"triggerID" : "71ceaf7a349040157202a7dd7d43778ef3ba1c86",
"triggerType" : "PUSH"
}, {
"hash" : "438133b39399ca49a34305f3c57c3556a368d01c",
"status" : "PENDING",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=8806",
"triggerID" : "438133b39399ca49a34305f3c57c3556a368d01c",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 71ceaf7a349040157202a7dd7d43778ef3ba1c86 Azure: [SUCCESS](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=8765)
* 438133b39399ca49a34305f3c57c3556a368d01c Azure: [PENDING](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=8806)
<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] perf: Avoid creating properties objects per row in writers [hudi]
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #13975:
URL: https://github.com/apache/hudi/pull/13975#issuecomment-3334945268
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "71ceaf7a349040157202a7dd7d43778ef3ba1c86",
"status" : "DELETED",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=8765",
"triggerID" : "71ceaf7a349040157202a7dd7d43778ef3ba1c86",
"triggerType" : "PUSH"
}, {
"hash" : "438133b39399ca49a34305f3c57c3556a368d01c",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=8806",
"triggerID" : "438133b39399ca49a34305f3c57c3556a368d01c",
"triggerType" : "PUSH"
}, {
"hash" : "696cd606d9f4f9c887c6127c419490108be08ca1",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "696cd606d9f4f9c887c6127c419490108be08ca1",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 438133b39399ca49a34305f3c57c3556a368d01c Azure: [SUCCESS](https://dev.azure.com/apachehudi/a1a51da7-8592-47d4-88dc-fd67bed336bb/_build/results?buildId=8806)
* 696cd606d9f4f9c887c6127c419490108be08ca1 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