presto-raptor-legacy/src/main/java/io/prestosql/plugin/raptor/legacy/storage/organization/Tuple.java/Tuple/compareTo
class Tuple:    @Override
    public int compareTo(Tuple o)
    {
        checkArgument(o.getTypes().size() == types.size(), "types must be of same size");
        for (int i = 0; i < types.size(); i++) {
            checkArgument(o.getTypes().get(i).equals(types.get(i)), "types must be the same");
        }

        for (int i = 0; i < types.size(); i++) {
            Object o1 = values.get(i);
            Object o2 = o.getValues().get(i);

            int result = compare(o1, o2);
            if (result != 0) {
                return result;
            }
        }
        return 0;
    }