presto-hive/src/main/java/io/prestosql/plugin/hive/GenericHiveRecordCursor.java/GenericHiveRecordCursor/validateType
class GenericHiveRecordCursor:    private void validateType(int fieldId, Class<?> type)
    {
        if (!types[fieldId].getJavaType().equals(type)) {
            // we don't use Preconditions.checkArgument because it requires boxing fieldId, which affects inner loop performance
            throw new IllegalArgumentException(format("Expected field to be %s, actual %s (field %s)", type, types[fieldId], fieldId));
        }
    }