Package org.apache.druid.segment
Class UnnestDimensionCursor
- java.lang.Object
-
- org.apache.druid.segment.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
-
-
Constructor Summary
Constructors Constructor Description UnnestDimensionCursor(Cursor cursor, ColumnSelectorFactory baseColumnSelectorFactory, VirtualColumn unnestColumn, String outputColumnName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
advance()
void
advanceUninterruptibly()
ColumnSelectorFactory
getColumnSelectorFactory()
org.joda.time.DateTime
getTime()
boolean
isDone()
boolean
isDoneOrInterrupted()
void
reset()
-
-
-
Constructor Detail
-
UnnestDimensionCursor
public UnnestDimensionCursor(Cursor cursor, ColumnSelectorFactory baseColumnSelectorFactory, VirtualColumn unnestColumn, String outputColumnName)
-
-
Method Detail
-
getColumnSelectorFactory
public ColumnSelectorFactory getColumnSelectorFactory()
- Specified by:
getColumnSelectorFactory
in interfaceCursor
-
advanceUninterruptibly
public void advanceUninterruptibly()
- Specified by:
advanceUninterruptibly
in interfaceCursor
-
isDoneOrInterrupted
public boolean isDoneOrInterrupted()
- Specified by:
isDoneOrInterrupted
in interfaceCursor
-
-