Class AbstractArrayWriter.ArrayElementWriterIndex
java.lang.Object
org.apache.drill.exec.vector.accessor.writer.AbstractArrayWriter.ArrayElementWriterIndex
- All Implemented Interfaces:
ColumnWriterIndex
- Direct Known Subclasses:
ScalarArrayWriter.ScalarElementWriterIndex
- Enclosing class:
AbstractArrayWriter
public class AbstractArrayWriter.ArrayElementWriterIndex
extends Object
implements ColumnWriterIndex
Index into the vector of elements for a repeated vector.
Keeps track of the current offset in terms of value positions.
Forwards overflow events to the base index.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintprotected voidnext()voidIncrement the index for an array.If this index represents a repeat level, return the index of the next higher repeat level.protected voidprev()voidDecrement the index for an array.voidreset()voidrollover()When handling overflow, the index must be reset so that the current row starts at the start of the vector.intIndex of the first entry for the current rowtoString()intintCurrent row or array index.
-
Constructor Details
-
ArrayElementWriterIndex
public ArrayElementWriterIndex()
-
-
Method Details
-
reset
public void reset() -
vectorIndex
public int vectorIndex()Description copied from interface:ColumnWriterIndexCurrent row or array index.- Specified by:
vectorIndexin interfaceColumnWriterIndex- Returns:
- row or array index
-
rowStartIndex
public int rowStartIndex()Description copied from interface:ColumnWriterIndexIndex of the first entry for the current row- Specified by:
rowStartIndexin interfaceColumnWriterIndex- Returns:
- index of the first entry for the current row
-
arraySize
public int arraySize() -
nextElement
public void nextElement()Description copied from interface:ColumnWriterIndexIncrement the index for an array. For arrays, writing (or saving) one value automatically moves to the next value. Ignored for non-element indexes.- Specified by:
nextElementin interfaceColumnWriterIndex
-
prevElement
public void prevElement()Description copied from interface:ColumnWriterIndexDecrement the index for an array. Used exclusively for appending bytes to a VarChar, Var16Char or VarBytes column. Assumed to be followed by another call to nextElement().- Specified by:
prevElementin interfaceColumnWriterIndex
-
next
protected void next() -
prev
protected void prev() -
valueStartOffset
public int valueStartOffset() -
rollover
public void rollover()Description copied from interface:ColumnWriterIndexWhen handling overflow, the index must be reset so that the current row starts at the start of the vector. Relative offsets must be preserved. (That is, if the current write position for an array is four greater than the start, then that offset must now be reset to four from the start of the vector.)- Specified by:
rolloverin interfaceColumnWriterIndex
-
outerIndex
Description copied from interface:ColumnWriterIndexIf this index represents a repeat level, return the index of the next higher repeat level.- Specified by:
outerIndexin interfaceColumnWriterIndex- Returns:
- the outer repeat level index, if any
-
toString
-