私はC.アマゾンDynamoDBのにValidationException
{ "TableName": "table4", "KeyConditionExpression": "#yr = :yyyy and ts between :letter1 and :letter2", "ExpressionAttributeNames": { "#yr": "userid" }, "ExpressionAttributeValues": { ":yyyy": "abc", ":letter1": 1, ":letter2": 2 } }
にAWS-ダイナモライブラリを使用してDynamoDBのクエリのparamを、次の実行ですが、私はエラー
"__type":"com.amazon.coral.validate#ValidationException","message":"1 validation error detected: Value null at 'hashKeyValue' failed to satisfy constraint: Member must not be null"
を得たが、これは私のテーブル構造である
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"
}
}
表のパーティション・キーとソートキーは何? KeyConditionExpressionにパーティションキーフィールドを含めましたか? – notionquest
パーティションキー=ユーザーID、sortkey = ts –