Commit f2a867a
committed
Add inline CTable support to TreeStore
TreeStore can now store CTable objects as first-class inline leaves
alongside NDArrays:
ts["/arr"] = blosc2.arange(10)
ts["/table"] = ctable # CTable stored inline
table = ts["/table"] # returns CTable transparently
Physical layout: CTable internals (_meta, _valid_rows, _cols/*, _indexes/*)
are stored as ordinary Blosc2 leaves inside the outer store's working
directory, avoiding nested ZIPs and keeping everything directly addressable
by offset in .b2z bundles.
Implementation:
- Add TreeStoreTableStorage backend in ctable_storage.py that maps CTable
logical keys onto an outer TreeStore's map_tree/working_dir
- Refactor CTable.save() and CTable.open() around shared _save_to_storage()
and _open_from_storage() helpers; add private _save_to_treestore() and
_open_from_treestore() used by TreeStore
- Add persistent object registry in TreeStore (embed-store vlmeta) to
track object roots; probe _/<key>/_meta as fallback for old stores
- Update TreeStore.__setitem__ to dispatch CTable and block writes to
object internals
- Update TreeStore.__getitem__ to return CTable for registered object roots
- Update TreeStore.__delitem__ to remove all physical leaves of an object
root and unregister it; block direct deletion of internals
- Update keys(), __contains__, walk(), get_children(), get_descendants()
to treat object roots as opaque leaves and hide their internals
- get_subtree() raises ValueError on object root paths
- TreeStore.close()/discard() flush inline CTable handles before repacking
- Add 30 new tests covering b2d/b2z, append mode, traversal, guards,
deletion, roundtrips, and string columns
- Add plans/tree_store_ctable_ndarray.md with design rationale1 parent 6ada232 commit f2a867a
5 files changed
Lines changed: 1755 additions & 161 deletions
File tree
- plans
- src/blosc2
- tests
0 commit comments