Skip to content

Incorrect NULL handling in BETWEEN expression #13976

Closed
@2010YOUY01

Description

@2010YOUY01

Describe the bug

Run in datafusion-cli compiled from main (commit 259443d)

> select 1 where null between null and 2;
type_coercion
caused by
Error during planning: Cannot automatically convert Int64 to Null

To Reproduce

No response

Expected behavior

null should be interpreted as a missing integer, so the expression should be valid, and the query should return empty set

postgres=# select 1 where null between null and 2;
 ?column? 
----------
(0 rows)

Additional context

This bug is found by the recently integrated SQLite test suite, after the fix, all related skipifs can be removed from test cases in https://github.com/apache/datafusion-testing

# Datafusion - Error during planning: Cannot automatically convert Int64 to Null
skipif Datafusion

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions