public static PrefixComparator getPrefixComparator(StructType schema) {
        if (schema.size() != 0) {
            return getPrefixComparator(
                    new SortOrder(new BoundReference(0, schema.get(0).dataType),
                            SortOrder.SortDirection.Ascending));
        } else {
            return (a, b) -> 0;
        }
    }
Creates the prefix comparator for the first field in the given schema, in ascending order.
indexr-query-opt/src/main/java/io/indexr/query/util/SortPrefixUtils.java