<commit_before>create keyspace if not exists cimapplication with replication = {'class': 'SimpleStrategy', 'replication_factor': 2 };

create or replace function cimapplication.magnitude (real double, imag double)
    returns null on null input
    returns double
    language java
    as $$ return (Math.sqrt (real * real + imag * imag)); $$;

create or replace function cimapplication.phase (real double, imag double)
    returns null on null input
    returns double
    language java
    as $$ return (Math.atan2 (imag, real)); $$;

create or replace function cimapplication.radians2degrees (radians double)
    returns null on null input
    returns double
    language java
    as $$ return (radians / Math.PI * 180.0); $$;

create or replace function cimapplication.concat (s1 text, s2 text)
    returns null on null input
    returns text
    language java
    as $$ return (s1 + s2); $$;

create or replace function cimapplication.standard_deviation_state (state tuple<int,double,double>, val double)
    called on null input
    returns tuple<int,double,double>
    language java
    as $$
        TupleValue ret;
        if (null == state)
            ret = null;
        else
        {
            int n = state.getInt(0);
            double mean = state.getDouble(1);
            double m2 = state.getDouble(2);<commit_msg>Add UDF cosphi<commit_after>create keyspace if not exists cimapplication with replication = {'class': 'SimpleStrategy', 'replication_factor': 2 };

create or replace function cimapplication.magnitude (real double, imag double)
    returns null on null input
    returns double
    language java
    as $$ return (Math.sqrt (real * real + imag * imag)); $$;

create or replace function cimapplication.phase (real double, imag double)
    returns null on null input
    returns double
    language java
    as $$ return (Math.atan2 (imag, real)); $$;

create or replace function cimapplication.cosphi (real double, imag double)
    returns null on null input
    returns double
    language java
    as $$ return ( Math.cos(Math.atan2(imag, real)) ); $$;

create or replace function cimapplication.radians2degrees (radians double)
    returns null on null input
    returns double
    language java
    as $$ return (radians / Math.PI * 180.0); $$;

create or replace function cimapplication.concat (s1 text, s2 text)
    returns null on null input
    returns text
    language java
    as $$ return (s1 + s2); $$;

create or replace function cimapplication.standard_deviation_state (state tuple<int,double,double>, val double)
    called on null input
    returns tuple<int,double,double>
    language java
    as $$
        TupleValue ret;
        if (null == state)
            ret = null;
        else
        {
            int n = state.getInt(0);
            double mean = state.getDouble(1);
            double m2 = state.getDouble(2);
{'fraction_non_alphanumeric': 0.08654848800834203, 'fraction_numerical': 0.010775112964893988, 'mean_word_length': 2.969655172413793, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2135632', 'n_tokens_mistral': 791, 'n_tokens_neox': 778, 'n_words': 299}