[ 
https://issues.apache.org/jira/browse/CASSANDRA-10623?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14995207#comment-14995207
 ] 

Markus Stephanides commented on CASSANDRA-10623:
------------------------------------------------

Thanks for your answer!

So I wrote this function:

CREATE FUNCTION upper(v1 text)
       CALLED ON NULL INPUT
       RETURNS text
       LANGUAGE java
       AS ' return ((v1 == null) ? null : v1.toUpperCase()); ';

but when using it with this query:

select * from user where upper(username) = 'FOO';

It throws this error:
 line 1:30 no viable alternative at input '(' (select * from user where 
[upper](...)
  com.datastax.driver.core.exceptions.SyntaxError: SyntaxError: line 1:30 no 
viable alternative at input '(' (select * from user where [upper](...)

So how would you have done this, using a UDF?



> Text Functions
> --------------
>
>                 Key: CASSANDRA-10623
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-10623
>             Project: Cassandra
>          Issue Type: New Feature
>            Reporter: Markus Stephanides
>
> In SQL, there are functions that make comparing texts easier e.g UPPER() and 
> LOWER()
> I need this to compare a text in a WHERE clause of a SELECT statement with 
> case-insensitvity.
> Thank you in advance!



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to