presto-accumulo/src/main/java/io/prestosql/plugin/accumulo/serializers/StringRowSerializer.java/StringRowSerializer/encode
class StringRowSerializer:    @Override
    public byte[] encode(Type type, Object value)
    {
        Text text = new Text();
        if (Types.isArrayType(type)) {
            throw new PrestoException(NOT_SUPPORTED, "arrays are not (yet?) supported for StringRowSerializer");
        }
        else if (Types.isMapType(type)) {
            throw new PrestoException(NOT_SUPPORTED, "maps are not (yet?) supported for StringRowSerializer");
        }
        else if (type.equals(BIGINT) && value instanceof Integer) {
            setLong(text, ((Integer) value).longValue());
        }
        else if (type.equals(BIGINT) && value instanceof Long) {
            setLong(text, (Long) value);
        }
        else if (type.equals(BOOLEAN)) {
            setBoolean(text, value.equals(Boolean.TRUE));
        }
        else if (type.equals(DATE)) {
            setDate(text, (Date) value);
        }
        else if (type.equals(DOUBLE)) {
            setDouble(text, (Double) value);
        }
        else if (type.equals(INTEGER) && value instanceof Integer) {
            setInt(text, (Integer) value);
        }
        else if (type.equals(INTEGER) && value instanceof Long) {
            setInt(text, ((Long) value).intValue());
        }
        else if (type.equals(REAL)) {
            setFloat(text, (Float) value);
        }
        else if (type.equals(SMALLINT)) {
            setShort(text, (Short) value);
        }
        else if (type.equals(TIME)) {
            setTime(text, (Time) value);
        }
        else if (type.equals(TIMESTAMP)) {
            setTimestamp(text, (Timestamp) value);
        }
        else if (type.equals(TINYINT)) {
            setByte(text, (Byte) value);
        }
        else if (type.equals(VARBINARY) && value instanceof byte[]) {
            setVarbinary(text, (byte[]) value);
        }
        else if (type.equals(VARBINARY) && value instanceof Slice) {
            setVarbinary(text, ((Slice) value).getBytes());
        }
        else if (type.equals(VARCHAR) && value instanceof String) {
            setVarchar(text, ((String) value));
        }
        else if (type.equals(VARCHAR) && value instanceof Slice) {
            setVarchar(text, ((Slice) value).toStringUtf8());
        }
        else {
            throw new PrestoException(NOT_SUPPORTED, format("StringLexicoder does not support encoding type %s, object class is %s", type, value.getClass()));
        }

        return text.copyBytes();
    }