lance: Panic when FFILanceTableProvider is used with datafusion filter and scalar index

Repro - modify https://github.com/lancedb/lance/blob/main/python/python/tests/test_table_provider.py as follows.

  1. Add a scalar index dataset.create_scalar_index("col1", "BTREE")
  2. Filter on that scalar index in datafusion result = ctx.table("ffi_lance_table").filter(dfn.col("col1") == 4).collect()

../../../external/lance/python/python/tests/test_table_provider.py Fatal Python error: Aborted

datafusion                            47.0.0                                    79.1 MiB    pypi   datafusion-47.0.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
lancedb                               0.23.0                                    85.9 MiB    pypi   lancedb-0.23.0-cp39-abi3-manylinux_2_28_x86_64.whl
pylance                               0.29.0                                    103.5 MiB   pypi   pylance-0.29.0-cp39-abi3-manylinux_2_28_x86_64.whl

About this issue

  • Original URL
  • State: open
  • Created a year ago
  • Comments: 20 (10 by maintainers)

Most upvoted comments

I was able to reproduce from this info. It would only happen if the schema was large enough (and/or had enough metadata) to occupy more than one block. Otherwise we end up reading the index info when we read the footer so the later index read doesn’t actually trigger an IOP.

I’ve updated the test to reproduce the issue and inserted a workaround to always load the indices when we create the table provider (this is a pretty cheap call). These are both now part of https://github.com/lancedb/lance/pull/3954

I’ve filed https://github.com/apache/datafusion-python/issues/1146 to track the issue on the datafusion-python side.

Thanks. I’ll try reproducing this morning

I am guessing this must have something to do with the various tokio runtimes hanging around. I think the scalar index functions are using the compute runtime on the side, and I’m wondering if there is some kind of problem related to this. I’m trying to track down exactly where the problem is happening still.