Skip to content

Conversation

@linrrzqqq
Copy link
Contributor

@linrrzqqq linrrzqqq commented Sep 26, 2025

What problem does this PR solve?

Issue Number: close #56426

Related PR: #xxx

Problem Summary:

Doris has add a new datatype about binary, this pr extend the digest function to support VarBinary type parameter.

Release note

None

Check List (For Author)

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

@Thearas
Copy link
Contributor

Thearas commented Sep 26, 2025

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@linrrzqqq linrrzqqq changed the title [opt](varbinary) Extend the digest function for VarBinary type [Feature](varbinary) Extend the digest function for VarBinary type Sep 26, 2025
@linrrzqqq
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

ClickBench: Total hot run time: 30.71 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit d0d9201c2acc980eb6c68713e5f1b39919a50379, data reload: false

query1	0.05	0.04	0.05
query2	0.09	0.05	0.05
query3	0.25	0.08	0.08
query4	1.61	0.12	0.12
query5	0.28	0.27	0.25
query6	1.19	0.66	0.65
query7	0.04	0.03	0.02
query8	0.06	0.05	0.04
query9	0.63	0.53	0.52
query10	0.58	0.58	0.57
query11	0.17	0.12	0.11
query12	0.16	0.12	0.13
query13	0.63	0.64	0.63
query14	1.03	1.04	1.02
query15	0.87	0.86	0.90
query16	0.40	0.40	0.40
query17	1.08	1.04	1.06
query18	0.22	0.21	0.20
query19	1.98	1.89	1.87
query20	0.02	0.01	0.01
query21	15.42	0.91	0.59
query22	0.76	1.25	0.71
query23	14.85	1.39	0.67
query24	7.63	0.86	0.85
query25	0.50	0.16	0.08
query26	0.58	0.17	0.13
query27	0.07	0.07	0.06
query28	9.45	1.38	0.97
query29	12.54	3.89	3.32
query30	0.29	0.14	0.11
query31	2.83	0.62	0.39
query32	3.26	0.60	0.48
query33	3.03	3.12	3.07
query34	16.04	5.50	4.85
query35	4.92	4.91	4.96
query36	0.69	0.53	0.51
query37	0.10	0.08	0.08
query38	0.07	0.04	0.04
query39	0.04	0.03	0.03
query40	0.18	0.16	0.15
query41	0.09	0.04	0.04
query42	0.04	0.03	0.03
query43	0.04	0.04	0.04
Total cold run time: 104.76 s
Total hot run time: 30.71 s

@hello-stephen
Copy link
Contributor

BE UT Coverage Report

Increment line coverage 56.25% (18/32) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 52.39% (17614/33621)
Line Coverage 37.61% (160004/425440)
Region Coverage 32.13% (121930/379450)
Branch Coverage 33.51% (53527/159742)

@hello-stephen
Copy link
Contributor

BE Regression && UT Coverage Report

Increment line coverage 84.38% (27/32) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 71.10% (23339/32825)
Line Coverage 57.50% (243958/424285)
Region Coverage 52.90% (203388/384481)
Branch Coverage 54.51% (87434/160391)

@hello-stephen
Copy link
Contributor

FE Regression Coverage Report

Increment line coverage 100.00% (12/12) 🎉
Increment coverage report
Complete coverage report

@linrrzqqq
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

ClickBench: Total hot run time: 30.44 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 036975b9376991e2576b7bb200cb98b246c0466c, data reload: false

query1	0.06	0.05	0.05
query2	0.09	0.05	0.06
query3	0.25	0.09	0.08
query4	1.61	0.12	0.12
query5	0.27	0.26	0.27
query6	1.17	0.67	0.65
query7	0.03	0.03	0.02
query8	0.06	0.04	0.05
query9	0.62	0.53	0.52
query10	0.57	0.60	0.58
query11	0.15	0.12	0.11
query12	0.15	0.12	0.12
query13	0.63	0.63	0.63
query14	1.01	1.04	1.03
query15	0.88	0.86	0.87
query16	0.41	0.40	0.42
query17	1.08	1.07	1.03
query18	0.22	0.20	0.20
query19	2.02	1.89	1.82
query20	0.02	0.02	0.01
query21	15.44	0.91	0.58
query22	0.76	1.17	0.73
query23	14.87	1.40	0.68
query24	7.35	0.69	0.71
query25	0.49	0.23	0.15
query26	0.56	0.17	0.13
query27	0.08	0.06	0.06
query28	9.54	1.39	0.92
query29	12.66	3.91	3.21
query30	0.28	0.13	0.12
query31	2.84	0.60	0.38
query32	3.26	0.57	0.49
query33	3.06	3.11	3.06
query34	16.14	5.43	4.88
query35	4.94	4.94	4.89
query36	0.69	0.51	0.51
query37	0.10	0.08	0.08
query38	0.07	0.05	0.04
query39	0.03	0.03	0.03
query40	0.17	0.16	0.14
query41	0.08	0.03	0.04
query42	0.04	0.03	0.03
query43	0.04	0.04	0.03
Total cold run time: 104.79 s
Total hot run time: 30.44 s

@hello-stephen
Copy link
Contributor

FE UT Coverage Report

Increment line coverage 16.67% (2/12) 🎉
Increment coverage report
Complete coverage report

@linrrzqqq
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

ClickBench: Total hot run time: 30.32 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 8abd67631b66ce3d40edce564bbc13bf910070d6, data reload: false

query1	0.06	0.04	0.05
query2	0.10	0.05	0.07
query3	0.26	0.09	0.08
query4	1.61	0.12	0.11
query5	0.27	0.26	0.25
query6	1.17	0.67	0.64
query7	0.03	0.02	0.02
query8	0.05	0.06	0.05
query9	0.62	0.53	0.51
query10	0.58	0.58	0.58
query11	0.17	0.11	0.12
query12	0.15	0.13	0.12
query13	0.63	0.63	0.64
query14	1.04	1.03	1.03
query15	0.86	0.86	0.85
query16	0.40	0.41	0.42
query17	1.08	1.08	1.01
query18	0.21	0.20	0.20
query19	1.96	1.77	1.80
query20	0.01	0.01	0.02
query21	15.42	0.96	0.57
query22	0.75	1.22	0.68
query23	14.92	1.41	0.64
query24	6.76	2.36	0.56
query25	0.48	0.18	0.18
query26	0.65	0.16	0.15
query27	0.06	0.06	0.06
query28	9.49	1.37	0.92
query29	12.54	3.91	3.27
query30	0.28	0.15	0.12
query31	2.82	0.59	0.40
query32	3.31	0.59	0.48
query33	2.98	3.15	3.11
query34	15.99	5.48	4.90
query35	4.93	4.98	4.92
query36	0.70	0.52	0.50
query37	0.10	0.08	0.08
query38	0.06	0.05	0.05
query39	0.04	0.03	0.03
query40	0.18	0.15	0.13
query41	0.09	0.04	0.03
query42	0.04	0.03	0.03
query43	0.05	0.04	0.04
Total cold run time: 103.9 s
Total hot run time: 30.32 s

@hello-stephen
Copy link
Contributor

FE UT Coverage Report

Increment line coverage 16.67% (2/12) 🎉
Increment coverage report
Complete coverage report

@doris-robot
Copy link

BE UT Coverage Report

Increment line coverage 56.25% (18/32) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 52.39% (17614/33621)
Line Coverage 37.61% (160015/425440)
Region Coverage 32.16% (122039/379450)
Branch Coverage 33.51% (53533/159742)

@zclllyybb zclllyybb self-assigned this Sep 26, 2025
@linrrzqqq
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

ClickBench: Total hot run time: 29.95 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 0bb03ee2eae78d482feba488432d577fbb52db29, data reload: false

query1	0.05	0.04	0.05
query2	0.08	0.05	0.06
query3	0.25	0.09	0.08
query4	1.61	0.12	0.12
query5	0.28	0.26	0.26
query6	1.19	0.66	0.64
query7	0.03	0.02	0.02
query8	0.06	0.05	0.05
query9	0.63	0.53	0.52
query10	0.58	0.57	0.58
query11	0.16	0.11	0.13
query12	0.16	0.12	0.12
query13	0.64	0.63	0.62
query14	1.04	1.04	1.04
query15	0.88	0.86	0.84
query16	0.40	0.42	0.41
query17	1.03	1.07	1.07
query18	0.21	0.21	0.20
query19	1.95	1.86	1.86
query20	0.01	0.02	0.01
query21	16.42	0.96	0.57
query22	0.76	1.19	0.60
query23	14.98	1.37	0.59
query24	6.95	2.03	0.41
query25	0.34	0.14	0.08
query26	0.69	0.16	0.15
query27	0.06	0.06	0.06
query28	9.09	1.39	0.95
query29	12.56	3.92	3.24
query30	0.28	0.13	0.11
query31	2.82	0.60	0.39
query32	3.27	0.56	0.49
query33	3.10	3.17	3.09
query34	16.14	5.51	4.79
query35	4.98	4.96	4.91
query36	0.69	0.52	0.51
query37	0.10	0.07	0.08
query38	0.07	0.06	0.04
query39	0.04	0.03	0.03
query40	0.17	0.15	0.15
query41	0.09	0.03	0.02
query42	0.04	0.04	0.03
query43	0.04	0.04	0.04
Total cold run time: 104.92 s
Total hot run time: 29.95 s

@hello-stephen
Copy link
Contributor

FE UT Coverage Report

Increment line coverage 16.67% (2/12) 🎉
Increment coverage report
Complete coverage report

@hello-stephen
Copy link
Contributor

BE UT Coverage Report

Increment line coverage 56.25% (18/32) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 52.39% (17614/33622)
Line Coverage 37.61% (160009/425447)
Region Coverage 32.17% (122067/379460)
Branch Coverage 33.51% (53536/159754)

@hello-stephen
Copy link
Contributor

BE Regression && UT Coverage Report

Increment line coverage 84.38% (27/32) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 71.20% (23373/32826)
Line Coverage 57.61% (244434/424292)
Region Coverage 52.94% (203563/384491)
Branch Coverage 54.65% (87661/160403)

@hello-stephen
Copy link
Contributor

FE Regression Coverage Report

Increment line coverage 100.00% (12/12) 🎉
Increment coverage report
Complete coverage report

@doris-robot
Copy link

BE UT Coverage Report

Increment line coverage 32.43% (24/74) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 52.41% (17634/33645)
Line Coverage 37.63% (160175/425699)
Region Coverage 32.18% (122194/379757)
Branch Coverage 33.52% (53578/159847)

@hello-stephen
Copy link
Contributor

BE Regression && UT Coverage Report

Increment line coverage 63.51% (47/74) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 71.18% (23379/32843)
Line Coverage 57.55% (244321/424521)
Region Coverage 53.02% (204028/384779)
Branch Coverage 54.63% (87684/160496)

@hello-stephen
Copy link
Contributor

FE Regression Coverage Report

Increment line coverage 100.00% (16/16) 🎉
Increment coverage report
Complete coverage report

@linrrzqqq
Copy link
Contributor Author

run buildall

@hello-stephen
Copy link
Contributor

FE UT Coverage Report

Increment line coverage 12.50% (2/16) 🎉
Increment coverage report
Complete coverage report

@doris-robot
Copy link

BE UT Coverage Report

Increment line coverage 69.62% (55/79) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 52.44% (17643/33646)
Line Coverage 37.64% (160240/425706)
Region Coverage 32.12% (122172/380385)
Branch Coverage 33.53% (53615/159919)

@hello-stephen
Copy link
Contributor

BE Regression && UT Coverage Report

Increment line coverage 88.61% (70/79) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 71.27% (23408/32844)
Line Coverage 57.69% (244931/424536)
Region Coverage 52.97% (203813/384793)
Branch Coverage 54.74% (87857/160512)

@hello-stephen
Copy link
Contributor

FE Regression Coverage Report

Increment line coverage 100.00% (16/16) 🎉
Increment coverage report
Complete coverage report

@linrrzqqq
Copy link
Contributor Author

run performance

Copy link
Contributor

@HappenLee HappenLee left a comment

Choose a reason for hiding this comment

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

LGTM

@linrrzqqq
Copy link
Contributor Author

run performance

Copy link
Contributor

@zclllyybb zclllyybb left a comment

Choose a reason for hiding this comment

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

LGTM

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Sep 29, 2025
@github-actions
Copy link
Contributor

PR approved by at least one committer and no changes requested.

@doris-robot
Copy link

ClickBench: Total hot run time: 30.14 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 8a3091c53b329b17754be0cf69deb03d1509a4be, data reload: false

query1	0.05	0.05	0.05
query2	0.10	0.06	0.06
query3	0.26	0.08	0.08
query4	1.62	0.12	0.12
query5	0.28	0.27	0.25
query6	1.20	0.65	0.64
query7	0.03	0.02	0.02
query8	0.06	0.04	0.05
query9	0.60	0.52	0.52
query10	0.57	0.57	0.58
query11	0.16	0.11	0.11
query12	0.16	0.12	0.12
query13	0.63	0.63	0.62
query14	1.04	1.04	1.03
query15	0.90	0.88	0.88
query16	0.40	0.40	0.40
query17	1.02	1.03	1.03
query18	0.21	0.20	0.20
query19	1.94	1.82	1.83
query20	0.02	0.02	0.01
query21	15.43	0.96	0.57
query22	0.76	1.11	0.60
query23	15.07	1.40	0.64
query24	6.56	0.76	0.52
query25	0.49	0.27	0.07
query26	0.60	0.16	0.14
query27	0.07	0.06	0.06
query28	9.77	1.40	0.93
query29	12.60	3.84	3.28
query30	0.28	0.13	0.15
query31	2.83	0.59	0.39
query32	3.26	0.56	0.48
query33	3.05	3.11	3.10
query34	16.21	5.46	4.87
query35	5.01	4.93	4.90
query36	0.70	0.51	0.52
query37	0.11	0.08	0.08
query38	0.07	0.05	0.05
query39	0.04	0.02	0.03
query40	0.19	0.15	0.14
query41	0.08	0.02	0.03
query42	0.04	0.03	0.03
query43	0.04	0.04	0.04
Total cold run time: 104.51 s
Total hot run time: 30.14 s

@zclllyybb zclllyybb merged commit fa6d210 into apache:master Sep 29, 2025
27 of 28 checks passed
@linrrzqqq linrrzqqq deleted the binary-function branch September 29, 2025 05:10
github-actions bot pushed a commit that referenced this pull request Oct 24, 2025
…56497)

Doris has add a new datatype about binary, this pr extend the digest
function to support VarBinary type parameter.
yiguolei pushed a commit that referenced this pull request Oct 24, 2025
…nary type #56497 (#57292)

Cherry-picked from #56497

Co-authored-by: linrrarity <linzhenqi@selectdb.com>
zclllyybb pushed a commit that referenced this pull request Nov 28, 2025
…nary digest test (#58291)

Related PR: #56497

Problem Summary:

The test `test_binary_for_digest` was failing when running Regression
External tests because it depended on a pre-existing `doris_test`
database in the external MySQL instance. This database is only created
during query_p0 test suite execution, which will cause error:
```text
Exception in query_p0/sql_functions/encryption_digest/test_binary_for_digest.groovy(line 51):

        connect("root", "123456", "jdbc:mysql://${externalEnvIp}:${mysql_port}/doris_test?useSSL=false") {
            try_sql """DROP TABLE IF EXISTS ${test_table}"""

            sql """CREATE TABLE ${test_table} (
                id int,
                vb varbinary(100),
                vc VARCHAR(100)
            )"""

            sql """INSERT INTO ${test_table} VALUES 
^^^^^^^^^^^^^^^^^^^^^^^^^^ERROR LINE^^^^^^^^^^^^^^^^^^^^^^^^^^
                (1, 'hello world', 'hello world'),
                (2, 'test data', 'test data'),
                (3, 'hash test', 'hash test'),
                (4, '', ''),
                (5, 'special chars: !@#%', 'special chars: !@#%')"""
        }

        sql """switch ${catalog_name}"""
        sql """use ${ex_db_name}"""


Exception:
java.sql.SQLSyntaxErrorException: Table 'doris_test.binary_test' doesn't exist
```

Now creates `binary_for_digest_test` database at test startup instead of
relying on `doris_test`.
github-actions bot pushed a commit that referenced this pull request Nov 28, 2025
…nary digest test (#58291)

Related PR: #56497

Problem Summary:

The test `test_binary_for_digest` was failing when running Regression
External tests because it depended on a pre-existing `doris_test`
database in the external MySQL instance. This database is only created
during query_p0 test suite execution, which will cause error:
```text
Exception in query_p0/sql_functions/encryption_digest/test_binary_for_digest.groovy(line 51):

        connect("root", "123456", "jdbc:mysql://${externalEnvIp}:${mysql_port}/doris_test?useSSL=false") {
            try_sql """DROP TABLE IF EXISTS ${test_table}"""

            sql """CREATE TABLE ${test_table} (
                id int,
                vb varbinary(100),
                vc VARCHAR(100)
            )"""

            sql """INSERT INTO ${test_table} VALUES 
^^^^^^^^^^^^^^^^^^^^^^^^^^ERROR LINE^^^^^^^^^^^^^^^^^^^^^^^^^^
                (1, 'hello world', 'hello world'),
                (2, 'test data', 'test data'),
                (3, 'hash test', 'hash test'),
                (4, '', ''),
                (5, 'special chars: !@#%', 'special chars: !@#%')"""
        }

        sql """switch ${catalog_name}"""
        sql """use ${ex_db_name}"""


Exception:
java.sql.SQLSyntaxErrorException: Table 'doris_test.binary_test' doesn't exist
```

Now creates `binary_for_digest_test` database at test startup instead of
relying on `doris_test`.
nagisa-kunhah pushed a commit to nagisa-kunhah/doris that referenced this pull request Dec 14, 2025
…nary digest test (apache#58291)

Related PR: apache#56497

Problem Summary:

The test `test_binary_for_digest` was failing when running Regression
External tests because it depended on a pre-existing `doris_test`
database in the external MySQL instance. This database is only created
during query_p0 test suite execution, which will cause error:
```text
Exception in query_p0/sql_functions/encryption_digest/test_binary_for_digest.groovy(line 51):

        connect("root", "123456", "jdbc:mysql://${externalEnvIp}:${mysql_port}/doris_test?useSSL=false") {
            try_sql """DROP TABLE IF EXISTS ${test_table}"""

            sql """CREATE TABLE ${test_table} (
                id int,
                vb varbinary(100),
                vc VARCHAR(100)
            )"""

            sql """INSERT INTO ${test_table} VALUES 
^^^^^^^^^^^^^^^^^^^^^^^^^^ERROR LINE^^^^^^^^^^^^^^^^^^^^^^^^^^
                (1, 'hello world', 'hello world'),
                (2, 'test data', 'test data'),
                (3, 'hash test', 'hash test'),
                (4, '', ''),
                (5, 'special chars: !@#%', 'special chars: !@#%')"""
        }

        sql """switch ${catalog_name}"""
        sql """use ${ex_db_name}"""


Exception:
java.sql.SQLSyntaxErrorException: Table 'doris_test.binary_test' doesn't exist
```

Now creates `binary_for_digest_test` database at test startup instead of
relying on `doris_test`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. dev/4.0.1-merged reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] support binary functions

8 participants