presto-iceberg/src/main/java/io/prestosql/plugin/iceberg/PartitionTransforms.java/PartitionTransforms/truncateVarchar
class PartitionTransforms:    private static Slice truncateVarchar(Slice value, int max)
    {
        if (value.length() <= max) {
            return value;
        }
        int end = offsetOfCodePoint(value, 0, max);
        if (end < 0) {
            return value;
        }
        return value.slice(0, end);
    }