cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michaël Figuière (JIRA) <j...@apache.org>
Subject [jira] [Updated] (CASSANDRA-8439) Consider using a symbol that won't have to be escaped around UDF's body
Date Mon, 08 Dec 2014 18:00:21 GMT

     [ https://issues.apache.org/jira/browse/CASSANDRA-8439?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Michaël Figuière updated CASSANDRA-8439:
----------------------------------------
    Description: 
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 {{\\}} 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.

  was:
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 {{\}} 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.


> 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 {{\\}} 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)

Mime
View raw message