Skip to content

Column name not recognized by materialized recommender #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
claudiosilvestri opened this issue Oct 15, 2013 · 2 comments
Closed

Column name not recognized by materialized recommender #2

claudiosilvestri opened this issue Oct 15, 2013 · 2 comments

Comments

@claudiosilvestri
Copy link

After recommender materialization a (previously working) recommendation query does not work anymore.

How to reproduce the problem:
0) load the movie dataset

  1. verify that the query works
  2. materialize the recommender
  3. verify that the query fails
  4. drop the recommender
  5. verify that the query works

Here is the complete list of SQL statements (except point 0):

CREATE RECOMMENDER MovieRec ON ml_ratings
USERS FROM userid
ITEMS FROM itemid
EVENTS FROM ratingid
USING ItemCosCF;
SELECT * FROM ml_ratings R
RECOMMEND R.itemid TO R.userid ON R.ratingval
USING ItemCosCF
WHERE R.userid = 1
ORDER BY R.ratingval
LIMIT 10;
SELECT * FROM ml_ratings R
RECOMMEND R.itemid TO R.userid ON R.ratingval
USING ItemCosCF
WHERE R.userid = 1
ORDER BY R.ratingval
LIMIT 10;

ERROR: column r.ratingval does not exist at character 62
STATEMENT: SELECT * FROM ml_ratings R
RECOMMEND R.itemid TO R.userid ON R.ratingval
USING ItemCosCF
WHERE R.userid = 1
ORDER BY R.ratingval
LIMIT 10;

DROP RECOMMENDER MovieRec;
SELECT * FROM ml_ratings R
RECOMMEND R.itemid TO R.userid ON R.ratingval
USING ItemCosCF
WHERE R.userid = 1
ORDER BY R.ratingval
LIMIT 10;

@TheSoundDefense
Copy link
Collaborator

Hi,

In this case, there appears to be a parameter mismatch. The recommender was built on ratingid, but the query is performed on ratingval. In the case of a CREATE RECOMMENDER statement, the EVENTS FROM column should be the rating value, instead of the rating id, for ratings to be accurate.

In any case, the error message comes from that mismatch between ratingid and ratingval. When you reference a created recommender, RecDB assumes that all of the provided columns will exactly match those used in the CREATE RECOMMENDER statement, and that admittedly cryptic error message is a result of that internal assumption. In the future we may handle this by creating a more useful error message, or by treating this situation as if there was no recommender created and generating one on-the-fly.

Thank you for alerting us to this!

@TheSoundDefense
Copy link
Collaborator

Fixed the README, which contained the erroneous CREATE statement.

@Sarwat Sarwat closed this as completed Nov 26, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants