in paimon-prestosql-common/src/main/java/org/apache/paimon/prestosql/PrestoSqlFilterConverter.java [160:192]
private Predicate toPredicate(int columnIndex, Range range) {
Type type = range.getType();
if (range.isSingleValue()) {
Object value = getLiteralValue(type, range.getSingleValue());
return builder.equal(columnIndex, value);
}
List<Predicate> conjuncts = new ArrayList<>(2);
if (isLowUnbounded(range)) {
Object low = getLiteralValue(type, getLowBoundedValue(range));
Predicate lowBound;
if (isLowInclusive(range)) {
lowBound = builder.greaterOrEqual(columnIndex, low);
} else {
lowBound = builder.greaterThan(columnIndex, low);
}
conjuncts.add(lowBound);
}
if (isHighUnbounded(range)) {
Object high = getLiteralValue(type, getHighBoundedValue(range));
Predicate highBound;
if (isHighInclusive(range)) {
highBound = builder.lessOrEqual(columnIndex, high);
} else {
highBound = builder.lessThan(columnIndex, high);
}
conjuncts.add(highBound);
}
return and(conjuncts);
}