Hi Sanjiva, We used the alias 'custom' because we implemented these as custom extensions to Siddhi. Anyway 'math' would be the more meaningful alias. +1 for 'math:'
On Sat, Oct 18, 2014 at 11:09 AM, Sanjiva Weerawarana <[email protected]> wrote: > Great - but why "custom:". Can we not use "math:"?? > > On Wed, Oct 15, 2014 at 5:34 PM, Lahiru Cooray <[email protected]> wrote: > >> Hi, >> >> We have implemented below Math operations (all the Math operations available >> in Hive) as extensions to Siddhi engine. >> >> round(DOUBLE a)round(DOUBLE a, INT d)floor(DOUBLE a)ceil(DOUBLE a), >> ceiling(DOUBLE a)rand(), rand(INT seed)exp(DOUBLE a), exp(DECIMAL a)ln(DOUBLE >> a), ln(DECIMAL a)log10(DOUBLE a), log10(DECIMAL a)log2(DOUBLE a), >> log2(DECIMAL a)log(DOUBLE base, DOUBLE a) >> log(DECIMAL base, DECIMAL a)pow(DOUBLE a, DOUBLE p), power(DOUBLE a, >> DOUBLE p)sqrt(DOUBLE a), sqrt(DECIMAL a)bin(BIGINT a)hex(BIGINT a) >> hex(STRING a) hex(BINARY a)unhex(STRING a)conv(BIGINT num, INT >> from_base, INT to_base), conv(STRING num, INT from_base, INT >> to_base)abs(DOUBLE >> a)pmod(INT a, INT b), pmod(DOUBLE a, DOUBLE b)sin(DOUBLE a), sin(DECIMAL >> a)asin(DOUBLE a), asin(DECIMAL a)cos(DOUBLE a), cos(DECIMAL a)acos(DOUBLE >> a), acos(DECIMAL a)tan(DOUBLE a), tan(DECIMAL a)atan(DOUBLE a), >> atan(DECIMAL a)degrees(DOUBLE a), degrees(DECIMAL a)radians(DOUBLE a), >> radians(DOUBLE a)positive(INT a), positive(DOUBLE a)negative(INT a), >> negative(DOUBLE a)sign(DOUBLE a), sign(DECIMAL a)e()pi() >> >> >> Eg:You can use the operations as below: >> >> *from InStreamSample1* >> *select custom:pi()* >> *insert into OutStreamSample1;* >> >> *from InStreamSample1* >> *select custom:tan(parameter1)* >> *insert into OutStreamSample1;* >> >> *from InStreamSample1* >> *select custom:pmod(parameter1,parameter2)* >> *insert into OutStreamSample1;* >> >> >> We used built-in math operations available in java.lang.Math package and >> we have implemented the operations which are not available in the >> mentioned package (eg: pmod, positive,negative,unhex etc). >> Separate classes were created for each math operation/extension and >> custom function names are as same as the operation names in >> java.lang.Math. >> >> Appreciate if someone could point out if there are any other >> missing/needed operations or any improvements regarding this.. >> >> >> Thanks, >> -- >> *Lahiru Cooray* >> Software Engineer >> WSO2, Inc.;http://wso2.com/ >> lean.enterprise.middleware >> >> Mobile: +94 715 654154 >> >> _______________________________________________ >> Architecture mailing list >> [email protected] >> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture >> >> > > > -- > Sanjiva Weerawarana, Ph.D. > Founder, Chairman & CEO; WSO2, Inc.; http://wso2.com/ > email: [email protected]; office: (+1 650 745 4499 | +94 11 214 5345) > x5700; cell: +94 77 787 6880 | +1 408 466 5099; voip: +1 650 265 8311 > blog: http://sanjiva.weerawarana.org/; twitter: @sanjiva > Lean . Enterprise . Middleware > > _______________________________________________ > Architecture mailing list > [email protected] > https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture > > -- *Lahiru Cooray* Software Engineer WSO2, Inc.;http://wso2.com/ lean.enterprise.middleware Mobile: +94 715 654154
_______________________________________________ Architecture mailing list [email protected] https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
