[
https://issues.apache.org/jira/browse/CASSANDRA-6870?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13940155#comment-13940155
]
Edward Capriolo commented on CASSANDRA-6870:
--------------------------------------------
Cool I have enhanced the feature. The code is a bit sloppy but you might get
the idea.
So before we were operating on the entire slice. What id we wish to operate
only on certain columns in the slice?
{code}
struct ColumnTransform {
1: optional list<binary> input_columns,
2: optional binary output_column,
3: optional string function_name
}
struct TransformRequest {
1: optional binary key,
2: optional string column_family,
3: optional string function_name,
4: optional map<binary,binary> function_properties
5: optional cassandra.ConsistencyLevel
serial_consistency_level=cassandra.ConsistencyLevel.SERIAL,
6: optional cassandra.ConsistencyLevel
commit_consistency_level=cassandra.ConsistencyLevel.QUORUM,
7: optional cassandra.SlicePredicate predicate,
8: optional list<ColumnTransform> column_transform
}
{code}
The UDF interface looks like this:
{code}
public abstract class AbstractUdf {
public abstract Cell evaluate(Cell ... input);
}
{code}
This makes more sense now especially in the CQL case. The transformer operates
on ever column in the slice, and the udf takes a list 0 - many columns and
produces 1 column output .
> Transform operation
> -------------------
>
> Key: CASSANDRA-6870
> URL: https://issues.apache.org/jira/browse/CASSANDRA-6870
> Project: Cassandra
> Issue Type: New Feature
> Reporter: Edward Capriolo
> Assignee: Edward Capriolo
> Priority: Minor
>
> Compare and swap uses paxos to only update a value only if some criteria is
> met. If I understand correctly we should be able to use this feature to
> provide a wider variety of server side operations.
> For example inside a paxos transaction performing a slice and then using a
> function to manipulate the slice. You could accomplish features like append
> and increment this way without user needing to know the current value.
> I took a stab at doing this. I **think** I did it correctly. Comments welcome.
--
This message was sent by Atlassian JIRA
(v6.2#6252)