datafusion icon indicating copy to clipboard operation
datafusion copied to clipboard

Handle nulls for `range` and `generate_series`

Open jayzhan211 opened this issue 1 year ago • 1 comments

Describe the bug

Follow the logic like DuckDB, if any of the argument is Null, return Null instead of throwing error

To Reproduce

query error
select range(DATE '1992-09-01', NULL, INTERVAL '1' YEAR);

query error
select range(DATE '1992-09-01', DATE '1993-03-01', NULL);

query error
select range(NULL, DATE '1993-03-01', INTERVAL '1' YEAR);

Expected behavior

select range(DATE '1992-09-01', NULL, INTERVAL '1' YEAR);
----
Null

select range(DATE '1992-09-01', DATE '1993-03-01', NULL);
----
Null

query error
select range(NULL, DATE '1993-03-01', INTERVAL '1' YEAR);
----
Null

Additional context

No response

jayzhan211 avatar Apr 28 '24 11:04 jayzhan211

I can do the follow up on https://github.com/apache/datafusion/pull/9420

Lordworms avatar Apr 28 '24 16:04 Lordworms