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 1C48C18BFC for ; Sun, 27 Dec 2015 22:21:50 +0000 (UTC) Received: (qmail 10694 invoked by uid 500); 27 Dec 2015 22:21:50 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 10656 invoked by uid 500); 27 Dec 2015 22:21:49 -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 10645 invoked by uid 99); 27 Dec 2015 22:21:49 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 27 Dec 2015 22:21:49 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id BDED12C1F56 for ; Sun, 27 Dec 2015 22:21:49 +0000 (UTC) Date: Sun, 27 Dec 2015 22:21:49 +0000 (UTC) From: "DOAN DuyHai (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CASSANDRA-10783) Allow literal value as parameter of UDF & UDA 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-10783?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15072266#comment-15072266 ] DOAN DuyHai commented on CASSANDRA-10783: ----------------------------------------- Ok I see, the usage of bound values and type casting is only available in a programmatic context. It will not work with cqlsh > Allow literal value as parameter of UDF & UDA > --------------------------------------------- > > Key: CASSANDRA-10783 > URL: https://issues.apache.org/jira/browse/CASSANDRA-10783 > Project: Cassandra > Issue Type: Improvement > Components: CQL > Reporter: DOAN DuyHai > Assignee: Robert Stupp > Priority: Minor > Labels: CQL3, UDF, client-impacting, doc-impacting > Fix For: 3.x > > > I have defined the following UDF > {code:sql} > CREATE OR REPLACE FUNCTION maxOf(current int, testValue int) RETURNS NULL ON NULL INPUT > RETURNS int > LANGUAGE java > AS 'return Math.max(current,testValue);' > CREATE TABLE maxValue(id int primary key, val int); > INSERT INTO maxValue(id, val) VALUES(1, 100); > SELECT maxOf(val, 101) FROM maxValue WHERE id=1; > {code} > I got the following error message: > {code} > SyntaxException: > {code} > It would be nice to allow literal value as parameter of UDF and UDA too. > I was thinking about an use-case for an UDA groupBy() function where the end user can *inject* at runtime a literal value to select which aggregation he want to display, something similar to GROUP BY ... HAVING -- This message was sent by Atlassian JIRA (v6.3.4#6332)