I have setup a table through the Scylla alternator interface like so (through python script):
table_definition = dynamodb.create_table(
TableName='display_name_tagging',
KeySchema=[
{
'AttributeName': 'a_party',
'KeyType': 'HASH' # Partition Key
},
{
'AttributeName': 'display_name_tag',
'KeyType': 'RANGE' # Sort Key
}
],
AttributeDefinitions=[
{
'AttributeName': 'a_party',
'AttributeType': 'N' # number data type
},
{
'AttributeName': 'display_name_tag',
'AttributeType': 'S' # string data type
}
],
ProvisionedThroughput={
'ReadCapacityUnits': 10,
'WriteCapacityUnits': 10
}
)
Now using Golang and AWS SDK I am connecting to that keyspace and trying to write a record into a table:
func insertRecord(db *dynamodb.DynamoDB) {
item := Item{a_party: 1234567890, display_name_tag: "Mike Test"}
nr, mErr := dynamodbattribute.MarshalMap(item)
if mErr != nil {
llog.Fatalf("Got error marshalling map: %s", mErr)
}
_, err := db.PutItem(
&dynamodb.PutItemInput{
Item: nr,
TableName: aws.String("display_name_tagging"),
},
)
if err != nil {
log.Fatalf("Got error calling insertRecord: %s", err)
}
fmt.Println("Inserted into table display_name_tagging")
}
but when I run my program, I get this error:
ValidationException: Key column a_party not found
Doing search online has not produced any results. Any help would be appreciated.