Better error message when order by is used with 2ndary indexes

This commit is contained in:
Sylvain Lebresne 2012-11-26 16:38:23 +01:00
parent d0292ef45a
commit cb7a231a2f
1 changed files with 3 additions and 0 deletions

View File

@ -1115,6 +1115,9 @@ public class SelectStatement implements CQLStatement
if (!stmt.parameters.orderings.isEmpty())
{
if (!stmt.metadataRestrictions.isEmpty())
throw new InvalidRequestException("ORDER BY with 2ndary indexes is not supported.");
if (stmt.isKeyRange())
throw new InvalidRequestException("ORDER BY is only supported when the partition key is restricted by an EQ or an IN.");