Skip to content

list_contains / array_contains predicate pushdown silently returns 0 rows on Lance dataset #194

Description

@Nomow

Describe the bug

When querying a Lance dataset from DuckDB UI with a list_contains or array_contains filter, the query returns 0 rows. Disabling the optimizer (SET disabled_optimizers = 'filter_pushdown') returns the correct results.

Minimal reproduction

-- Both return 0 rows (wrong)
SELECT * FROM 'gs://your-bucket/path/to/your.lance' WHERE list_contains(tags, 'foo'); -- tags is varchar[]
SELECT * FROM 'gs://your-bucket/path/to/your.lance' WHERE array_contains(tags, 'foo'); -- tags is varchar[]

-- Returns correct rows
SET disabled_optimizers = 'filter_pushdown';
SELECT * FROM 'gs://your-bucket/path/to/your.lance' WHERE list_contains(tags, 'foo'); -- tags is varchar[]
SELECT * FROM 'gs://your-bucket/path/to/your.lance' WHERE array_contains(tags, 'foo'); -- tags is varchar[]

Expected behavior

Either:

  1. These predicates are correctly evaluated after the Lance scan, or
  2. The Lance scanner rejects them so DuckDB falls back to filtering itself

Actual behavior

0 rows returned with no error or warning.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions