You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datafusion.apache.org by gi...@apache.org on 2026/07/21 09:52:44 UTC
(datafusion) branch gh-readonly-queue/main/pr-23713-b5b1810c89308de3f9d4d37b769a70645b6b1825 created (now 050046a7f0)
This is an automated email from the ASF dual-hosted git repository.
github-merge-queue[bot] pushed a change to branch gh-readonly-queue/main/pr-23713-b5b1810c89308de3f9d4d37b769a70645b6b1825
in repository https://gitbox.apache.org/repos/asf/datafusion.git
at 050046a7f0 test: More `slt` tests for `iszero` function (#23713)
This branch includes the following new commits:
new 050046a7f0 test: More `slt` tests for `iszero` function (#23713)
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datafusion.apache.org
For additional commands, e-mail: commits-help@datafusion.apache.org
(datafusion) 01/01: test: More `slt` tests for `iszero` function (#23713)
Posted by gi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
github-merge-queue[bot] pushed a commit to branch gh-readonly-queue/main/pr-23713-b5b1810c89308de3f9d4d37b769a70645b6b1825
in repository https://gitbox.apache.org/repos/asf/datafusion.git
commit 050046a7f0c08d64d8dba9ebf0e3544cbda6cd38
Author: Yongting You <20...@gmail.com>
AuthorDate: Tue Jul 21 17:52:21 2026 +0800
test: More `slt` tests for `iszero` function (#23713)
## 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.
-->
With test coverage tool added in
https://github.com/apache/datafusion/pull/23336, it's easy to identify
files that are missing test coverage.
This PR adds test to one of them.
## 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 | 80 +++++++++++++++++++++++++++++
1 file changed, 80 insertions(+)
diff --git a/datafusion/sqllogictest/test_files/math.slt b/datafusion/sqllogictest/test_files/math.slt
index 583d6f6777..7c24496230 100644
--- a/datafusion/sqllogictest/test_files/math.slt
+++ b/datafusion/sqllogictest/test_files/math.slt
@@ -149,6 +149,86 @@ SELECT iszero(1::DECIMAL(10,2)), iszero(0::DECIMAL(10,2)), iszero(NULL::DECIMAL(
----
false true NULL false
+# iszero: scalar boundary values at the remaining numeric widths
+query BBBBBBBBBB
+SELECT
+ iszero(arrow_cast(-0.0, 'Float16')),
+ iszero(arrow_cast('NaN', 'Float32')),
+ iszero(arrow_cast('-128', 'Int8')),
+ iszero(arrow_cast('-32768', 'Int16')),
+ iszero(arrow_cast('-9223372036854775808', 'Int64')),
+ iszero(arrow_cast('65535', 'UInt16')),
+ iszero(arrow_cast('18446744073709551615', 'UInt64')),
+ iszero(arrow_cast('0.00', 'Decimal32(7,2)')),
+ iszero(arrow_cast('-12.34', 'Decimal64(16,2)')),
+ iszero(arrow_cast('0.00', 'Decimal256(40,2)'))
+----
+true false false false false false false true false true
+
+# iszero: signed integer arrays, including minimum values and nulls
+query IBBBB
+SELECT id, iszero(i8), iszero(i16), iszero(i32), iszero(i64)
+FROM (VALUES
+ (1, 0::TINYINT, 0::SMALLINT, 0::INT, 0::BIGINT),
+ (2, arrow_cast('-128', 'Int8'), arrow_cast('-32768', 'Int16'), arrow_cast('-2147483648', 'Int32'), arrow_cast('-9223372036854775808', 'Int64')),
+ (3, NULL::TINYINT, NULL::SMALLINT, NULL::INT, NULL::BIGINT)
+) AS t(id, i8, i16, i32, i64)
+ORDER BY id
+----
+1 true true true true
+2 false false false false
+3 NULL NULL NULL NULL
+
+# iszero: unsigned integer arrays
+query IBBBB
+SELECT id, iszero(u8), iszero(u16), iszero(u32), iszero(u64)
+FROM (VALUES
+ (1, 0::TINYINT UNSIGNED, 0::SMALLINT UNSIGNED, 0::INT UNSIGNED, 0::BIGINT UNSIGNED),
+ (2, 255::TINYINT UNSIGNED, 65535::SMALLINT UNSIGNED, 4294967295::INT UNSIGNED, 4294967295::BIGINT UNSIGNED),
+ (3, NULL::TINYINT UNSIGNED, NULL::SMALLINT UNSIGNED, NULL::INT UNSIGNED, NULL::BIGINT UNSIGNED)
+) AS t(id, u8, u16, u32, u64)
+ORDER BY id
+----
+1 true true true true
+2 false false false false
+3 NULL NULL NULL NULL
+
+# iszero: floating-point arrays, including signed zero, NaN, and nulls
+query IBBB
+SELECT id,
+ iszero(arrow_cast(v, 'Float16')),
+ iszero(arrow_cast(v, 'Float32')),
+ iszero(arrow_cast(v, 'Float64'))
+FROM (VALUES (1, 0.0), (2, -0.0), (3, 'NaN'::DOUBLE), (4, -1.5), (5, NULL::DOUBLE)) AS t(id, v)
+ORDER BY id
+----
+1 true true true
+2 true true true
+3 false false false
+4 false false false
+5 NULL NULL NULL
+
+# iszero: decimal arrays at every Arrow decimal width
+query IBBBB
+SELECT id,
+ iszero(arrow_cast(v, 'Decimal32(7,2)')),
+ iszero(arrow_cast(v, 'Decimal64(16,2)')),
+ iszero(arrow_cast(v, 'Decimal128(30,2)')),
+ iszero(arrow_cast(v, 'Decimal256(40,2)'))
+FROM (VALUES (1, '0.00'), (2, '-12.34'), (3, NULL)) AS t(id, v)
+ORDER BY id
+----
+1 true true true true
+2 false false false false
+3 NULL NULL NULL NULL
+
+# iszero: an untyped all-null array
+query B
+SELECT iszero(v) FROM (VALUES (NULL), (NULL)) AS t(v)
+----
+NULL
+NULL
+
# abs: empty argument
statement error
SELECT abs();
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datafusion.apache.org
For additional commands, e-mail: commits-help@datafusion.apache.org