Search in sources :

Example 1 with ValueEntry

use of com.facebook.presto.common.predicate.EquatableValueSet.ValueEntry in project presto by prestodb.

the class PrestoThriftEquatableValueSet method fromEquatableValueSet.

public static PrestoThriftEquatableValueSet fromEquatableValueSet(EquatableValueSet valueSet) {
    Type type = valueSet.getType();
    Set<ValueEntry> values = valueSet.getEntries();
    List<PrestoThriftBlock> thriftValues = new ArrayList<>(values.size());
    for (ValueEntry value : values) {
        checkState(type.equals(value.getType()), "ValueEntrySet has elements of different types: %s vs %s", type, value.getType());
        thriftValues.add(fromBlock(value.getBlock(), type));
    }
    return new PrestoThriftEquatableValueSet(valueSet.isWhiteList(), thriftValues);
}
Also used : Type(com.facebook.presto.common.type.Type) PrestoThriftBlock(com.facebook.presto.thrift.api.datatypes.PrestoThriftBlock) ArrayList(java.util.ArrayList) ValueEntry(com.facebook.presto.common.predicate.EquatableValueSet.ValueEntry)

Aggregations

ValueEntry (com.facebook.presto.common.predicate.EquatableValueSet.ValueEntry)1 Type (com.facebook.presto.common.type.Type)1 PrestoThriftBlock (com.facebook.presto.thrift.api.datatypes.PrestoThriftBlock)1 ArrayList (java.util.ArrayList)1