This is an automated email from the ASF dual-hosted git repository.
github-merge-queue[bot] pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion.git
The following commit(s) were added to refs/heads/main by this push:
new c1180022e6 test: improve `md5` function SQL test coverage (#23757)
c1180022e6 is described below
commit c1180022e63f48a3af175d8d73dc21cca9379c65
Author: Yongting You <[email protected]>
AuthorDate: Thu Jul 23 02:26:05 2026 +0800
test: improve `md5` function SQL test coverage (#23757)
## Which issue does this PR close?
<!--
We generally require a GitHub issue to be filed for all bug fixes and
enhancements and this helps us generate change logs for our releases.
You can link an issue to this PR using the GitHub syntax. For example
`Closes #123` indicates that this PR will close issue #123.
-->
- Closes #.
## Rationale for this change
<!--
Why are you proposing this change? If this is already explained clearly
in the issue then this section is not needed.
Explaining clearly why changes are proposed helps reviewers understand
your changes and offer better suggestions for fixes.
-->
Codecov reports low test coverage for this function, so this PR adds
more SLT tests for it.
The tests were AI-generated, and I manually verified that the results
are correct.
See `Codecov` bot comment -> `☔ View full report in Codecov by Harness`
-> `Indirect Changes` for the updated test coverage.
## What changes are included in this PR?
<!--
There is no need to duplicate the description in the issue here but it
is sometimes worth providing a summary of the individual changes in this
PR.
-->
## Are these changes tested?
<!--
We typically require tests for all PRs in order to:
1. Prevent the code from being accidentally broken by subsequent changes
2. Serve as another way to document the expected behavior of the code
If tests are not included in your PR, please explain why (for example,
are they covered by existing tests)?
-->
## Are there any user-facing changes?
<!--
If there are user-facing changes then we may require documentation to be
updated before approving the PR.
-->
<!--
If there are any breaking changes to public APIs, please add the `api
change` label.
-->
---
datafusion/sqllogictest/test_files/expr.slt | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/datafusion/sqllogictest/test_files/expr.slt
b/datafusion/sqllogictest/test_files/expr.slt
index c7c997f330..e14004a5f9 100644
--- a/datafusion/sqllogictest/test_files/expr.slt
+++ b/datafusion/sqllogictest/test_files/expr.slt
@@ -1559,6 +1559,30 @@ SELECT md5(NULL);
----
NULL
+# md5 string and binary array inputs
+query BBBBBB
+SELECT
+ md5(column1) = md5('tom'),
+ md5(arrow_cast(column1, 'LargeUtf8')) = md5('tom'),
+ md5(arrow_cast(column1, 'Utf8View')) = md5('tom'),
+ md5(arrow_cast(column1, 'Binary')) = md5('tom'),
+ md5(arrow_cast(column1, 'LargeBinary')) = md5('tom'),
+ md5(arrow_cast(column1, 'BinaryView')) = md5('tom')
+FROM (VALUES ('tom'), (NULL)) AS t(column1);
+----
+true true true true true true
+NULL NULL NULL NULL NULL NULL
+
+# invalid argument count and type
+query error DataFusion error:
+SELECT md5();
+
+query error DataFusion error:
+SELECT md5('tom', 'extra');
+
+query error DataFusion error:
+SELECT md5(1);
+
query ?
SELECT digest('','md5');
----
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]