public void setString(int columnIndex, String value) { Integer reuseIndex = stringReferences.get(value); if (reuseIndex != null) { bufferSlice.setInt(getOffset(columnIndex), reuseIndex); } else { int index = stringReferences.size(); stringReferences.put(value, index); bufferSlice.setInt(getOffset(columnIndex), index); stringReferenceSize += value.length() * 2 + 4; // assuming size of char = size of byte * 2 + length } clearNull(columnIndex); }
public void setDouble(int columnIndex, double value) { bufferSlice.setDouble(getOffset(columnIndex), value); clearNull(columnIndex); }
public void setLong(int columnIndex, long value) { bufferSlice.setLong(getOffset(columnIndex), value); clearNull(columnIndex); }
public void setBoolean(int columnIndex, boolean value) { bufferSlice.setByte(getOffset(columnIndex), value ? (byte) 1 : (byte) 0); clearNull(columnIndex); }
public void setTimestamp(int columnIndex, Timestamp value) { int offset = getOffset(columnIndex); bufferSlice.setLong(offset, value.getEpochSecond()); bufferSlice.setInt(offset + 8, value.getNano()); clearNull(columnIndex); }