Translated Query.java to scala from tutorial of MovieLens