[feature](functions) impl scalar functions normal_cdf,to_iso8601,from_iso8601_date (#40695 and #41075) #41600
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
bp #40695 and #41075
#41075 : fix #40695 mac compile
Proposed changes
Added three functions:
normal_cdf
,to_iso8601
,from_iso8601_date
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).
to_iso8601(DATE/DATETIME) → string
For
DATE
type, it will be converted toYYYY-MM-DD
.For
DATETIME
type, it will be converted toYYYY-MM-DDThh:mm:ss.xxxxxx
.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.