title: Query Dynamo table with only the secondary global index
body: <p>Im trying to query a Dynamodb table using a secondary global index and I'm getting java.lang.IllegalArgumentException: Illegal query expression: No hash key condition is found in the query. All I'm trying to do is to get all items that have a timestamp greater than a value without considering the key. The timestamp is not part of a key or range key, so i created a global index for it. </p>
  
  <p>Does anyone have a clue what i might be missing? </p>
  
  <p><strong>Table Definition:</strong></p>
  
  <pre><code>{
     AttributeDefinitions:[
        {
           AttributeName:timestamp,
           AttributeType:N
        },
        {
           AttributeName:url,
           AttributeType:S
        }
     ],
     TableName:SitePageIndexed,
     KeySchema:[
        {
           AttributeName:url,
           KeyType:HASH
        }
     ],
     TableStatus:ACTIVE,
     CreationDateTime:   Mon May 12 18:45:57   EDT 2014,
     ProvisionedThroughput:{
        NumberOfDecreasesToday:0,
        ReadCapacityUnits:8,
        WriteCapacityUnits:4
     },
     TableSizeBytes:0,
     ItemCount:0,
     GlobalSecondaryIndexes:[
        {
           IndexName:TimestampIndex,
           KeySchema:[
              {
                 AttributeName:timestamp,
                 KeyType:HASH
              }
           ],
           Projection:{
              ProjectionType:ALL,
  
           },
           IndexStatus:ACTIVE,
           ProvisionedThroughput:{
              NumberOfDecreasesToday:0,
              ReadCapacityUnits:8,
              WriteCapacityUnits:4
           },
           IndexSizeBytes:0,
           ItemCount:0
        }
     ]
  }
  </code></pre>
  
  <p><strong>Code</strong></p>
  
  <pre><code>Condition condition1 = new Condition().withComparisonOperator(ComparisonOperator.GE).withAttributeValueList(new AttributeValue().withN(Long.toString(start)));      
  DynamoDBQueryExpression&lt;SitePageIndexed&gt; exp = new DynamoDBQueryExpression&lt;SitePageIndexed&gt;().withRangeKeyCondition("timestamp", condition1);
  exp.setScanIndexForward(true);
  exp.setLimit(100);
  exp.setIndexName("TimestampIndex");
  
  PaginatedQueryList&lt;SitePageIndexed&gt; queryList = client.query(SitePageIndexed.class,exp);
  </code></pre>