Ich Ausführung folgende DynamoDB Abfrage param aws-Dynamo-Bibliothek in C.Amazon DynamoDB Validation
{ "TableName": "table4", "KeyConditionExpression": "#yr = :yyyy and ts between :letter1 and :letter2", "ExpressionAttributeNames": { "#yr": "userid" }, "ExpressionAttributeValues": { ":yyyy": "abc", ":letter1": 1, ":letter2": 2 } }
mit, aber ich habe Fehler
"__type":"com.amazon.coral.validate#ValidationException","message":"1 validation error detected: Value null at 'hashKeyValue' failed to satisfy constraint: Member must not be null"
dies ist meine Tabellenstruktur
table4
{
"Table": {
"TableSizeBytes": 66,
"KeySchema": [
{
"AttributeName": "userid",
"KeyType": "HASH"
},
{
"AttributeName": "ts",
"KeyType": "RANGE"
}
],
"CreationDateTime": 1464617195.039,
"ItemCount": 3,
"AttributeDefinitions": [
{
"AttributeName": "ts",
"AttributeType": "N"
},
{
"AttributeName": "userid",
"AttributeType": "S"
}
],
"ProvisionedThroughput": {
"ReadCapacityUnits": 1,
"WriteCapacityUnits": 1,
"LastDecreaseDateTime": 1464683346.007,
"NumberOfDecreasesToday": 1
},
"TableStatus": "ACTIVE",
"TableName": "table4",
"TableArn": "arn:aws:dynamodb:us-east-1:456456456:table/table4"
}
}
Was ist der Verteilungsschlüssel und Schlüssel der Tabelle sortieren? Haben Sie das Partitionsschlüsselfeld in die KeyConditionExpression aufgenommen? – notionquest
Partition key = Benutzer-ID, sortkey = ts –