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"}
cmq
已提问 1 年前711 查看次数
1 回答
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
James_J
已回答 1 年前
  • 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?

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则

相关内容