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 0C7B810671 for ; Wed, 4 Dec 2013 16:01:42 +0000 (UTC) Received: (qmail 87894 invoked by uid 500); 4 Dec 2013 16:01:41 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 86078 invoked by uid 500); 4 Dec 2013 16:01:39 -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 85886 invoked by uid 99); 4 Dec 2013 16:01:37 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Dec 2013 16:01:37 +0000 Date: Wed, 4 Dec 2013 16:01:37 +0000 (UTC) From: "Nicolas Favre-Felix (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CASSANDRA-6412) Custom creation and merge functions for user-defined column types 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-6412?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13839028#comment-13839028 ] Nicolas Favre-Felix commented on CASSANDRA-6412: ------------------------------------------------ Thanks for the feedback, [~slebresne]. I like your suggestion to use user-defined types, this is definitely better than the home-made candlestick structure. I also like that having fixed types with custom resolver makes it easier to write type-safe code with minimal changes to the Cassandra code base. As you point out, we can use the same technique as for counter deletion. I understand that counter deletes are somewhat broken, and that columns with a custom resolver would suffer from a similar defect (CASSANDRA-2774). I don't think that there is an easy solution to this problem; only deleting al CL.ALL would prevent old values from being merged with newer ones. > Custom creation and merge functions for user-defined column types > ----------------------------------------------------------------- > > Key: CASSANDRA-6412 > URL: https://issues.apache.org/jira/browse/CASSANDRA-6412 > Project: Cassandra > Issue Type: New Feature > Components: Core > Reporter: Nicolas Favre-Felix > > This is a proposal for a new feature, mapping custom types to Cassandra columns. > These types would provide a creation function and a merge function, to be implemented in Java by the user. > This feature relates to the concept of CRDTs; the proposal is to replicate "operations" on these types during write, to apply these operations internally during merge (Column.reconcile), and to also merge their values on read. > The following operations are made possible without reading back any data: > * MIN or MAX(value) for a column > * First value for a column > * Count Distinct > * HyperLogLog > * Count-Min > And any composition of these too, e.g. a Candlestick type includes first, last, min, and max. > The merge operations exposed by these types need to be commutative; this is the case for many functions used in analytics. > This feature is incomplete without some integration with CASSANDRA-4775 (Counters 2.0) which provides a Read-Modify-Write implementation for distributed counters. Integrating custom creation and merge functions with new counters would let users implement complex CRDTs in Cassandra, including: > * Averages & related (sum of squares, standard deviation) > * Graphs > * Sets > * Custom registers (even with vector clocks) > I have a working prototype with implementations for min, max, and Candlestick at https://github.com/acunu/cassandra/tree/crdts - I'd appreciate any feedback on the design and interfaces. -- This message was sent by Atlassian JIRA (v6.1#6144)