Class UnnestDimensionCursor

  • All Implemented Interfaces:
    Cursor

    public class UnnestDimensionCursor
    extends Object
    implements Cursor
    The cursor to help unnest MVDs with dictionary encoding. Consider a segment has 2 rows ['a', 'b', 'c'] ['d', 'c']

    Considering dictionary encoding, these are represented as

    'a' -> 0 'b' -> 1 'c' -> 2 'd' -> 3

    The baseCursor points to the row of IndexedInts [0, 1, 2] while the unnestCursor with each call of advance() moves over individual elements.

    advance() -> 0 -> 'a' advance() -> 1 -> 'b' advance() -> 2 -> 'c' advance() -> 3 -> 'd' (advances base cursor first) advance() -> 2 -> 'c'

    Total 5 advance calls above

    The index reference points to the index of each row that the unnest cursor is accessing The indexedInts for each row are held in the indexedIntsForCurrentRow object

    The needInitialization flag sets up the initial values of indexedIntsForCurrentRow at the beginning of the segment