Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 66A5211A3C for ; Sat, 16 Aug 2014 08:26:19 +0000 (UTC) Received: (qmail 59231 invoked by uid 500); 16 Aug 2014 08:26:19 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 59204 invoked by uid 500); 16 Aug 2014 08:26:19 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 59185 invoked by uid 99); 16 Aug 2014 08:26:19 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 16 Aug 2014 08:26:19 +0000 Date: Sat, 16 Aug 2014 08:26:19 +0000 (UTC) From: "Robert Stupp (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CASSANDRA-7740) Parsing of UDF body is broken MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CASSANDRA-7740?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Robert Stupp updated CASSANDRA-7740: ------------------------------------ Attachment: 7740.txt Rebased against trunk > Parsing of UDF body is broken > ----------------------------- > > Key: CASSANDRA-7740 > URL: https://issues.apache.org/jira/browse/CASSANDRA-7740 > Project: Cassandra > Issue Type: Bug > Reporter: Sylvain Lebresne > Assignee: Robert Stupp > Fix For: 3.0 > > Attachments: 7740.txt > > > The parsing of function body introduced by CASSANDRA-7395 is somewhat broken. It blindly parse everything up to {{END_BODY}}, which as 2 problems: > # it parse function body as if it was part of the CQL syntax, so anything that don't happen to be a valid CQL token won't even parse. > # something like > {noformat} > CREATE FUNCTION foo() RETURNS text LANGUAGE JAVA BODY return "END_BODY"; END_BODY; > {noformat} > will not parse correctly. > I don't think we can accept random syntax like that. A better solution (which is the one Postgresql uses) is to pass the function body as a normal string. And in fact I'd be in favor of reusing Postgresql syntax (because why not), that is to have: > {noformat} > CREATE FUNCTION foo() RETURNS text LANGUAGE JAVA AS 'return "END_BODY"'; > {noformat} > One minor annoyance might be, for certain languages, the necessity to double every quote inside the string. But in a separate ticket we could introduce Postregsql solution of adding an [alternate syntax for string constants|http://www.postgresql.org/docs/9.1/static/sql-syntax-lexical.html#SQL-SYNTAX-DOLLAR-QUOTING]. -- This message was sent by Atlassian JIRA (v6.2#6252)