heguanhui opened a new pull request, #64152:
URL: https://github.com/apache/doris/pull/64152
### What problem does this PR solve?
Issue Number: close #64149
Problem Summary: `DataTypeQuantileStateSerDe::write_column_to_pb` used
`get_data_at()` to copy `sizeof(QuantileState)` bytes of raw memory, but
`QuantileState` contains heap-allocated members (`shared_ptr<TDigest>`,
`vector<double>`) whose data is not stored inline. `read_column_from_pb` then
used `insert_data()` to reinterpret this incomplete memory as a `QuantileState`
object, resulting in dangling pointers and data corruption.
Additionally, `write_column_to_pb` was missing the
`PGenericType::QUANTILE_STATE` type id assignment.
The test also had a bug: it compared `QuantileState` objects via
`get_data_at()` (raw memory comparison), which compares pointer values rather
than logical equality.
### Release note
Fixed QuantileState type corruption in RPC UDF / RPC aggregate function /
fold constant paths. Previously, QuantileState values could be silently
corrupted or lost when transmitted via protobuf.
### Check List (For Author)
- Test
- [ ] Regression test
- [x] Unit Test
- [ ] Manual test (add detailed scripts or steps below)
- [ ] No need to test or manual test. Explain why:
- [ ] This is a refactor/code format and no logic has been changed.
- [x] Previous test can cover this change.
- [ ] No code files have been changed.
- [ ] Other reason <!-- Add your reason? -->
- Behavior changed:
- [ ] No.
- [x] Yes. Fixes broken behavior — QuantileState values were corrupted
during protobuf serialization/deserialization.
- Does this need documentation?
- [x] No.
- [ ] Yes. <!-- Add document PR link here. eg:
https://github.com/apache/doris-website/pull/1214 -->
### Check List (For Reviewer who merge this PR)
- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]