yjhjstz commented on code in PR #1941:
URL: https://github.com/apache/cloudberry/pull/1941#discussion_r3906823133


##########
src/test/regress/expected/bfv_aggregate.out:
##########
@@ -2172,6 +2172,75 @@ commit;
 ERROR:  duplicate key value violates unique constraint "t3_pkey"  (seg1 
127.0.0.1:7003 pid=86457)
 DETAIL:  Key (a, b)=(1, 1) already exists.
 drop table  t1, t2, t3, t4, t5, t6;
+-- Test NULLs in a UNIQUE key column. A UNIQUE constraint allows multiple NULLs
+-- (NULL is never "equal" for uniqueness checks), but grouping columns that
+-- cover such a key must still collapse those NULLs into a single row, so
+-- dropping the GbAgg is only safe when every key column is also NOT NULL.
+drop table if exists t7, t8, t9;
+NOTICE:  table "t7" does not exist, skipping
+NOTICE:  table "t8" does not exist, skipping
+NOTICE:  table "t9" does not exist, skipping
+create table t7 (a int unique, b int);
+create table t8 (a int unique not null, b int);
+create table t9 (a int primary key, b int);
+insert into t7 values (1, 1), (2, 2), (null, 3), (null, 4), (null, 5);
+insert into t8 values (1, 1), (2, 2), (3, 3);
+insert into t9 values (1, 1), (2, 2), (3, 3);
+explain (costs off) select distinct a from t7;

Review Comment:
   try test on partitioned table ?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to