Skip to content

Incorrect NULL handling in BETWEEN expression #13976

Closed

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

Activity

  1. getChan commented on Jan 2, 2025

    @getChan
    Contributor

    take

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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