title: DynamoDB Global Secondary Index with Exclusive Start Key
body: <p>Is it possible to specify an exclusive start key when querying a DynamoDB table via global secondary index?</p>
  
  <p>I'm using the aws-java-sdk version 1.6.10 and executing queries with a <code>QueryExpression</code> and a <code>DynamoDBMapper</code>.  Here's the gist of what I'm trying to do:</p>
  
  <pre><code>MappedItem key = new MappedItem();
  item.setIndexedAttribute(attributeValue);
  
  Map&lt;String, AttributeValue&gt; exclusiveStartKey = new HashMap&lt;String, AttributeValue&gt;();
  exclusiveStartKey.put(MappedItem.INDEXED_ATTRIBUTE_NAME, new AttributeValue().withS(attributeValue));
  exclusiveStartKey.put(MappedItem.TIMESTAMP, new AttributeValue().withN(startTimestamp.toString()));
  
  DynamoDBQueryExpression&lt;MappedItem&gt; queryExpression = new DynamoDBQueryExpression&lt;MappedItem&gt;();
  queryExpression.withIndexName(MappedItem.INDEX_NAME);
  queryExpression.withConsistentRead(Boolean.FALSE);
  queryExpression.withHashKeyValues(key);
  queryExpression.setLimit(maxResults * 2);
  queryExpression.setExclusiveStartKey(exclusiveStartKey);
  </code></pre>
  
  <p>This results in a 400 error saying that the specified start key is invalid.  The TIMESTAMP is the range key for the table index and for the global secondary index, and the attribute value pair is valid (i.e. there is an item in the table with the values passed as the hash and range key for the index, and the attribute passed as the index is the hash key of the global secondary index). </p>
  
  <p>Is there something I missed or is this not possible?</p>