Skip to content

array_remove_* returns wrong response for NULLs #21011

@comphead

Description

@comphead

Describe the bug

originated from apache/datafusion-comet#3173

> SELECT array_remove_all(make_array(1, null, 2, null, 3), null);
+-------------------------------------------------------------------------+
| array_remove_all(make_array(Int64(1),NULL,Int64(2),NULL,Int64(3)),NULL) |
+-------------------------------------------------------------------------+
| [1, 2, 3]                                                               |
+-------------------------------------------------------------------------+
1 row(s) fetched. 
Elapsed 0.026 seconds.

> SELECT array_remove(make_array(1, null, 2, null, 3), null);
+---------------------------------------------------------------------+
| array_remove(make_array(Int64(1),NULL,Int64(2),NULL,Int64(3)),NULL) |
+---------------------------------------------------------------------+
| [1, 2, NULL, 3]                                                     |
+---------------------------------------------------------------------+

However Trino or Spark in this case return just NULL

To Reproduce

No response

Expected behavior

No response

Additional context

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions