1

I am trying to save this Avro schema. I get the message that the schema is not valid. Can someone share why its not valid?

{
    "type": "record",
    "name": "Interactions",
    "namespace": "com.amazonaws.personalize.schema",
    "fields": [
        {
            "name": "InvoiceNo",
            "type": "int"
        },
        {
            "name": "StockCode",
            "type": "int"
        },
        {
            "name": "Description",
            "type": "long"
        },
        {
            "name": "Quantity",
            "type": "string"
        },
        {
            "name": "InvoiceDate",
            "type": "string"
        },
        {
            "name": "UnitPrice",
            "type": "string"
        },
        {
            "name": "CustomerID",
            "type": "string"
        },
        {
            "name": "CustomerID",
            "type": "string"
        },
        {
            "name": "Country",
            "type": "string"
        }
    ],
    "version": "1.0"
}

1 Answers1

0

I'm a bit late to the party here but I think your issue is twofold.

(1) You haven't reformatted your columns to use the field names that Personalize want to see. Required fields for Interactions are USER_ID, ITEM_ID, and TIMESTAMP. (With TIMESTAMP being in Unix Epoch format.) See reference here.

(2) The five specified fields for Interactions are USER_ID, ITEM_ID, TIMESTAMP, EVENT_TYPE, and EVENT_VALUE. If you do include more fields, they will be considered metadata fields and you can only include up to 5 metadata fields. If you do include them AND the data type is "String" you, they must be specified as "categorical". See page 35 of the Personalize Developer's Guide for an example.

Hope this helps!

starrywrites
  • 508
  • 2
  • 11