Package org.apache.drill.exec.vector.accessor.writer.dummy
package org.apache.drill.exec.vector.accessor.writer.dummy
This package provides a "dummy" set of writers. The dummy writers provide
the same API as the "real" writers, but the dummy writers simply discard
their data. The dummy writers are used when implementing projection:
non-projected columns may still have to be processed (as in a CSV file,
say), but their values are not needed. One way to do this is to do an
if-statement for each value:
if (column-a-is-projected) {
aWriter.setSomething(value);
}
The dummy writers convert the if-statement into a virtual function call,
same as is done to handle the type-specific nature of vectors:
aWriter.setSomething(value);
The theory is that the virtual function dispatch is simpler, and faster, than doing continual if-checks everywhere in the code.
The dummy writers reside in this package so that the various factory methods can automatically build the dummy versions when given a null value vector (which we then interpret to mean that there is no physical backing to the column.)
At present, most methods that return a value simply return zero or null. Experience will show whether it is worthwhile implementing some basics, such as a value type or index. For now, these return null, assuming that the caller won't do anything with the column other than set a value.
Some simpler dummy writers appear as nested classes inside the "real" writers.
-
ClassDescriptionDummy scalar array writer that allows a client to write values into the array, but discards all of them.Represents a non-projected column.