Skip to content

array_contains returns null instead of false for empty array with literal value #3346

@andygrove

Description

@andygrove

Description

array_contains(arr, 2) returns null instead of false when arr is an empty array (array()).

How to Reproduce

CREATE TABLE test(arr array<int>) USING parquet;
INSERT INTO test VALUES (array());
SELECT array_contains(arr, 2) FROM test;

Expected: false
Actual (Comet): null

Expected Behavior

Comet should return false for array_contains when the array is empty, matching Spark's behavior.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions