From 4a1a375920ecd3f98e73e6befb98cb6bccfa466e Mon Sep 17 00:00:00 2001 From: HuSen8891 Date: Thu, 22 Aug 2024 00:28:44 +0800 Subject: [PATCH] Add test to verify count aggregate function should not be nullable --- datafusion/sqllogictest/test_files/aggregate.slt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/datafusion/sqllogictest/test_files/aggregate.slt b/datafusion/sqllogictest/test_files/aggregate.slt index b8b93b28aff6..d39bf6538ecb 100644 --- a/datafusion/sqllogictest/test_files/aggregate.slt +++ b/datafusion/sqllogictest/test_files/aggregate.slt @@ -5387,6 +5387,18 @@ physical_plan statement ok DROP TABLE empty; +# verify count aggregate function should not be nullable +statement ok +create table empty; + +query I +select distinct count() from empty; +---- +0 + +statement ok +DROP TABLE empty; + statement ok CREATE TABLE t(col0 INTEGER) as VALUES(2);