Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HUDI-8799] Design of RFC-84, Optimized SerDe of DataStream in Flink operators #12697

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

geserdugarov
Copy link
Contributor

Change Logs

Proposed optimization to reduce SerDe costs for Flink operators.

Proof of concept was presented in the corresponding claim of RFC.
For stream write into Hudi with simple bucket index, total write time decreased by 15%, which is significant for stream processing.

Impact

None for this stage.

Risk level (write none, low medium or high below)

None for this stage.

Documentation Update

No need for this stage.

Contributor's checklist

  • Read through contributor's guide
  • Change Logs and Impact were stated clearly
  • Adequate tests were added if applicable
  • CI passed

@github-actions github-actions bot added the size:M PR with lines of changes in (100, 300] label Jan 23, 2025
### Potential problems

1. Key generators are hardly coupled with Avro `GenericRecord`.
Therefore, to support all key generators we will have to do intermediate conversion into Avro in operator, that is responsible for getting Hudi key.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there already a POC now, can we do a micro-benchmark to prove the gains.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but I will work on it a little bit more, and will provide benchmark results with profiling on this week. Also I will provide corresponding PR to check code changes.

Copy link
Contributor Author

@geserdugarov geserdugarov Jan 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@danny0405 , PR is ready: #12722.
In the description to this PR, I've mentioned costs from this extra conversion:

These costs could be accepted for now due to acceptable values: 5 798 CPU samples from 183 236 in total, which is about 3%.

Total performance improvement:

  • total write time decreased from 344 s to 265 s, which is about 23%,
  • data passed between Flink operators decreased from 19.4 GB to 12.9 GB, which is about 33.5%.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cshuo is recently working on a new RFC to add basic abstractions of schema/data type/expressions to Hudi, so that we can integrate with the engine specific "row" for both the writer and reader, the design doc would be coming out, will cc you if you have intreast in it, it's a huge task and maybe you can help with it.

Copy link
Contributor Author

@geserdugarov geserdugarov Feb 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cshuo , hi! If doesn't bother you, could you, please, check this RFC for design conflicts with your RFC, which is in progress. If there is no conflicts, I propose to move these changes further.
Otherwise, could you, please, provide some drafts, to start to work in collaboration.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@geserdugarov Sorry for the late reply, just came back from the lunar new year holiday :) I'll take a look at your rfc and benchmark code soon.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@geserdugarov here is RFC pr #12795, welcome to review and get involved to collaborate.

@geserdugarov
Copy link
Contributor Author

@hudi-bot run azure

@geserdugarov geserdugarov force-pushed the master-rfc-flink-serde branch from cae2226 to af1ce0f Compare January 29, 2025 03:01
@github-actions github-actions bot added size:L PR with lines of changes in (300, 1000] and removed size:M PR with lines of changes in (100, 300] labels Feb 6, 2025
@geserdugarov
Copy link
Contributor Author

geserdugarov commented Feb 6, 2025

@danny0405 , @cshuo , I've updated description here with added structure of HoodieFlinkRecordTypeInfo and HoodieFlinkRecordSerializer.

I've already implemented optimization for simple bucket index and non bucket case. There is only the last one left, consistent hashing case. Opened corresponding PR: #12796.

Assumption that I could do everything without custom serializer was wrong. I've faced issues with serde during conversion of DataStream into KeyedStream. With implemented HoodieFlinkRecordTypeInfo and HoodieFlinkRecordSerializer everything works correctly. And for non bucket case I got 31% performance improvement.

@hudi-bot
Copy link

hudi-bot commented Feb 6, 2025

CI report:

Bot commands @hudi-bot supports the following commands:
  • @hudi-bot run azure re-run the last Azure build

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:L PR with lines of changes in (300, 1000]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants