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 47bd094c7f test: improve `lcm` function SQL test coverage (#23755)
47bd094c7f is described below
commit 47bd094c7fd2fc22cb2b94ee58458b87e365a56f
Author: Yongting You <[email protected]>
AuthorDate: Thu Jul 23 14:08:54 2026 +0800
test: improve `lcm` function SQL test coverage (#23755)
## 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/math.slt | 31 +++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git a/datafusion/sqllogictest/test_files/math.slt
b/datafusion/sqllogictest/test_files/math.slt
index 2e9107dc6e..668809632e 100644
--- a/datafusion/sqllogictest/test_files/math.slt
+++ b/datafusion/sqllogictest/test_files/math.slt
@@ -1134,6 +1134,20 @@ SELECT lcm(6, arrow_cast(column1, 'Decimal128(38,0)'))
FROM (VALUES (4), (9), (0
18
0
+query R
+SELECT lcm(arrow_cast(column1, 'Decimal32(7,0)'), arrow_cast(column2,
'Decimal32(7,0)')) FROM (VALUES (6, 4), (6, 9), (6, 0));
+----
+12
+18
+0
+
+query R
+SELECT lcm(arrow_cast(column1, 'Decimal64(16,0)'), arrow_cast(column2,
'Decimal64(16,0)')) FROM (VALUES (6, 4), (6, 9), (6, 0));
+----
+12
+18
+0
+
query R
SELECT lcm(arrow_cast(column1, 'Decimal128(38,0)'), arrow_cast(column2,
'Decimal128(38,0)')) FROM (VALUES (6, 4), (6, 9), (6, 0));
----
@@ -1141,6 +1155,23 @@ SELECT lcm(arrow_cast(column1, 'Decimal128(38,0)'),
arrow_cast(column2, 'Decimal
18
0
+query R
+SELECT lcm(arrow_cast(column1, 'Decimal256(40,0)'), arrow_cast(column2,
'Decimal256(40,0)')) FROM (VALUES (6, 4), (6, 9), (6, 0));
+----
+12
+18
+0
+
+# invalid argument count and type
+query error DataFusion error:
+SELECT lcm();
+
+query error DataFusion error:
+SELECT lcm(1, 2, 3);
+
+query error DataFusion error:
+SELECT lcm('x', 'y');
+
# lcm array and scalar with nulls in the array
query I
SELECT lcm(column1, 5) FROM (VALUES (0), (NULL), (25));
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]