title: AWS Error Code: ValidationException, AWS Error Message: Consistent reads are not supported on global secondary indexes
body: <p>I started using Amazon DynamoDB and have an issue with query.</p>
  
  <p>I have a table Dev_Testgame1_Mail with id as primary hash key and following three global secondary indexes,</p>
  
  <ol>
  <li>fromPlayerId (Hash Key)</li>
  <li>toPlayerId (Hash Key) + isRead (Range Key)</li>
  <li>toPlayerId (Hash Key) + endDate(Range Key)</li>
  </ol>
  
  <p>I have above code to do the query,</p>
  
  <pre><code>**DynamoDBMail hashKObject = new DynamoDBMail();
              hashKObject.setToPlayerId(playerId);
  Condition endDateRangeKeyCondition = new Condition();
              //endDateRangeKeyCondition.withComparisonOperator(ComparisonOperator.NULL).withAttributeValueList(new AttributeValue().withB(Utils.convertDateToByteBuffer(DateUtil.getUtcDateTime())));
              endDateRangeKeyCondition.withComparisonOperator(ComparisonOperator.NULL);
  
              DynamoDBQueryExpression&lt;DynamoDBMail&gt; queryExpression = new DynamoDBQueryExpression&lt;DynamoDBMail&gt;();
              queryExpression.withHashKeyValues(hashKObject).withRangeKeyCondition("endDate", endDateRangeKeyCondition);
              queryExpression.withIndexName("gsi_tp_enddt").withLimit(pageSize).withScanIndexForward(false);
              return dynamodbMapper.queryPage(DynamoDBMail.class, queryExpression, new DynamoDBMapperConfig(TableNameOverride.withTableNamePrefix(Utils.getDynamoDBTableNamePrefix(gameId, env))));**
  </code></pre>
  
  <p>And I get the following error,</p>
  
  <p><strong>com.amazonaws.AmazonServiceException: Status Code: 400, AWS Service: AmazonDynamoDBv2, AWS Request ID: GUUBV24K2O40T276R9NNN0EKB7VV4KQNSO5AEMVJF66Q9ASUAAJG, AWS Error Code: ValidationException, AWS Error Message: Consistent reads are not supported on global secondary indexes</strong></p>
  
  <p>Your help is much appreciated on this issue.</p>
  
  <p>Thanks
  Arun</p>