Class BaseFieldOutput
java.lang.Object
org.apache.drill.exec.store.easy.text.reader.BaseFieldOutput
- Direct Known Subclasses:
ConstrainedFieldOutput
,RepeatedVarCharOutput
-
Field Summary
Modifier and TypeFieldDescriptionprotected int
protected int
protected byte[]
protected boolean
protected int
protected final int
protected final RowSetLoader
-
Constructor Summary
ConstructorDescriptionBaseFieldOutput
(RowSetLoader writer, int maxField, boolean[] projectionMask) Initialize the field output for one of three scenarios: SELECT all: SELECT *, SELECT columns. -
Method Summary
Modifier and TypeMethodDescriptionvoid
append
(byte data) protected abstract ValueWriter
boolean
boolean
endField()
void
long
boolean
isFull()
void
startField
(int index) void
Start a new record record.protected void
Write a buffer of data to the underlying vector using the column writer.
-
Field Details
-
currentFieldIndex
protected int currentFieldIndex -
currentDataPointer
protected int currentDataPointer -
fieldWriteCount
protected int fieldWriteCount -
fieldBytes
protected byte[] fieldBytes -
writer
-
maxField
protected final int maxField -
fieldProjected
protected boolean fieldProjected
-
-
Constructor Details
-
BaseFieldOutput
Initialize the field output for one of three scenarios:- SELECT all: SELECT *, SELECT columns. Indicated by a non -1 max fields.
- SELECT none: SELECT COUNT(*), etc. Indicated by a max field of -1.
- SELECT a, b, c indicated by a non-null projection mask that identifies the indexes of the fields to be selected. In this case, this constructor computes the maximum field.
- Parameters:
writer
- Row set writer that provides access to the writer for each columnmaxField
- the index of the last field to store. May be -1 if no fields are to be stored. Computed if the projection mask is setprojectionMask
- a boolean array indicating which fields are to be projected to the output. Optional
-
-
Method Details
-
startRecord
public void startRecord()Start a new record record. Resets all pointers -
startField
public void startField(int index) -
append
public void append(byte data) -
writeToVector
protected void writeToVector()Write a buffer of data to the underlying vector using the column writer. The buffer holds a complete or partial chunk of data for the field. If this is the first data for the field, write the bytes. If this is a second buffer for the same field, append the bytes. The append will work if the underlying vector is VarChar, it will fail if a type conversion shim is in between. (This is generally OK because the previous setBytes should have failed because a large int or date is not supported.) -
columnWriter
-
endField
public boolean endField() -
endEmptyField
public boolean endEmptyField() -
finishRecord
public void finishRecord() -
getRecordCount
public long getRecordCount() -
isFull
public boolean isFull()
-