[ 
https://issues.apache.org/jira/browse/CASSANDRA-17221?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17517172#comment-17517172
 ] 

Simon Chess commented on CASSANDRA-17221:
-----------------------------------------

I have made another commit: 
[https://github.com/xvade/cassandra/commit/dde89cacef20d64e67de2e236d14c3b2c25a639f|https://github.com/xvade/cassandra/commit/dde89cacef20d64e67de2e236d14c3b2c25a639f]

I added tests for all functions and types. I fixed as many many of the nits 
[~e.dimitrova] pointed out as I could.

I am not sure on how to proceed in adding documentation. Maybe it should go in 
doc/source/cql/operators.rst? Is there anything I need to know, or should I 
just try something?

I also did not remove the code in BigDecimalUtil. I think that the Cassandra 
project should use this code. The same code is in use in a number of other 
Apache 2 licensed projects on GitHub. Here's an example: 
[https://github.com/UCLA-SEAL/ExampleStack/blob/3578710c29e8b99f15a564b098b932369348efb7/code/Chrome-extension/SO-posts/745987.txt|https://github.com/UCLA-SEAL/ExampleStack/blob/3578710c29e8b99f15a564b098b932369348efb7/code/Chrome-extension/SO-posts/745987.txt]
 If you would prefer, I can try to contact the author to get express permission.

> Add Math functions 
> -------------------
>
>                 Key: CASSANDRA-17221
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-17221
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: CQL/Syntax
>            Reporter: Benjamin Lerer
>            Assignee: Simon Chess
>            Priority: Normal
>              Labels: AdventCalendar2021, lhf
>             Fix For: 4.x
>
>
> We should add native Maths functions for the most common operations:
> * {{abs\(x)}} returns the absolute value of the x
> * {{exp\(x)}} returns the value of e (the base of natural logarithms) raised 
> to the power of x
> * {{log\(x)}} returns the natural logarithm (base e) of x
> * {{log10\(x)}} returns the base-10 logarithm of x
> * {{round\(x)}} returns the closest integer to x
> +Additional information for newcomers:+
> The new functions should be put in a new class {{MathFcts}} similar to 
> {{TimeFcts}}.
> The {{MathsFcts.all()}} method should be called in 
> {{SystemKeyspace.functions}}
> The unit tests for the functions should be put in a {{MathFctsTest}} similar 
> to {{TimeFctsTest}} 



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to