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 0FD4819A1D for ; Mon, 21 Mar 2016 15:29:31 +0000 (UTC) Received: (qmail 17944 invoked by uid 500); 21 Mar 2016 15:29:30 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 16428 invoked by uid 500); 21 Mar 2016 15:29:25 -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 16415 invoked by uid 99); 21 Mar 2016 15:29:25 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Mar 2016 15:29:25 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 7D4C22C1F61 for ; Mon, 21 Mar 2016 15:29:25 +0000 (UTC) Date: Mon, 21 Mar 2016 15:29:25 +0000 (UTC) From: "Sylvain Lebresne (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CASSANDRA-11392) Add auto import java.util for UDF code block 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-11392?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Sylvain Lebresne updated CASSANDRA-11392: ----------------------------------------- Priority: Minor (was: Major) > Add auto import java.util for UDF code block > -------------------------------------------- > > Key: CASSANDRA-11392 > URL: https://issues.apache.org/jira/browse/CASSANDRA-11392 > Project: Cassandra > Issue Type: Improvement > Components: CQL > Environment: C* 3.4 > Reporter: DOAN DuyHai > Priority: Minor > > Right now, when creating Java source code for UDF, since we cannot define import, we need to use fully qualified class name, ex: > {noformat} > CREATE FUNCTION toSet(li list) > CALLED ON NULL INPUT > RETURNS text > LANGUAGE java > AS $$ > java.util.Set set = new java.util.HashSet(); > for(String txt: list) { > set.add(txt); > } > return set; > $$; > {noformat} > Classes from {{java.util}} package are so commonly used that it makes developer life easier to import automatically {{java.util.*}} in the {{JavaUDF}} base class so that developers don't need to use FQCN for common classes. > The only drawback I can see is the risk of class name clash but since: > 1. it is not allow to create new class > 2. classes that can be used in UDF are restricted > I don't see serious clash name issues either > [~snazy] WDYT ? > -- This message was sent by Atlassian JIRA (v6.3.4#6332)