Search in sources :

Example 1 with TypeId

use of io.trino.spi.type.TypeId in project trino by trinodb.

the class HiveBlockEncodingSerde method readType.

@Override
public Type readType(SliceInput sliceInput) {
    requireNonNull(sliceInput, "sliceInput is null");
    TypeId id = TypeId.of(readLengthPrefixedString(sliceInput));
    for (Type type : TYPES) {
        if (type.getTypeId().equals(id)) {
            return type;
        }
    }
    throw new IllegalArgumentException("Type not found: " + id);
}
Also used : TypeId(io.trino.spi.type.TypeId) Type(io.trino.spi.type.Type)

Aggregations

Type (io.trino.spi.type.Type)1 TypeId (io.trino.spi.type.TypeId)1