You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Michael Penick (JIRA)" <ji...@apache.org> on 2015/12/07 18:00:11 UTC
[jira] [Commented] (CASSANDRA-10826) frozen<> added to non-frozen
UDF/UDA argument types in schema metadata
[ https://issues.apache.org/jira/browse/CASSANDRA-10826?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15045236#comment-15045236 ]
Michael Penick commented on CASSANDRA-10826:
--------------------------------------------
I might have misunderstood the meaning of {{frozen<>}}, as it doesn't mean {{const}} or {{final}}. I think it means that it's an atomic piece of data that updated altogether. Regardless, it's still confusing that it's added implicitly to argument and return types of the above UDF.
> frozen<> added to non-frozen UDF/UDA argument types in schema metadata
> ----------------------------------------------------------------------
>
> Key: CASSANDRA-10826
> URL: https://issues.apache.org/jira/browse/CASSANDRA-10826
> Project: Cassandra
> Issue Type: Bug
> Reporter: Michael Penick
> Labels: client-impacting
>
> The function "avg_state" is created with a non-frozen tuple argument {{state}} and return type. It should be non-frozen because it's modified by the code in the body of the UDF.
> {code}
> CREATE KEYSPACE examples WITH replication = {
> 'class': 'SimpleStrategy', 'replication_factor': '3' };
> CREATE FUNCTION examples.avg_state(state tuple<int, bigint>, val int)
> CALLED ON NULL INPUT RETURNS tuple<int, bigint>
> LANGUAGE java AS
> 'if (val != null) {
> state.setInt(0, state.getInt(0) + 1);
> state.setLong(1, state.getLong(1) + val.intValue());
> }
> return state;'
> {code}
> However, the schema metadata has the both the {{state}} argument and the return type incorrectly defined as {{frozen<>}}:
> {code}
> cqlsh> SELECT argument_types, return_type FROM system_schema.functions WHERE keyspace_name = 'examples' AND function_name = 'avg_state';
> argument_types | return_type
> ---------------------------------------+----------------------------
> ['frozen<tuple<int, bigint>>', 'int'] | frozen<tuple<int, bigint>>
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)