title: DyanamoDB - Global Secondary Index using GetItemRequest using Hash and Range
body: <p>I am trying to use the Java AWS sdk to get a document based on a Global Secondary Index.</p>
  
  <p>Setup as follows:</p>
  
  <p><strong>Hash Key:</strong> MyId - Number</p>
  
  <p><strong>Range Key:</strong> MyDate - String</p>
  
  <p>Here is my code to:</p>
  
  <pre><code>Map&lt;String, AttributeValue&gt; key = new HashMap&lt;String, AttributeValue&gt;();
              key.put("MyId", new AttributeValue().withN("1234"));
  
              key.put("MyDate", new AttributeValue().withS("2014-10-12"));
  
          GetItemRequest go = new GetItemRequest().withTableName(tableName).withKey(key);
          GetItemResult result = getDynamoDBClient().getItem(gi);
  </code></pre>
  
  <p>But this always returns :</p>
  
  <blockquote>
    <p>The provided key element does not match the schema (Service:
    AmazonDynamoDBv2; Status Code: 400</p>
  </blockquote>
  
  <p>What am I dong wrong? </p>