Repository navigation
Experimental listelement scalar index: indexing fields inside list<struct> elements #10948
sarwarbhuiyan
started this conversation in
Lance Table Format
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This is the design discussion for the experimental
listelementscalar index. The voting rules ask for one before an experimental format feature merges. The full design, with prototype measurements, is in #10900.What it is
The index lets a filter on fields inside a
list<struct>column be answered from an index, with every condition on the same element. Fordetections: list<struct<label, confidence, ...>>:any_element(detections, 'label = ''car'' AND confidence > 0.9')any_elementmerged in #10901 and works without an index, as a scan.The format addition
Binarykeys, one row per list element. Each key is the element's chosen sub-fields, for example(label, confidence), encoded with Arrow's row format. That is the same encoding as the composite keys in docs(format): specify composite B-tree keys #10358. The posting is the row address.ListElementIndexDetails: the key fields, their types, the key encoding, and the inner BTREE's details and version. It wraps the BTREE the wayJsonIndexDetailsdoes.lance-table. On tables with stable row IDs, the writer fence from fix(index): fence older writers from row-address indices #10352 applies.Why experimental
It meets the prerequisites for an experimental merge:
Planned PRs
any_element: merged.docs/src/format/index/scalar/list_element.mdand the details message, marked experimental.Open questions
listelementcould become a thin "explode the list" wrapper over the composite BTREE. Is a separate wrapper acceptable while experimental, with a merge into composite keys considered before stabilization?All reactions