You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@phoenix.apache.org by Stan Campbell <st...@gmail.com> on 2014/03/28 17:40:52 UTC

MOD function?

Looks like there is no modulo function or operator in the Phoenix syntax?

I guess I'll have to do this programmatically but I was hoping to update
rows based on an UPSERT/SELECT.

Re: MOD function?

Posted by James Taylor <ja...@apache.org>.
No, but that would be a nice addition if you're up for contributing it. You
could add a "%" to the grammar, add a new ModuloParseNode, and implement a
ModuloExpression, and modify ExpressionCompiler. It'd be very similar (and
a sibling to the  MultiplyParseNode/MultiplyExpression.

Thanks,
James


On Fri, Mar 28, 2014 at 9:40 AM, Stan Campbell <st...@gmail.com>wrote:

> Looks like there is no modulo function or operator in the Phoenix syntax?
>
> I guess I'll have to do this programmatically but I was hoping to update
> rows based on an UPSERT/SELECT.
>