Skip to content

Scalar index queries handle NOT and NULL incorrectly #4756

@wjones127

Description

@wjones127

This happens with both BTREE and BITMAP:

import pyarrow as pa
import lance

data = pa.table({"value": [True, False, None]})
ds = lance.write_dataset(data, "memory://")

ds.to_table(filter="NOT value")
value: int64
----
value: [[false]]
ds.create_scalar_index("value", "BTREE")
ds.to_table(filter="NOT value")
pyarrow.Table
value: int64
----
value: [[false,null]]
ds.create_scalar_index("value", "BITMAP", replace=True)
ds.to_table(filter="NOT value")
pyarrow.Table
value: int64
----
value: [[false,null]]

Similar things happen if you use integers and use condition like NOT (value = 1)

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcritical-fixBugs that cause crashes, security vulnerabilities, or incorrect data.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions