Surely an error because the grammar definition for UPDATE does not mention any function call:
<update-stmt> ::= UPDATE <tablename> ( USING <option> ( AND <option> )* )? SET <assignment> ( ',' <assignment> )* WHERE <where-clause> ( IF <condition> ( AND condition )* )? <assignment> ::= <identifier> '=' <term> | <identifier> '=' <identifier> ('+' | '-') (<int-term> | <set-literal> | <list-literal>) | <identifier> '=' <identifier> '+' <map-literal> | <identifier> '[' <term> ']' '=' <term> <condition> ::= <identifier> '=' <term> | <identifier> '[' <term> ']' '=' <term> <where-clause> ::= <relation> ( AND <relation> )* <relation> ::= <identifier> '=' <term> | <identifier> IN '(' ( <term> ( ',' <term> )* )? ')' | <identifier> IN '?' <option> ::= TIMESTAMP <integer> | TTL <integer> Unless the grammar in the doc is itself not up-to-date.... Le 10 mars 2016 22:31, "Kim Liu" <k...@edgewaternetworks.com> a écrit : > Um, I’m not entirely sure how I misread it, since this was copy-pasted > from the document: > UPDATE atable SET col = some_function(?) …; > > So the document examples certainly seem to support the use of UDF in > UPDATE. I suppose the document may be more erroneous in its writing than > I in its misreading. > > Additionally, this statement works in cqlsh (presuming max_int() is a UDF): > UPDATE test_table SET data=max_int(3,4) WHERE idx='abc’; > > So, if the grammar is not supposed to allow this, then there is a bug > somewhere because in 3.3 it certainly seems to be parsed and executed > without complaint. > > —Kim > > > From: DuyHai Doan <doanduy...@gmail.com> > Reply-To: "user@cassandra.apache.org" <user@cassandra.apache.org> > Date: Thursday, March 10, 2016 at 13:21 > To: "user@cassandra.apache.org" <user@cassandra.apache.org> > Subject: Re: Using User Defined Functions in UPDATE queries > > You have misread the CQL doc given in the link. According to CQL update > grammar it's not possible to use UDF. I see UDF only allowed in select > clause... > >> >>