Closed sundy-li closed 1 year ago
/assignme abs function
/assignme ABS() Return the absolute value
you can comment like: /assignme abs functions to make this subtask assigned to you.
hmm, i tried /assignme abs functions
but it assigned this issue to me but not the subtask, is this behaviour as expected?
you can comment like: /assignme abs functions to make this subtask assigned to you.
hmm, i tried
/assignme abs functions
but it assigned this issue to me but not the subtask, is this behaviour as expected?
I guess it's OK, @sundy-li will maintain this issue :)
PI() Return the value of pi
take this
/assignme rand() function
/assignme sin() cos() cot() tan() function
/assignme LOG(), LOG10(), LOG2()
/assignme crc32()
/assignme DEGREES() RADIANS()
/assignme ACOS() ASIN() ATAN() ATAN2()
/assignme CEIL() CEILING() FLOOR()
/assignme sign() function
/assignme ROUND() Round the argument
/assignme POW() POWER()
/assignme TRUNCATE() Truncate to specified number of decimal places
/assignme DIV Integer division
hi @sundy-li , Can you update the issue? CONV DIV RAND is wip, others have been completed.
/assignme rand() function
I need to unassign this task for now. Sorry I should manage my task list more sensibly.
also, @Junnplus would you be interested in taking it?
/assignme rand() function
@PsiACE @sundy-li I am working on DIV operator. To finish it I need a help:
DIV
operator reqs change of sqlparser-rs
. So I did it and submit PR (https://github.com/datafuse-extras/sqlparser-rs/pull/9/files) pls take a look...DIV
operator would be simple if databend /
operator comply with mysql
, especially for case when delimiter is 0
:
mysql -uroot -e 'SELECT 1 / 0'
+-------+
| 1 / 0 |
+-------+
| NULL |
+-------+
mysql -h0.0.0.0 -P3307 -uroot -e 'SELECT 1 / 0' +---------+ | (1 / 0) | +---------+ | inf | +---------+
That complicate 'SELECT 1 DIV 0' case much.
I can share my code without support of SELECT 1 DIV 0 for now...with hope databend change `/ 0` in nearest feature.
@mshauneu we can have a new function named intDiv
and map the div
operator into this function.
For MySQL return NULL if divided by zero, it's related to config ERROR_FOR_DIVISION_BY_ZERO
in MySQL. This config will not be introduced in databend, it's too complicated.
I think it is ok to output inf
, because 3/0 = 3.0f64/0.0f64 = f64::INFINITY. Some design of MySQL is poor, no need to be compatible with that.
@soyeric128 Please take a look at this issue.
@soyeric128 Please take a look at this issue.
We will use other issues to track the doc.
Summary
From MySQL docs in https://dev.mysql.com/doc/refman/8.0/en/numeric-functions.html
Tasks list:
If you are interested in one or more tasks in this issue, you can comment like:
/assignme abs functions
to make this subtask assigned to you, then I'll mark that as wip.