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 53A50112F7 for ; Fri, 18 Jul 2014 15:08:06 +0000 (UTC) Received: (qmail 11478 invoked by uid 500); 18 Jul 2014 15:08:05 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 11444 invoked by uid 500); 18 Jul 2014 15:08:05 -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 11428 invoked by uid 99); 18 Jul 2014 15:08:05 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Jul 2014 15:08:05 +0000 Date: Fri, 18 Jul 2014 15:08:05 +0000 (UTC) From: "Jonathan Ellis (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CASSANDRA-7526) Defining UDFs using scripting language directly from CQL 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-7526?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14066422#comment-14066422 ] Jonathan Ellis commented on CASSANDRA-7526: ------------------------------------------- bq. Recommend to support only JSR223 providers with compiled script support +1 bq. I don't think that we should support all possible languages - just concentrate on the important ones (need to vote for them and evaluate integration) Sounds messy. How many special cases do you anticipate once we restrict to jsr223? > Defining UDFs using scripting language directly from CQL > -------------------------------------------------------- > > Key: CASSANDRA-7526 > URL: https://issues.apache.org/jira/browse/CASSANDRA-7526 > Project: Cassandra > Issue Type: New Feature > Reporter: Sylvain Lebresne > > In CASSANDRA-7395 we'll introduce the ability to define user functions by dropping a java class server side. While this is a good first step and a good option to have in any case, it would be nice to provide a simpler way to define those functions directly from CQL. And while we probably don't want to re-invent a new programming language inside CQL, we can reuse one. Typically, with java 8, we could use nashorn. This would allow a syntax along the lines of: > {noformat} > CREATE FUNCTION sum (a bigint, b bigint) bigint AS { return a + b; } > {noformat} > Note that in this, everything before the AS will be parsed by us, which we'll probably want because we'll probably need to have the types of arguments/return in practice anyway, and it's a good idea to reuse CQL types. The expression after the AS will be given to Nashorn however. > Please note that in theory we could ultimately support multiple language after the AS. However, I'd like to focus on supporting just one for this ticket and I'm keen on using javascript through Nashorn because as it's the one that will ship with java from now on, it feels like a safe default. -- This message was sent by Atlassian JIRA (v6.2#6252)