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 voidadvance()voidadvanceUninterruptibly()ColumnSelectorFactorygetColumnSelectorFactory()org.joda.time.DateTimegetTime()booleanisDone()booleanisDoneOrInterrupted()voidreset()
-
-
-
Constructor Detail
-
UnnestDimensionCursor
public UnnestDimensionCursor(Cursor cursor, ColumnSelectorFactory baseColumnSelectorFactory, VirtualColumn unnestColumn, String outputColumnName)
-
-
Method Detail
-
getColumnSelectorFactory
public ColumnSelectorFactory getColumnSelectorFactory()
- Specified by:
getColumnSelectorFactoryin interfaceCursor
-
advanceUninterruptibly
public void advanceUninterruptibly()
- Specified by:
advanceUninterruptiblyin interfaceCursor
-
isDoneOrInterrupted
public boolean isDoneOrInterrupted()
- Specified by:
isDoneOrInterruptedin interfaceCursor
-
-