@Override public boolean isNull(int index) { return ac.isNull(index); }
@Override public Object getObject(int index) { if (ac.isNull(index)) { return null; } return ac.getObject(index); }
public boolean isSet(){ return !vector.isNull(idx()); }
private void decodeBoolean(IntVector input, BitVector output) { if (hasSv2) { final SelectionVector2 sv2 = incoming.getSelectionVector2(); for (int i = 0; i < recordsConsumedCurrentBatch; ++i) { final int svIndex = sv2.getIndex(i); if (input.isNull(svIndex)) { output.setNull(svIndex); } else { final int id = input.get(svIndex); output.setSafe(svIndex, id); } } } else { for (int i = 0; i < recordsConsumedCurrentBatch; ++i) { if (input.isNull(i)) { output.setNull(i); } else { final int id = input.get(i); output.setSafe(i, id); } } } }
private void decodeDate(IntVector input, DateMilliVector output, IntVector dictionary) { // dates are stored as int32 in parquet dictionaries if (hasSv2) { final SelectionVector2 sv2 = incoming.getSelectionVector2(); for (int i = 0; i < recordsConsumedCurrentBatch; ++i) { final int svIndex = sv2.getIndex(i); if (input.isNull(svIndex)) { output.setNull(svIndex); } else { final int id = input.get(svIndex); output.setSafe(svIndex, dictionary.get(id) * (long) DateTimeConstants.MILLIS_PER_DAY); } } } else { for (int i = 0; i < recordsConsumedCurrentBatch; ++i) { if (input.isNull(i)) { output.setNull(i); } else { int id = input.get(i); output.setSafe(i, dictionary.get(id) * (long) DateTimeConstants.MILLIS_PER_DAY); } } } }
private void decodeTimestamp(IntVector input, TimeStampMilliVector output, BigIntVector dictionary) { // dates are stored as int32 in parquet dictionaries if (hasSv2) { final SelectionVector2 sv2 = incoming.getSelectionVector2(); for (int i = 0; i < recordsConsumedCurrentBatch; ++i) { final int svIndex = sv2.getIndex(i); if (input.isNull(svIndex)) { output.setNull(svIndex); } else { final int id = input.get(svIndex); output.setSafe(svIndex, dictionary.get(id)); } } } else { for (int i = 0; i < recordsConsumedCurrentBatch; ++i) { if (input.isNull(i)) { output.setNull(i); } else { int id = input.get(i); output.setSafe(i, dictionary.get(id)); } } } }
private void decodeVarChar(IntVector input, VarCharVector output, VarBinaryVector dictionary) { if (hasSv2) { final SelectionVector2 sv2 = incoming.getSelectionVector2(); for (int i = 0; i < recordsConsumedCurrentBatch; ++i) { final int svIndex = sv2.getIndex(i); // TODO : Implement CopySafe between varchar and varbinary vectors. if (!input.isNull(svIndex)) { output.setNull(svIndex); } else { final int id = input.get(svIndex); final byte[] value = dictionary.get(id); output.setSafe(svIndex, value, 0, value.length); } } } else { for (int i = 0; i < recordsConsumedCurrentBatch; ++i) { if (input.isNull(i)) { output.setNull(i); } else { final int id = input.get(i); final byte[] value = dictionary.get(id); output.setSafe(i, value, 0, value.length); } } } }