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 C9F9397C5 for ; Fri, 12 Dec 2014 08:11:13 +0000 (UTC) Received: (qmail 13028 invoked by uid 500); 12 Dec 2014 08:11:13 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 12990 invoked by uid 500); 12 Dec 2014 08:11:13 -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 12979 invoked by uid 99); 12 Dec 2014 08:11:13 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Dec 2014 08:11:13 +0000 Date: Fri, 12 Dec 2014 08:11:13 +0000 (UTC) From: "Sylvain Lebresne (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CASSANDRA-8374) Better support of null for UDF 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-8374?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14243857#comment-14243857 ] Sylvain Lebresne commented on CASSANDRA-8374: --------------------------------------------- I'm not exactly sure how a default value will work in practice (especially in the example you gave above where it's only on the first argument) so I'd much rather left that out of this ticket (and frankly, I'd rather left it out completely at least for now: let's be careful to not feature creep UDF before we have even released the first version). As for the {{ALLOW NULLS}} flag, I was initially leaning towards a single per-function one for the conceptual simplicity (and I'm not sure very fine grained control on this is really that useful in practice). Not a terribly strong preference however. > Better support of null for UDF > ------------------------------ > > Key: CASSANDRA-8374 > URL: https://issues.apache.org/jira/browse/CASSANDRA-8374 > Project: Cassandra > Issue Type: Bug > Reporter: Sylvain Lebresne > Assignee: Robert Stupp > Fix For: 3.0 > > > Currently, every function needs to deal with it's argument potentially being {{null}}. There is very many case where that's just annoying, users should be able to define a function like: > {noformat} > CREATE FUNCTION addTwo(val int) RETURNS int LANGUAGE JAVA AS 'return val + 2;' > {noformat} > without having this crashing as soon as a column it's applied to doesn't a value for some rows (I'll note that this definition apparently cannot be compiled currently, which should be looked into). > In fact, I think that by default methods shouldn't have to care about {{null}} values: if the value is {{null}}, we should not call the method at all and return {{null}}. There is still methods that may explicitely want to handle {{null}} (to return a default value for instance), so maybe we can add an {{ALLOW NULLS}} to the creation syntax. -- This message was sent by Atlassian JIRA (v6.3.4#6332)