The entity i am querying has a HashKey & a RangeKey (Number). When i use batchGetItem on it, i get the following error:
AWS Error Code: ValidationException, AWS Error Message: One or more parameter values were invalid: Mismatching attribute types between location and schema
Schema:
Table: Daily
Hash Key: CustId (String)
Range Key: Dated (Number)
Data:
CustId : VisioNerdy
Dated : 1329071400000
Code:
List<Key> fkeys = new ArrayList<Key>(); //tableName="Daily", keys=["VisioNerdy"], ranges=[1329071400000] Map<String, KeysAndAttributes> requestItems = new HashMap<String, KeysAndAttributes>(); for(int i = 0; i < keys.size(); i++) { String key = keys.get(i); if(ranges == null) fkeys.add(new Key().withHashKeyElement(new AttributeValue().withS(key))); else fkeys.add(new Key().withHashKeyElement(new AttributeValue().withS(key)) .withRangeKeyElement(new AttributeValue().withS(ranges.get(i).toString()))); } requestItems.put(tableName, new KeysAndAttributes().withKeys(fkeys)); BatchGetItemRequest batchGetItemRequest = new BatchGetItemRequest().withRequestItems(requestItems); BatchGetItemResult result = client.batchGetItem(batchGetItemRequest);
Any clues?