Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 64833200C6D for ; Sun, 7 May 2017 17:34:09 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 6326F160BB1; Sun, 7 May 2017 15:34:09 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id B3D6B160B9A for ; Sun, 7 May 2017 17:34:08 +0200 (CEST) Received: (qmail 15923 invoked by uid 500); 7 May 2017 15:34:07 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 15912 invoked by uid 99); 7 May 2017 15:34:07 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 07 May 2017 15:34:07 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 5E4401A57AE for ; Sun, 7 May 2017 15:34:07 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id sjvmXtK67IcQ for ; Sun, 7 May 2017 15:34:06 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id BD0945FC85 for ; Sun, 7 May 2017 15:34:05 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 182A1E06C6 for ; Sun, 7 May 2017 15:34:05 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 4660921DF8 for ; Sun, 7 May 2017 15:34:04 +0000 (UTC) Date: Sun, 7 May 2017 15:34:04 +0000 (UTC) From: "vincent royer (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (CASSANDRA-13267) Add new CQL functions MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Sun, 07 May 2017 15:34:09 -0000 [ https://issues.apache.org/jira/browse/CASSANDRA-13267?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15928942#comment-15928942 ] vincent royer edited comment on CASSANDRA-13267 at 5/7/17 3:33 PM: ------------------------------------------------------------------- Well, deserializer.toString() returns a string representation that fit my needs (ByteType = signed decimal integer, BytesType = hexadecimal string), but as suggested by Sylvain, here is a working proposal to be able to support pluggable generic CQL functions, only for SELECT statement. By default, toJson would be the only registered generic function, but anyone could programmatically register other generic functions by calling GenericFunctionRegistry.registerFunction, or implements the IGenericFunction.Loader to automatically register functions available in the classpath. This would require to add a file META-INF/services/org.apache.cassandra.cql3.functions.IGenericFunction$Loader containing function classes (see java.util.ServiceLoader) and anyone could drop a jar file in cassandra lib directory to add some CQL generic functions (including my private weird functions, toString + toJsonArray ;-)). include unit tests OK was (Author: vroyer59): Well, deserializer.toString() returns a string representation that fit my needs (ByteType = signed decimal integer, BytesType = hexadecimal string), but as suggested by Sylvain, here is a working proposal to be able to support pluggable generic CQL functions, only for SELECT statement. By default, toJson would be the only registered generic function, but anyone could programmatically register other generic functions by calling GenericFunctionRegistry.registerFunction, or implements the IGenericFunction.Loader to automatically register functions available in the classpath. This would require to add a file META-INF/services/org.apache.cassandra.cql3.functions.IGenericFunction$Loader containing function classes (see java.util.ServiceLoader) and anyone could drop a jar file in cassandra lib directory to add some CQL generic functions (including my private weird functions, toString + toJsonArray ;-)). include unit tests OK, branch available at https://github.com/strapdata/cassandra/tree/cassandra-13267 > Add new CQL functions > --------------------- > > Key: CASSANDRA-13267 > URL: https://issues.apache.org/jira/browse/CASSANDRA-13267 > Project: Cassandra > Issue Type: Improvement > Components: CQL > Reporter: vincent royer > Priority: Trivial > Labels: features > Fix For: 3.0.x > > Attachments: 0001-CASSANDRA-13267-Add-CQL-functions.patch, 0001-CASSANDRA-13267-generic-function.patch > > > Introduce 2 new CQL functions : > -toString(x) converts a column to its string representation. > -toJsonArray(x, y, z...) generates a JSON array of JSON string. -- This message was sent by Atlassian JIRA (v6.3.15#6346) --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org For additional commands, e-mail: commits-help@cassandra.apache.org