This is an automated email from the ASF dual-hosted git repository.

morrysnow pushed a commit to branch branch-3.1
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-3.1 by this push:
     new ee00251309d branch-3.1: [Bug](function)  fix wrong result of 
hll_to_base64  #51831 (#51919)
ee00251309d is described below

commit ee00251309d5177c340dcbfb98f31a5414fc5b75
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Thu Jun 19 19:30:12 2025 +0800

    branch-3.1: [Bug](function)  fix wrong result of hll_to_base64  #51831 
(#51919)
    
    Cherry-picked from #51831
    
    Co-authored-by: Pxl <[email protected]>
---
 be/src/vec/functions/function_hll.cpp              |   4 ++--
 .../http_stream/test_http_stream_compress.out      | Bin 179025 -> 179043 bytes
 .../http_stream/test_http_stream_compress.groovy   |   1 +
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/be/src/vec/functions/function_hll.cpp 
b/be/src/vec/functions/function_hll.cpp
index a6b91e27c2d..e2f4c15064a 100644
--- a/be/src/vec/functions/function_hll.cpp
+++ b/be/src/vec/functions/function_hll.cpp
@@ -296,8 +296,8 @@ struct HllToBase64 {
                 last_ser_size = cur_ser_size;
                 ser_buff.resize(cur_ser_size);
             }
-            hll_val.serialize(reinterpret_cast<uint8_t*>(ser_buff.data()));
-            auto outlen = base64_encode((const unsigned char*)ser_buff.data(), 
cur_ser_size,
+            size_t real_size = 
hll_val.serialize(reinterpret_cast<uint8_t*>(ser_buff.data()));
+            auto outlen = base64_encode((const unsigned char*)ser_buff.data(), 
real_size,
                                         chars_data + encoded_offset);
             DCHECK(outlen > 0);
 
diff --git 
a/regression-test/data/load_p0/http_stream/test_http_stream_compress.out 
b/regression-test/data/load_p0/http_stream/test_http_stream_compress.out
index 80a422c7e72..2d3ba016dbf 100644
Binary files 
a/regression-test/data/load_p0/http_stream/test_http_stream_compress.out and 
b/regression-test/data/load_p0/http_stream/test_http_stream_compress.out differ
diff --git 
a/regression-test/suites/load_p0/http_stream/test_http_stream_compress.groovy 
b/regression-test/suites/load_p0/http_stream/test_http_stream_compress.groovy
index 5ce35278928..41e001c8a2b 100644
--- 
a/regression-test/suites/load_p0/http_stream/test_http_stream_compress.groovy
+++ 
b/regression-test/suites/load_p0/http_stream/test_http_stream_compress.groovy
@@ -103,6 +103,7 @@ suite("test_http_stream_compress", "p0") {
         }
         sql "sync"
         qt_sql2 "select k1, k2, bitmap_union_count(v1), HLL_UNION_AGG(v2) from 
${tableName2} group by k1, k2  order by k1"
+        qt_test "select HLL_CARDINALITY(hll_from_base64(hll_to_base64(v2))) 
from test_http_stream_bz4;"
     } finally {
         try_sq2 "DROP TABLE IF EXISTS ${tableName2}"
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to