Trying to make sense of InvalidInputException

0

Full Exception:

InvalidInputException: An error occurred (InvalidInputException) when calling the CreateDatasetImportJob operation: Input csv has rows that do not conform to the dataset schema. Please ensure all required data fields are present and that they are of the type specified in the schema.

I am trying to create an interactions dataset import job in Amazon Personalize from Amazon SageMaker. My interactions schema looks like this:

interactions_schema = {"type" : "record", 
                       "name" : "Interactions",
                       "namespace" : "com.amazonaws.personalize.schema",
                       "fields" : [{"name" : "ITEM_ID",
                                    "type" : "string"},
                                   {"name" : "USER_ID",
                                    "type" : "string"},
                                   {"name" : "TIMESTAMP",
                                    "type" : "float"},
                                   {"name" : "EVENT_VALUE",
                                    "type" : "long"},
                                   {"name" : "EVENT_TYPE",
                                    "type" : "string"}],
                       "version" : "1.0"}

The only thing I can think of that could lead to the above exception is that when I save my CSV to my S3 bucket, the fields with type 'string' get saved as type 'object'. Otherwise not sure what I could be doing wrong.

Edit: I have now tried the following:

interactions_schema = {"type" : "record", 
                       "name" : "Interactions",
                       "namespace" : "com.amazonaws.personalize.schema",
                       "fields" : [{"name" : "ITEM_ID",
                                    "type" : "string"},
                                   {"name" : "USER_ID",
                                    "type" : "string"},
                                   {"name" : "TIMESTAMP",
                                    "type" : "long"},
                                   {"name" : "EVENT_VALUE",
                                    "type" : "float"},
                                   {"name" : "EVENT_TYPE",
                                    "type" : "string"}],
                       "version" : "1.0"}
asked 2 years ago928 views
1 Answer
0

One possible/likely issue is that the TIMESTAMP column type is float. It should be type long. Also, EVENT_VALUE is typically float but I believe it works as a long.

AWS
answered 2 years ago
  • So I tried that (making TIMESTAMP a long and EVENT_VALUE a float) and I'm still getting the same exception. Is there anything else I can try (or more information I can give to help diagnose the problem)?

  • @cmq What does your interactions dataset look like? Can you share the first few rows? Are the USER_ID, ITEM_ID, TIMESTAMP, and EVENT_TYPE columns fully populated?

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions

Relevant content