You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Robert Stupp (JIRA)" <ji...@apache.org> on 2014/12/08 20:41:18 UTC

[jira] [Comment Edited] (CASSANDRA-8439) Consider using a symbol that won't have to be escaped around UDF's body

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

Robert Stupp edited comment on CASSANDRA-8439 at 12/8/14 7:40 PM:
------------------------------------------------------------------

We already have pg-style strings (CASSANDRA-7769) to work around that escape-foo. You can code any string in CQL using pg-style syntax. E.g. {code}
SELECT * FROM foo WHERE key=$$this
is
my
key$$;
{code}


was (Author: snazy):
We already have pg-style strings (CASSANDRA-7769) to work around that escape-foo. You can code any string in CQL using pg-style syntax. E.g. {{SELECT * FROM foo WHERE key=$$this
is
my
key$$;}}

> Consider using a symbol that won't have to be escaped around UDF's body
> -----------------------------------------------------------------------
>
>                 Key: CASSANDRA-8439
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-8439
>             Project: Cassandra
>          Issue Type: Improvement
>            Reporter: Michaël Figuière
>
> Right now the CQL grammar defines the UDF's body as a {{STRING_LITERAL}}. I understand that this is convenient in the grammar and avoid creating a special type just for these bodies. But the problem is that a quote is a fairly common symbol in the programming languages that will be used inside this body, which means that the developer will need to escape all these quotes in the UDF's body. That will be fairly annoying, not quite readable and tedious to maintain (à la backslash in Java Regexes...).
> Could we consider using curly braces or parentheses as delimiters? Though, I don't realize how hard it would be to use such asymmetric delimiters in the ANTLR grammar while still allowing them to be used within the body of the UDF.
> Another symmetric delimiter could be considered instead otherwise.



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