public static byte[] serializeObjectToKryo(Serializable object) {
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    Output output = new Output(baos);
    Kryo kryo = borrowKryo();
    try {
      kryo.writeObject(output, object);
    } finally {
      releaseKryo(kryo);
    }
    output.close();
    return baos.toByteArray();
  }
Deserializes expression from Kryo.
@param bytes Bytes containing the expression.
@param isPartFilter ture if it is a partition filter
@return Expression; null if deserialization succeeded, but the result type is incorrect.
ql/src/java/org/apache/hadoop/hive/ql/exec/SerializationUtilities.java