Forum: Building VoltDB Applications

Post: ORDER BY with complex expressions

ORDER BY with complex expressions
Jul 7, 2010
Hi everybody,

I was trying a sql statement on VoltDB and it throws this error:

Failed to plan for stmt type(sql) SELECT CID, COUNT(*) AS PIS FROM ROH GROUP BY CID ORDER BY PIS DESC;

Error: "ORDER BY with complex expressions not yet supported"

What dies "complex expressions" mean?

Is there a work around? Maybe inside of the procedure?

It says "not yet supported", when will that be?

re: ORDER BY with complex expressions
Jul 8, 2010

VoltDB does not currently support "expressions" in the ORDER BY clause. An expression is anything that is not a discrete column name, so in your example you can order by CID but cannot order by COUNT(*).

For now, the work around is to issue the query without the order by and sort the results in your stored procedure or in your client application.

There is a ticket for this issue that you can view at, it is a high priority issue.