| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
DataFrame.Internal.PackedText
Description
Packed-text payload + byte-slice primitives. A PackedTextData shares one
UTF-8 byte buffer across all rows of a string column, with n+1 row offsets, so
no per-row Text header is materialized until decode is demanded.
Synopsis
- data PackedTextData = PackedTextData {}
- mkPackedContiguous :: Array -> Vector Int -> PackedTextData
- packedGather :: Vector Int -> PackedTextData -> PackedTextData
- packedTake :: Int -> PackedTextData -> PackedTextData
- packedRowOffsetVec :: PackedTextData -> Maybe (Array, Vector Int)
- packedLength :: PackedTextData -> Int
- packedSlice :: PackedTextData -> Int -> (Array, Int, Int)
- packedIndexText :: PackedTextData -> Int -> Text
- sliceEqBytes :: Array -> Int -> Int -> Array -> Int -> Int -> Bool
- sliceCmpBytes :: Array -> Int -> Int -> Array -> Int -> Int -> Ordering
Documentation
data PackedTextData Source #
A shared UTF-8 byte buffer plus n+1 row offsets (base row r spans bytes
[offsets!r, offsets!(r+1))); validity lives in the column's bitmap. ptSel is
an optional selection layer letting a gatherjoinsort result share the buffer.
mkPackedContiguous :: Array -> Vector Int -> PackedTextData Source #
Build a contiguous packed payload (no selection): the freeze-path shape.
packedGather :: Vector Int -> PackedTextData -> PackedTextData Source #
Reindex a packed payload by a selection vector, sharing the byte buffer;
logical row i becomes base row indices!i. A negative or out-of-range index
decodes to the empty slice. Composes with an existing selection.
packedTake :: Int -> PackedTextData -> PackedTextData Source #
Take the first k logical rows, sharing the byte buffer via a capped
selection layer. O(k), no byte copy or decode — cheap take/display on a
large packed column.
packedRowOffsetVec :: PackedTextData -> Maybe (Array, Vector Int) Source #
The shared buffer + contiguous n+1 offsets when the payload is the
unselected base; a selected (gathered) payload returns Nothing (its rows are
non-contiguous). Lets the boxed-Text fallback take the fast contiguous path.
packedLength :: PackedTextData -> Int Source #
Row count: length sel when selected, else length offsets - 1.
packedSlice :: PackedTextData -> Int -> (Array, Int, Int) Source #
Raw byte slice for logical row i: (buffer, offset, length). The hot accessor.
packedIndexText :: PackedTextData -> Int -> Text Source #
On-demand single Text for row i, using the same
validate-or-lenient decode as sliceTextVector so output is bit-identical.