cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "vincent royer (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-13267) Add new CQL functions
Date Thu, 16 Mar 2017 21:35:42 GMT

    [ https://issues.apache.org/jira/browse/CASSANDRA-13267?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15928942#comment-15928942
] 

vincent royer commented on CASSANDRA-13267:
-------------------------------------------

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
registers 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
>
>
> 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)

Mime
View raw message