zghong opened a new pull request, #69913: URL: https://github.com/apache/doris/pull/69913
### What problem does this PR solve? Issue Number: close #69912 Related PR: #68786, #57821 Problem Summary: PR #68786 made external binary mapping permanently enabled, so Hive/HMS `BINARY` columns are exposed as Doris `VARBINARY` and `enable.mapping.varbinary=false` can no longer restore the old `STRING` mapping. The [Hive UDF documentation](https://doris.apache.org/zh-CN/docs/dev/connection-integration/data-integration/hive-udf) describes Bitmap/HLL UDF output that uses Doris serialized binary data, while the existing `bitmap_from_base64` and `hll_from_base64` functions require Base64 `STRING` values. Therefore, the documented Hive UDF consumption path cannot directly read the current `VARBINARY` result. Add direct binary conversion functions: ```sql bitmap_from_binary(VARBINARY) -> BITMAP bitmap_to_binary(BITMAP) -> VARBINARY hll_from_binary(VARBINARY) -> HLL hll_to_binary(HLL) -> VARBINARY ``` The binary readers validate external input and return row-level `NULL` for malformed values. Bitmap deserialization additionally validates Roaring containers and consumed bytes to prevent incorrect parsing and backend memory-safety failures. `hll_from_binary` is also allowed in Stream Load and Broker Load mappings. ### Release note Add direct `VARBINARY` conversion functions for Doris Bitmap and HLL values, with safe handling of malformed binary input. ### Check List (For Author) - Test <!-- At least one of them must be included. --> - [x] 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. - [ ] Previous test can cover this change. - [ ] No code files have been changed. - [ ] Other reason <!-- Add your reason? --> - Behavior changed: - [x] No. - [ ] Yes. <!-- Explain the behavior change --> - Does this need documentation? - [ ] No. - [x] Yes. <!-- Add document PR link here. eg: https://github.com/apache/doris-website/pull/1214 --> https://github.com/apache/doris-website/pull/4570 ### Check List (For Reviewer who merge this PR) - [ ] Confirm the release note - [ ] Confirm test cases - [ ] Confirm document - [ ] Add branch pick label <!-- Add branch pick label that this PR should merge into --> -- 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]
