Appendix B: Mapping of the Corresponding Analytics APIs

The following table links to analytics functions that are available in the indicated native language APIs:

C C++ SQL Python Java C#  
Unary Operations    
Produce a result sequence of the same type for operations: abs, neg, match    
mco_seq_abs_TYPE() abs() seq_abs( input ) abs() abs()    
mco_seq_neg_TYPE() operator - seq_neg( input ) neg() neq()    
mco_seq_match() match(char const* pattern)     match( pattern )    
Binary Operations    
Produce a result sequence of the same type for operations: add, sub, mul, div, mod, max, min    
mco_seq_add_TYPE() operator + seq_add( left, right ) add( input ) add( other )    
mco_seq_sub_TYPE() operator - seq_sub( left, right ) sub( input ) sub( other )    
mco_seq_mul_TYPE() operator * seq_mul( left, right ) mul( input ) mul( other )    
mco_seq_div_TYPE() operator / seq_div( left, right ) div( input ) div( other )    
mco_seq_mod_TYPE() operator % seq_mod( left, right ) mod( input ) mod( other )    
mco_seq_max_TYPE() max(Sequence<T> const& other)   max( input ) max( other )    
mco_seq_min_TYPE() min(Sequence<T> const& other)   min( input ) min( other )    
    seq_pow( left, right )        
    seq_maxof( left, right )        
    seq_minof( left, right )        
Comparison Operations    
Produce a result sequence of boolean values for the comparison operators: ==, !=, >, >=, <, <=    
mco_seq_eq_TYPE() operator == seq_eq( left, right ) eq( input ) eq( other )    
mco_seq_ne_TYPE() operator != seq_ne( left, right ) ne( input ) ne( other )    
mco_seq_gt_TYPE() operator > seq_gt( left, right ) gt( input ) gt( other )    
mco_seq_ge_TYPE() operator >= seq_ge( left, right ) ge( input ) ge( other )    
mco_seq_lt_TYPE() operator < seq_lt( left, right ) lt( input ) lt( other )    
mco_seq_le_TYPE() operator <= seq_le( left, right ) le( input ) le( other )    
Logical Operations    
Produce a result sequence of boolean values from the logical operators: not, and, or, xor    
mco_seq_not() operator != seq_not( input ) not() not()    
mco_seq_and() operator && seq_and( left, right ) and( input ) and( other )    
mco_seq_or() operator || mco_seq_or( left, right ) or( input ) or( other )    
mco_seq_xor() operator ^ mco_seq_xor( left, right ) xor( input ) xor( other )    
Conversion Operations    
Convert the sequence elements to the desired type    
    seq_integer( input )        
    seq_real( input )        
      cast( typeid ) cast( type )    
      convert( typeid )      
Collapse Operations
Collapse two sequences to scalar values such as: weighted sum, weighted average, covariance, correlation    
mco_seq_wsum_TYPE() wsum( weights ) seq_wsum( left, right ) wsum( input ) wsum( weights )    
mco_seq_wavg_TYPE() wavg( weights ) seq_wavg( left, right ) wavg( input ) wavg( weights )    
mco_seq_cov_TYPE() cov( other ) seq_cov( left, right ) cov( input ) cov( other )    
mco_seq_corr_TYPE() corr( other ) seq_corr( left, right ) corr( input ) corr( other )    
Conditional Operations    
Perform operations on one or two input sequences based on a condition such as: if, iif, filter, filter_pos    
mco_seq_iif_TYPE() iif( then, else ) seq_iif( cond, then, else ) iif( then, else) iif( then, otherwise, boolean lazy)    
mco_seq_if_TYPE() cond( then, else ) seq_if( cond, then, else ) if( then, else)      
mco_seq_filter_TYPE() filter( input ) seq_filter( cond, input ) filter( input ) filter( cond )    
mco_seq_filter_pos() filterPos() seq_filter_pos( cond )


Sequence Manipulator Operations    
Perform various manipulations of input sequences    
mco_seq_filter_first_pos()       firstPosition()    
mco_seq_reverse_TYPE() reverse() seq_reverse( input ) reverse() reverse()    
mco_seq_cat()       cat( other )    
mco_seq_concat() concat( other) also operator, seq_concat( input1, input2 ) concat( input ) concat( tail )    
    seq_subseq( input, from, till )        
mco_seq_limit_TYPE() limit( from, till) also operator()   limit( from, till ) limit( from, till )    
mco_seq_get_TYPE() get( result )   get( [size] ) get( buffer )    
mco_seq_unget_TYPE()     unget( input, elemtype [, elemsize] )      
mco_seq_uniq_TYPE() unique() seq_unique( input ) uniq() unique()    
mco_seq_norm_TYPE() norm() seq_norm( input ) norm() normalize()    
mco_seq_thin_TYPE() thin( origin, step )   thin( origin, step ) thin( origin, step )    
mco_seq_diff_TYPE() diff() seq_diff( input ) diff() diff()    
mco_seq_const_TYPE()     const( value, elemtype [,elemsize] ) constant( val, type )    
mco_seq_trend_TYPE()   seq_trend( input ) trend() trend()    
    seq_ceil( input )        
    seq_floor( input )        
mco_seq_join_TYPE()     join()      
mco_seq_tee_TYPE()     tee() tee()    
mco_seq_union_TYPE() combine( other, order )          
mco_seq_map_TYPE() map( positions) also operator[]     map( positions )    
mco_seq_repeat_TYPE() repeat( nTimes ) seq_repeat( n_times ) repeat( n_times ) repeat( count )    
mco_seq_stretch_TS_TYPE_VAL_TYPE() stretch( ts1, ts2, fille r) seq_stretch()   stretch( ts1, ts2, filler)    
mco_seq_stretch0_TS_TYPE_VAL_TYPE() stretch0( ts1, ts2, filler ) seq_stretch0()   stretch0( ts1, ts2, filler)    
mco_seq_asof_join_TS_TYPE_VAL_TYPE() asofJoin( ts1, ts2 ) seq_asof_join()   asofJoin( ts1, ts2 )    
mco_seq_cross_TYPE() cross( first_cross_direction ) seq_cross() cross( cross_direction ) cross( firstCrossDirection )    
mco_seq_extrema_TYPE() extrema( first_extremum ) seq_extrema() extrema( first_extremum ) extrema( firstExtremum )    
      tonparray( field1, ... )      
        hash(), hash( other )    
Iterator Operations    
Extract values from and reset sequence iterators such as: next, reset    
mco_seq_next_TYPE() next( val ) also operator++   next() next(), nextInt(), nextLong(), nextFloat(), nextBytes(), nextString(), nextDate()    
mco_seq_reset_iterator() reset()   reset() reset()    
Generated C API functions:            
classname_fieldname_first()   seq_first_int(), seq_first_real() first()      
classname_fieldname_last()   seq_last_int(), seq_last_real() last()      
classname_fieldname_subseq()   seq_subseq( input, from, till ) subseq( from, till )      
classname_fieldname_append()     append( values )      
classname_fieldname_insert()     insert( values )      
classname_fieldname_delete()     delete( from, till )      
classname_fieldname_search()   seq_search( input, from, to ) search( from, boundary_from, to, boundary_to )      
    seq_search_first( input, from, limit )        
    seq_search_last( input, to, limit )        
classname_fieldname_count() count() seq_count() count()      
classname_fieldname_map()   seq_map() map(...) map( positions )    
classname_fieldname_project()   seq_project() project( field1, ... )      
classname_fieldname_store()     store( other )      
Top Operations    
Return the top n sequence elements (or their positions): top_max, top_min, top_pos_max, top_pos_min    
mco_seq_top_max_TYPE() topMax( n ) seq_top_max() top_max( n ) topMax( top )    
mco_seq_top_min_TYPE() topMin( n ) seq_top_min() top_min( n ) topMin( top )    
mco_seq_top_pos_max_TYPE() topPosMax( n ) seq_top_pos_max() top_pos_max( n ) topPosMax( top )    
mco_seq_top_pos_min_TYPE() topPosMin( n ) seq_top_pos_min() top_pos_min( n ) topPosMin( top )    

RLE Operations

Perform Run Length Encryption (RLE) operations: count, decode, is_rle    
mco_seq_rle_count() rleCount( pos )          
mco_seq_is_rle()       isRLE()    
mco_seq_rle_decode() rleDecode()     rleDecode()    
Grand Aggregate Operations    
The result of all grand aggregates is returned as a double value regardless of what the actual element type of the result sequence.    
mco_seq_agg_count() count() seq_count() agg_count() aggCount()    
mco_seq_agg_max_TYPE() aggMax() seq_max() agg_max() aggMax()    
mco_seq_agg_min_TYPE() aggMin() seq_min() agg_min() aggMin()    
mco_seq_agg_min_max_TYPE()     agg_min_max() aggMinMax()    
mco_seq_agg_sum_TYPE() aggSum() seq_sum() agg_sum() aggSum()    
mco_seq_agg_prd_TYPE() aggPrd() seq_prd() agg_prd() aggPrd()    
mco_seq_agg_avg_TYPE() aggAvg() seq_avg() agg_avg() aggAvg()    
mco_seq_agg_var_TYPE() aggVar() seq_var() agg_var() aggVar()    
mco_seq_agg_var_samp_TYPE() aggVarSamp() seq_var_samp() agg_var_samp() aggVarSamp()    
mco_seq_agg_dev_TYPE() aggDev() seq_dev() agg_dev() aggDev()    
mco_seq_agg_dev_samp_TYPE() aggDevSamp() seq_dev_samp() agg_dev_samp() aggDevSamp()    
mco_seq_agg_approxdc() approxDistinctCount() seq_approxdc() agg_approxdc() aggApproxDC()    
mco_seq_agg_approxdc_hash()     approxdc_hash() aggApproxHashDC()    
Group-By Aggregate Operations    
Split the input sequence into groups based on the values of a group_by argument    
mco_seq_group_agg_count() groupAggCount() seq_group_agg_count() group_agg_count( group_by ) groupAggCount()    
mco_seq_group_agg_max_TYPE() groupAggMax() seq_group_agg_max() group_agg_max( group_by ) groupAggMax( groupBy )    
mco_seq_group_agg_min_TYPE() groupAggMin() seq_group_agg_min() group_agg_min( group_by ) groupAggMin( groupBy )    
mco_seq_group_agg_first_TYPE() groupAggFirst() seq_group_agg_first() group_agg_first( group_by ) groupAggFirst( groupBy )    
mco_seq_group_agg_last_TYPE() groupAggLast() seq_group_agg_last() group_agg_last( group_by ) groupAggLast( groupBy )    
mco_seq_group_agg_sum_TYPE() groupAggSum() seq_group_agg_sum() group_agg_sum( group_by ) groupAggSum( groupBy )    
mco_seq_group_agg_avg_TYPE() groupAggAvg() seq_group_agg_avg() group_agg_avg( group_by ) groupAggAvg( groupBy )    
mco_seq_group_agg_var_TYPE() groupAggVar() seq_group_agg_var() group_agg_var( group_by ) groupAggVar( groupBy )    
mco_seq_group_agg_var_samp_TYPE() groupAggVarSamp() seq_group_agg_var_samp() group_agg_var_samp( group_by ) groupAggVarSamp( groupBy )    
mco_seq_group_agg_dev_TYPE() groupAggDev() seq_group_agg_dev() group_agg_dev( group_by ) groupAggDev( groupBy )    
mco_seq_group_agg_dev_samp_TYPE() groupAggDevSamp() seq_group_agg_dev_samp() group_agg_dev_samp( group_by ) groupAggDevSamp( groupBy )    
mco_seq_group_agg_approxdc() groupAggApproxDistinctCount() seq_group_agg_approxdc() group_agg_approxdc( group_by ) groupAggApproxDC( groupBy )    
mco_seq_group_agg_approxdc_hash() groupAggApproxDistinctHashValues()   group_agg_approxdc_hash( group_by ) groupAggApproxHashDC(SequenceIterator groupBy)    
mco_seq_group_agg_wavg_TYPE() groupAggWavg()   group_agg_wavg( group_by ) groupAggWavg( weight, groupBy )    
Grid Aggregate Operations    
Split the input sequence into intervals specified by the interval argument which determines the maximum number of elements in the group    
mco_seq_grid_agg_max_TYPE() gridAggMax() seq_grid_agg_max() grid_agg_max( interval ) gridAggMax( interval )    
mco_seq_grid_agg_min_TYPE() gridAggMin() seq_grid_agg_min() grid_agg_min( interval ) gridAggMin( interval )    
mco_seq_grid_agg_sum_TYPE() gridAggSum() seq_grid_agg_sum() grid_agg_sum( interval ) gridAggSum( interval )    
mco_seq_grid_agg_avg_TYPE() gridAggAvg() seq_grid_agg_avg() grid_agg_avg( interval ) gridAggAvg( interval )    
mco_seq_grid_agg_var_TYPE() gridAggVar() seq_grid_agg_var() grid_agg_var( interval ) gridAggVar( interval )    
mco_seq_grid_agg_var_samp_TYPE() gridAggVarSamp() seq_grid_agg_var_samp() grid_agg_var_samp( interval ) gridAggVarSamp( interval )    
mco_seq_grid_agg_dev_TYPE() gridAggDev() seq_grid_agg_dev() grid_agg_dev( interval ) gridAggDev( interval )    
mco_seq_grid_agg_dev_samp_TYPE() gridAggDevSamp() seq_grid_agg_dev_samp() grid_agg_dev_samp( interval ) gridAggDevSamp( interval )    
Window (Moving) Aggregate Operations    
Like the “Grid” functions illustrated above, however the interval argument indicates the next N elements from the input sequence    
mco_seq_window_agg_max_TYPE() windowAggMax() seq_window_agg_max() window_agg_max( interval ) windowAggMax( interval )    
mco_seq_window_agg_min_TYPE() windowAggMin() seq_window_agg_min() window_agg_min( interval ) windowAggMin( interval )    
mco_seq_window_agg_sum_TYPE() windowAggSum() seq_window_agg_sum() window_agg_sum( interval ) windowAggSum( interval )    
mco_seq_window_agg_avg_TYPE() windowAggAvg() seq_window_agg_avg() window_agg_avg( interval ) windowAggAvg( interval )    
mco_seq_window_agg_var_TYPE() windowAggVar() seq_window_agg_var() window_agg_var( interval ) windowAggVar( interval )    
mco_seq_window_agg_var_samp_TYPE() windowAggVarSamp() seq_window_agg_var_samp() window_agg_var_samp( interval ) windowAggVarSamp( interval )    
mco_seq_window_agg_dev_TYPE() windowAggDev() seq_window_agg_dev() window_agg_dev( interval ) windowAggDev( interval )    
mco_seq_window_agg_dev_samp_TYPE() windowAggDevSamp() seq_window_agg_dev_samp() window_agg_dev_samp( interval ) windowAggDevSamp( interval )    
mco_seq_window_agg_ema_TYPE()   seq_window_agg_ema()   windowAggEma( period )    
mco_seq_window_agg_atr_TYPE()   seq_window_agg_atr()   windowAggAtr( period )    
Hash Group-By Aggregate Operations    
Group the resulting sequence by a grouping sequence that is not ordered    
Hash Aggregate Operations    
These functions operate on a sequence obtained by the "hash aggregate group by" functions    
mco_seq_hash_agg_max_TYPE() hashAggMax() seq_hash_agg_max() hash_agg_max( ... ) hashAggMax( groupBy, nGroups )    
mco_seq_hash_agg_min_TYPE() hashAggMin() seq_hash_agg_min() hash_agg_min( ... ) hashAggMin( groupBy, nGroups )    
mco_seq_hash_agg_sum_TYPE() hashAggSum() seq_hash_agg_sum() hash_agg_sum( ... ) hashAggSum( groupBy, nGroups )    
mco_seq_hash_agg_avg_TYPE() hashAggAvg() seq_hash_agg_avg() hash_agg_avg( ... ) hashAggAvg( groupBy, nGroups )    
mco_seq_hash_agg_approxdc() hashAggApproxDistinctCount() seq_hash_agg_approxdc() hash_agg_approxdc( ... ) hashAggApproxdc( groupBy, nGroups )    
mco_seq_hash_agg_count() hashAggCount() seq_hash_agg_count() hash_agg_count( ... ) hashAggCount( nGroups )    
mco_seq_hash_agg_distinct_count() hashAggDistinctCount()   hash_agg_distinct_count( ... ) hashAggDistinctCount( groupBy, Groups, nPairs)    
mco_seq_hash_agg_dup_count() hashAggDupCount()   hash_agg_dup_count() hashAggDupCount( groupBy, nGroups, nPairs, minOccurrences)    
Cumulative Aggregate Operations    
Accumulate the average, sum, product, etc. of all preceding elements in the result sequence    
mco_seq_cum_agg_max_TYPE() cumAggMax() seq_cum_agg_max() cum_agg_max() cumAggMax()    
mco_seq_cum_agg_min_TYPE() cumAggMin() seq_cum_agg_min() cum_agg_min() cumAggMin()    
mco_seq_cum_agg_sum_TYPE() cumAggSum() seq_cum_agg_sum() cum_agg_sum() cumAggSum()    
mco_seq_cum_agg_prd_TYPE() cumAggPrd() seq_cum_agg_prd() cum_agg_prd() cumAggPrd()    
mco_seq_cum_agg_avg_TYPE() cumAggAvg() seq_cum_agg_avg() cum_agg_avg() cumAggAvg()    
mco_seq_cum_agg_var_TYPE() cumAggVar() seq_cum_agg_var() cum_agg_var() cumAggVar()    
mco_seq_cum_agg_var_samp_TYPE() cumAggVarSamp() seq_cum_agg_var_samp() cum_agg_var_samp() cumAggVarSamp()    
mco_seq_cum_agg_dev_TYPE() cumAggDev() seq_cum_agg_dev() cum_agg_dev() cumAggDev()    
mco_seq_cum_agg_dev_samp_TYPE() cumAggDevSamp() seq_cum_agg_dev_samp() cum_agg_dev_samp() cumAggDevSamp()    
Miscellaneous Operations    
Provide functionalities such as: sort, orderby, histogram, hash, func, func2, cond   hash
mco_seq_histogram_TYPE() histogram() seq_histogram() histogram( ... ) histogram( low, high, nIntervals)Miscellaneous_Methods.htm    
mco_seq_sort_TYPE() sort() seq_sort() sort( ... ) sort( arr, permutation, order)    
mco_seq_order_by_TYPE() permutate() seq_order_by() order_by( ... )      
mco_seq_hash()       hash()    
Apply a specific operation via function pointer to each sequence element    
mco_seq_func_TYPE() apply( func )   func( func, arg )      
mco_seq_func2_TYPE() apply( other, func )