* @param writer The table writer to output the rating
* @param rating The rating event to output
* @throws IOException The writer IO error
*/
protected void writeRating(TableWriter writer, Rating rating) throws IOException {
Preference pref = rating.getPreference();
writer.writeRow(Lists.newArrayList(
Long.toString(rating.getUserId()),
Long.toString(rating.getItemId()),
(pref != null ? Double.toString(pref.getValue()) : "NaN"),
Long.toString(rating.getTimestamp())
));
}