Skip to content

Conversation

hubgeter
Copy link
Contributor

@hubgeter hubgeter commented Oct 9, 2024

bp #40695 and #41075
#41075 : fix #40695 mac compile

Proposed changes

Added three functions: normal_cdf, to_iso8601, from_iso8601_date

  1. normal_cdf(mean, sd, v) → double :
    Compute the Normal cdf with given mean and standard deviation (sd): P(N < value; mean, sd). The mean and value must be real values and the standard deviation must be a real and positive value (all of type DOUBLE).

  2. to_iso8601(DATE/DATETIME) → string
    For DATE type, it will be converted to YYYY-MM-DD.
    For DATETIME type, it will be converted to YYYY-MM-DDThh:mm:ss.xxxxxx.

  3. from_iso8601_date(string) → DATE
    Convert iso8601 string to DATE type.
    The supported iso8601 string formats are as follows:
    a. Year : YYYY
    b. Calendar dates : YYYY-MM-DD , YYYYMMDD , YYYY-MM
    c. Week dates : YYYY-Www , YYYYWww , YYYY-Www-D , YYYYWwwD
    d. Ordinal dates : YYYY-DDD , YYYYDDD
    You can refer to this document to understand what these formats mean
    Please note that:
    a. Each date and time value has a fixed number of digits that must be padded with leading zeros.
    b. The range of YYYY is 0001-9999.
    outside these rules, the correctness of the results is not guaranteed.

For illegal values, the result is NULL.

…_iso8601_date (apache#40695)

## Proposed changes
Added three functions: `normal_cdf`, `to_iso8601`, `from_iso8601_date`

1. `normal_cdf(mean, sd, v) → double` : 
Compute the Normal cdf with given mean and standard deviation (sd): P(N
< value; mean, sd). The mean and value must be real values and the
standard deviation must be a real and positive value (all of type
DOUBLE).


2. `to_iso8601(DATE/DATETIME) → string`
For `DATE` type, it will be converted to `YYYY-MM-DD`.
For `DATETIME` type, it will be converted to
`YYYY-MM-DDThh:mm:ss.xxxxxx`.


3. `from_iso8601_date(string) →  DATE`
Convert iso8601 string to `DATE` type.
The supported iso8601 string formats are as follows:
    a.  Year : YYYY
    b. Calendar dates : YYYY-MM-DD   , YYYYMMDD ,   YYYY-MM 
    c. Week dates : YYYY-Www  , YYYYWww  , YYYY-Www-D , YYYYWwwD
    d. Ordinal dates : YYYY-DDD , YYYYDDD
You can refer to this [document](https://en.wikipedia.org/wiki/ISO_8601)
to understand what these formats mean
Please note that:
a. Each date and time value has a fixed number of digits that must be
padded with leading zeros.
     b. The range of YYYY is 0001-9999.
outside these rules, the correctness of the results is not guaranteed.


For illegal values, the result is NULL.
…41075)

before pr : apache#40695 
## Proposed changes

Fix the bug that be will have this error when compiling on mac.
```
be/src/vec/functions/math.cpp:416:39: error: no member named 'numbers' in namespace 'std'
        constexpr double sqrt2 = std::numbers::sqrt2;
                                 ~~~~~^
1 error generated.
```
@doris-robot
Copy link

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR

Since 2024-03-18, the Document has been moved to doris-website.
See Doris Document.

@morningman
Copy link
Contributor

run buildall

@morningman morningman merged commit 7cb8661 into apache:branch-3.0 Oct 11, 2024
9 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants