How do I achieve something like this in the evaluate()?

MyType.evaluate({projection: “column_c, sum(column_a) / sum(column_b) as price” , group: “column_c”, order: “descending( price)”})

the above command is currently throwing an error.

How do I achieve something like this in the evaluate()?

MyType.evaluate({projection: “column_c, sum(column_a) / sum(column_b) as price” , group: “column_c”, order: “descending( price)”})

the above command is currently throwing an error.

@trothwein It says Projection must appear in the group spec: sum(column_a) / sum(column_b)

@venkata.paruchuri I see. This is due to the attempt to use the alias “price”. That is not supported.

@trothwein I removed alias. That was just used as an example to tell what I was doing.

This is what I have tried:

MyType.evaluate({projection: “column_c, sum(column_a) / sum(column_b)” , group: “column_c”, order: “sum(column_a) / sum(column_b)”})

@venkata Can you file a ticket and, if possible, provide a branch with the type as you have defined it? This will require some investigation.

@venkata.paruchuri This was a bug where we wern’t interpreting the arithmetic expressions involving multiple aggregates as aggregate expressions. I am testing a fix now.