[ 
https://issues.apache.org/jira/browse/CASSANDRA-10826?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

C. Scott Andreas updated CASSANDRA-10826:
-----------------------------------------
    Component/s: Documentation and Website

> 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
>          Components: Documentation and Website
>            Reporter: Michael Penick
>            Assignee: Robert Stupp
>            Priority: Major
>              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
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to