Forum: Building VoltDB Applications

Post: ORDER BY with complex expressions

ORDER BY with complex expressions
whitesensless
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?

Cheers,
Johannes
re: ORDER BY with complex expressions
tcallaghan
Jul 8, 2010
Johannes,

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 http://issues.voltdb.com/browse/ENG-282, it is a high priority issue.

-Tim