DRILL-7441: Fix issues with fillEmpties, offset vectors
Fixes subtle issues with offset vectors and "fill empties"
logic.
Drill has an informal standard that if a batch has no rows, then
offset vectors within that batch should have zero size. Contrast
this with batches of size 1 that should have offset vectors of
size 2. Changed to enforce this rule throughout.
Nullable, repeated and variable-width vectors have "fill empties"
logic that is used in two places: when setting the value count and
when preparing to write a new value. The current logic is not
quite right for either case. Added tests and fixed the code to
properly handle each case.
Revised the batch validator to enforce the offset-vector length of 0 for
0-sized batches rule. The result was much simpler code.
Added tools to easily print a batch, restoring some code that
was recently lost when the RowSet classes were moved.
Code cleanup in all files touched.
Added logic to "dirty" allocated buffers when testing to ensure
logic is not sensitive to the "pristine" state of new buffers.
Added logic to the column writers to enforce the zero-size-batch rule
for offset vectors. Added unit tests for this case.
Fixed the column writers to set the "lastSet" mutator value for
nullable types since other code relies on this value.
Removed the "setCount" field in nullable vectors: turns out
it is not actually used.
closes #1896