-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[feature](functions) impl scalar functions normal_cdf,to_iso8601,from_iso8601_date (#40695) #41049
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feature](functions) impl scalar functions normal_cdf,to_iso8601,from_iso8601_date (#40695) #41049
Conversation
…_iso8601_date (apache#40695) 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.
|
Thank you for your contribution to Apache Doris. Since 2024-03-18, the Document has been moved to doris-website. |
|
run buildall |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
| return make_nullable(std::make_shared<DataTypeDateV2>()); | ||
| } | ||
|
|
||
| static Status execute(FunctionContext* context, Block& block, const ColumnNumbers& arguments, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: function 'execute' has cognitive complexity of 81 (threshold 50) [readability-function-cognitive-complexity]
static Status execute(FunctionContext* context, Block& block, const ColumnNumbers& arguments,
^Additional context
be/src/vec/functions/function_timestamp.cpp:1443: +1, including nesting penalty of 0, nesting level increased to 1
for (size_t i = 0; i < input_rows_count; ++i) {
^be/src/vec/functions/function_timestamp.cpp:1454: +2, including nesting penalty of 1, nesting level increased to 2
if (src_string.size() <= 10) {
^be/src/vec/functions/function_timestamp.cpp:1460: +3, including nesting penalty of 2, nesting level increased to 3
for (int idx = 0; idx < src_string.size();) {
^be/src/vec/functions/function_timestamp.cpp:1462: +4, including nesting penalty of 3, nesting level increased to 4
if (current == '-') {
^be/src/vec/functions/function_timestamp.cpp:1466: +1, nesting level increased to 4
} else if (current == 'W') {
^be/src/vec/functions/function_timestamp.cpp:1470: +1, nesting level increased to 4
} else if (!isdigit(current)) {
^be/src/vec/functions/function_timestamp.cpp:1475: +4, including nesting penalty of 3, nesting level increased to 4
for (; idx < src_string.size() && isdigit(src_string[idx]); ++idx) {
^be/src/vec/functions/function_timestamp.cpp:1475: +1
for (; idx < src_string.size() && isdigit(src_string[idx]); ++idx) {
^be/src/vec/functions/function_timestamp.cpp:1480: +1, nesting level increased to 2
} else {
^be/src/vec/functions/function_timestamp.cpp:1485: +2, including nesting penalty of 1, nesting level increased to 2
if (iso_string_format_value != -1) {
^be/src/vec/functions/function_timestamp.cpp:1497: +2, including nesting penalty of 1, nesting level increased to 2
if (iso_string_format_value == 1) {
^be/src/vec/functions/function_timestamp.cpp:1498: +3, including nesting penalty of 2, nesting level increased to 3
if (sscanf(src_string.data(), iso_format_string.data(), &year, &month, &day) != 3)
^be/src/vec/functions/function_timestamp.cpp:1504: +3, including nesting penalty of 2, nesting level increased to 3
if (!(ts_value.template set_time_unit<YEAR>(year) &&
^be/src/vec/functions/function_timestamp.cpp:1505: +1
ts_value.template set_time_unit<MONTH>(month) &&
^be/src/vec/functions/function_timestamp.cpp:1509: +1, nesting level increased to 2
} else if (iso_string_format_value == 2) {
^be/src/vec/functions/function_timestamp.cpp:1510: +3, including nesting penalty of 2, nesting level increased to 3
if (sscanf(src_string.data(), iso_format_string.data(), &year, &month) != 2)
^be/src/vec/functions/function_timestamp.cpp:1516: +3, including nesting penalty of 2, nesting level increased to 3
if (!(ts_value.template set_time_unit<YEAR>(year) &&
^be/src/vec/functions/function_timestamp.cpp:1516: +1
if (!(ts_value.template set_time_unit<YEAR>(year) &&
^be/src/vec/functions/function_timestamp.cpp:1521: +1, nesting level increased to 2
} else if (iso_string_format_value == 3) {
^be/src/vec/functions/function_timestamp.cpp:1522: +3, including nesting penalty of 2, nesting level increased to 3
if (sscanf(src_string.data(), iso_format_string.data(), &year) != 1) [[unlikely]] {
^be/src/vec/functions/function_timestamp.cpp:1527: +3, including nesting penalty of 2, nesting level increased to 3
if (!ts_value.template set_time_unit<YEAR>(year)) [[unlikely]] {
^be/src/vec/functions/function_timestamp.cpp:1533: +1, nesting level increased to 2
} else if (iso_string_format_value == 5 || iso_string_format_value == 6) {
^be/src/vec/functions/function_timestamp.cpp:1533: +1
} else if (iso_string_format_value == 5 || iso_string_format_value == 6) {
^be/src/vec/functions/function_timestamp.cpp:1534: +3, including nesting penalty of 2, nesting level increased to 3
if (iso_string_format_value == 5) {
^be/src/vec/functions/function_timestamp.cpp:1535: +4, including nesting penalty of 3, nesting level increased to 4
if (sscanf(src_string.data(), iso_format_string.data(), &year, &week) != 2)
^be/src/vec/functions/function_timestamp.cpp:1540: +1, nesting level increased to 3
} else {
^be/src/vec/functions/function_timestamp.cpp:1541: +4, including nesting penalty of 3, nesting level increased to 4
if (sscanf(src_string.data(), iso_format_string.data(), &year, &week,
^be/src/vec/functions/function_timestamp.cpp:1548: +3, including nesting penalty of 2, nesting level increased to 3
if (weekday < 1 || weekday > 7 || week < 1 || week > 53) [[unlikely]] {
^be/src/vec/functions/function_timestamp.cpp:1548: +1
if (weekday < 1 || weekday > 7 || week < 1 || week > 53) [[unlikely]] {
^be/src/vec/functions/function_timestamp.cpp:1564: +1, nesting level increased to 2
} else if (iso_string_format_value == 4) {
^be/src/vec/functions/function_timestamp.cpp:1565: +3, including nesting penalty of 2, nesting level increased to 3
if (sscanf(src_string.data(), iso_format_string.data(), &year, &day_of_year) != 2)
^be/src/vec/functions/function_timestamp.cpp:1571: +3, including nesting penalty of 2, nesting level increased to 3
if (is_leap(year)) {
^be/src/vec/functions/function_timestamp.cpp:1572: +4, including nesting penalty of 3, nesting level increased to 4
if (day_of_year < 0 || day_of_year > 366) [[unlikely]] {
^be/src/vec/functions/function_timestamp.cpp:1572: +1
if (day_of_year < 0 || day_of_year > 366) [[unlikely]] {
^be/src/vec/functions/function_timestamp.cpp:1575: +1, nesting level increased to 3
} else {
^be/src/vec/functions/function_timestamp.cpp:1576: +4, including nesting penalty of 3, nesting level increased to 4
if (day_of_year < 0 || day_of_year > 365) [[unlikely]] {
^be/src/vec/functions/function_timestamp.cpp:1576: +1
if (day_of_year < 0 || day_of_year > 365) [[unlikely]] {
^be/src/vec/functions/function_timestamp.cpp:1585: +1, nesting level increased to 2
} else {
^| return make_nullable(std::make_shared<DataTypeDateV2>()); | ||
| } | ||
|
|
||
| static Status execute(FunctionContext* context, Block& block, const ColumnNumbers& arguments, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: function 'execute' exceeds recommended size/complexity thresholds [readability-function-size]
static Status execute(FunctionContext* context, Block& block, const ColumnNumbers& arguments,
^Additional context
be/src/vec/functions/function_timestamp.cpp:1385: 206 lines including whitespace and comments (threshold 80)
static Status execute(FunctionContext* context, Block& block, const ColumnNumbers& arguments,
^|
run buildall |
1 similar comment
|
run buildall |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
| return make_nullable(std::make_shared<DataTypeDateV2>()); | ||
| } | ||
|
|
||
| static Status execute(FunctionContext* context, Block& block, const ColumnNumbers& arguments, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: function 'execute' has cognitive complexity of 81 (threshold 50) [readability-function-cognitive-complexity]
static Status execute(FunctionContext* context, Block& block, const ColumnNumbers& arguments,
^Additional context
be/src/vec/functions/function_timestamp.cpp:1443: +1, including nesting penalty of 0, nesting level increased to 1
for (size_t i = 0; i < input_rows_count; ++i) {
^be/src/vec/functions/function_timestamp.cpp:1454: +2, including nesting penalty of 1, nesting level increased to 2
if (src_string.size() <= 10) {
^be/src/vec/functions/function_timestamp.cpp:1460: +3, including nesting penalty of 2, nesting level increased to 3
for (int idx = 0; idx < src_string.size();) {
^be/src/vec/functions/function_timestamp.cpp:1462: +4, including nesting penalty of 3, nesting level increased to 4
if (current == '-') {
^be/src/vec/functions/function_timestamp.cpp:1466: +1, nesting level increased to 4
} else if (current == 'W') {
^be/src/vec/functions/function_timestamp.cpp:1470: +1, nesting level increased to 4
} else if (!isdigit(current)) {
^be/src/vec/functions/function_timestamp.cpp:1475: +4, including nesting penalty of 3, nesting level increased to 4
for (; idx < src_string.size() && isdigit(src_string[idx]); ++idx) {
^be/src/vec/functions/function_timestamp.cpp:1475: +1
for (; idx < src_string.size() && isdigit(src_string[idx]); ++idx) {
^be/src/vec/functions/function_timestamp.cpp:1480: +1, nesting level increased to 2
} else {
^be/src/vec/functions/function_timestamp.cpp:1485: +2, including nesting penalty of 1, nesting level increased to 2
if (iso_string_format_value != -1) {
^be/src/vec/functions/function_timestamp.cpp:1497: +2, including nesting penalty of 1, nesting level increased to 2
if (iso_string_format_value == 1) {
^be/src/vec/functions/function_timestamp.cpp:1498: +3, including nesting penalty of 2, nesting level increased to 3
if (sscanf(src_string.data(), iso_format_string.data(), &year, &month, &day) != 3)
^be/src/vec/functions/function_timestamp.cpp:1504: +3, including nesting penalty of 2, nesting level increased to 3
if (!(ts_value.template set_time_unit<YEAR>(year) &&
^be/src/vec/functions/function_timestamp.cpp:1505: +1
ts_value.template set_time_unit<MONTH>(month) &&
^be/src/vec/functions/function_timestamp.cpp:1509: +1, nesting level increased to 2
} else if (iso_string_format_value == 2) {
^be/src/vec/functions/function_timestamp.cpp:1510: +3, including nesting penalty of 2, nesting level increased to 3
if (sscanf(src_string.data(), iso_format_string.data(), &year, &month) != 2)
^be/src/vec/functions/function_timestamp.cpp:1516: +3, including nesting penalty of 2, nesting level increased to 3
if (!(ts_value.template set_time_unit<YEAR>(year) &&
^be/src/vec/functions/function_timestamp.cpp:1516: +1
if (!(ts_value.template set_time_unit<YEAR>(year) &&
^be/src/vec/functions/function_timestamp.cpp:1521: +1, nesting level increased to 2
} else if (iso_string_format_value == 3) {
^be/src/vec/functions/function_timestamp.cpp:1522: +3, including nesting penalty of 2, nesting level increased to 3
if (sscanf(src_string.data(), iso_format_string.data(), &year) != 1) [[unlikely]] {
^be/src/vec/functions/function_timestamp.cpp:1527: +3, including nesting penalty of 2, nesting level increased to 3
if (!ts_value.template set_time_unit<YEAR>(year)) [[unlikely]] {
^be/src/vec/functions/function_timestamp.cpp:1533: +1, nesting level increased to 2
} else if (iso_string_format_value == 5 || iso_string_format_value == 6) {
^be/src/vec/functions/function_timestamp.cpp:1533: +1
} else if (iso_string_format_value == 5 || iso_string_format_value == 6) {
^be/src/vec/functions/function_timestamp.cpp:1534: +3, including nesting penalty of 2, nesting level increased to 3
if (iso_string_format_value == 5) {
^be/src/vec/functions/function_timestamp.cpp:1535: +4, including nesting penalty of 3, nesting level increased to 4
if (sscanf(src_string.data(), iso_format_string.data(), &year, &week) != 2)
^be/src/vec/functions/function_timestamp.cpp:1540: +1, nesting level increased to 3
} else {
^be/src/vec/functions/function_timestamp.cpp:1541: +4, including nesting penalty of 3, nesting level increased to 4
if (sscanf(src_string.data(), iso_format_string.data(), &year, &week,
^be/src/vec/functions/function_timestamp.cpp:1548: +3, including nesting penalty of 2, nesting level increased to 3
if (weekday < 1 || weekday > 7 || week < 1 || week > 53) [[unlikely]] {
^be/src/vec/functions/function_timestamp.cpp:1548: +1
if (weekday < 1 || weekday > 7 || week < 1 || week > 53) [[unlikely]] {
^be/src/vec/functions/function_timestamp.cpp:1563: +1, nesting level increased to 2
} else if (iso_string_format_value == 4) {
^be/src/vec/functions/function_timestamp.cpp:1564: +3, including nesting penalty of 2, nesting level increased to 3
if (sscanf(src_string.data(), iso_format_string.data(), &year, &day_of_year) != 2)
^be/src/vec/functions/function_timestamp.cpp:1570: +3, including nesting penalty of 2, nesting level increased to 3
if (is_leap(year)) {
^be/src/vec/functions/function_timestamp.cpp:1571: +4, including nesting penalty of 3, nesting level increased to 4
if (day_of_year < 0 || day_of_year > 366) [[unlikely]] {
^be/src/vec/functions/function_timestamp.cpp:1571: +1
if (day_of_year < 0 || day_of_year > 366) [[unlikely]] {
^be/src/vec/functions/function_timestamp.cpp:1574: +1, nesting level increased to 3
} else {
^be/src/vec/functions/function_timestamp.cpp:1575: +4, including nesting penalty of 3, nesting level increased to 4
if (day_of_year < 0 || day_of_year > 365) [[unlikely]] {
^be/src/vec/functions/function_timestamp.cpp:1575: +1
if (day_of_year < 0 || day_of_year > 365) [[unlikely]] {
^be/src/vec/functions/function_timestamp.cpp:1584: +1, nesting level increased to 2
} else {
^| return make_nullable(std::make_shared<DataTypeDateV2>()); | ||
| } | ||
|
|
||
| static Status execute(FunctionContext* context, Block& block, const ColumnNumbers& arguments, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: function 'execute' exceeds recommended size/complexity thresholds [readability-function-size]
static Status execute(FunctionContext* context, Block& block, const ColumnNumbers& arguments,
^Additional context
be/src/vec/functions/function_timestamp.cpp:1385: 205 lines including whitespace and comments (threshold 80)
static Status execute(FunctionContext* context, Block& block, const ColumnNumbers& arguments,
^|
TeamCity be ut coverage result: |
|
run buildall |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
| return make_nullable(std::make_shared<DataTypeDateV2>()); | ||
| } | ||
|
|
||
| static Status execute(FunctionContext* context, Block& block, const ColumnNumbers& arguments, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: function 'execute' has cognitive complexity of 90 (threshold 50) [readability-function-cognitive-complexity]
static Status execute(FunctionContext* context, Block& block, const ColumnNumbers& arguments,
^Additional context
be/src/vec/functions/function_timestamp.cpp:1443: +1, including nesting penalty of 0, nesting level increased to 1
for (size_t i = 0; i < input_rows_count; ++i) {
^be/src/vec/functions/function_timestamp.cpp:1454: +2, including nesting penalty of 1, nesting level increased to 2
if (src_string.size() <= 10) {
^be/src/vec/functions/function_timestamp.cpp:1460: +3, including nesting penalty of 2, nesting level increased to 3
for (int idx = 0; idx < src_string.size();) {
^be/src/vec/functions/function_timestamp.cpp:1462: +4, including nesting penalty of 3, nesting level increased to 4
if (current == '-') {
^be/src/vec/functions/function_timestamp.cpp:1466: +1, nesting level increased to 4
} else if (current == 'W') {
^be/src/vec/functions/function_timestamp.cpp:1470: +1, nesting level increased to 4
} else if (!isdigit(current)) {
^be/src/vec/functions/function_timestamp.cpp:1475: +4, including nesting penalty of 3, nesting level increased to 4
for (; idx < src_string.size() && isdigit(src_string[idx]); ++idx) {
^be/src/vec/functions/function_timestamp.cpp:1475: +1
for (; idx < src_string.size() && isdigit(src_string[idx]); ++idx) {
^be/src/vec/functions/function_timestamp.cpp:1480: +1, nesting level increased to 2
} else {
^be/src/vec/functions/function_timestamp.cpp:1485: +2, including nesting penalty of 1, nesting level increased to 2
if (iso_string_format_value != -1) {
^be/src/vec/functions/function_timestamp.cpp:1497: +2, including nesting penalty of 1, nesting level increased to 2
if (iso_string_format_value == 1) {
^be/src/vec/functions/function_timestamp.cpp:1498: +3, including nesting penalty of 2, nesting level increased to 3
if (sscanf(src_string.data(), iso_format_string.data(), &year, &month, &day) != 3)
^be/src/vec/functions/function_timestamp.cpp:1504: +3, including nesting penalty of 2, nesting level increased to 3
if (!(ts_value.template set_time_unit<YEAR>(year) &&
^be/src/vec/functions/function_timestamp.cpp:1505: +1
ts_value.template set_time_unit<MONTH>(month) &&
^be/src/vec/functions/function_timestamp.cpp:1509: +1, nesting level increased to 2
} else if (iso_string_format_value == 2) {
^be/src/vec/functions/function_timestamp.cpp:1510: +3, including nesting penalty of 2, nesting level increased to 3
if (sscanf(src_string.data(), iso_format_string.data(), &year, &month) != 2)
^be/src/vec/functions/function_timestamp.cpp:1516: +3, including nesting penalty of 2, nesting level increased to 3
if (!(ts_value.template set_time_unit<YEAR>(year) &&
^be/src/vec/functions/function_timestamp.cpp:1517: +1
ts_value.template set_time_unit<MONTH>(month) &&
^be/src/vec/functions/function_timestamp.cpp:1522: +1, nesting level increased to 2
} else if (iso_string_format_value == 3) {
^be/src/vec/functions/function_timestamp.cpp:1523: +3, including nesting penalty of 2, nesting level increased to 3
if (sscanf(src_string.data(), iso_format_string.data(), &year) != 1) [[unlikely]] {
^be/src/vec/functions/function_timestamp.cpp:1528: +3, including nesting penalty of 2, nesting level increased to 3
if (!(ts_value.template set_time_unit<YEAR>(year) &&
^be/src/vec/functions/function_timestamp.cpp:1529: +1
ts_value.template set_time_unit<MONTH>(1) &&
^be/src/vec/functions/function_timestamp.cpp:1534: +1, nesting level increased to 2
} else if (iso_string_format_value == 5 || iso_string_format_value == 6) {
^be/src/vec/functions/function_timestamp.cpp:1534: +1
} else if (iso_string_format_value == 5 || iso_string_format_value == 6) {
^be/src/vec/functions/function_timestamp.cpp:1535: +3, including nesting penalty of 2, nesting level increased to 3
if (iso_string_format_value == 5) {
^be/src/vec/functions/function_timestamp.cpp:1536: +4, including nesting penalty of 3, nesting level increased to 4
if (sscanf(src_string.data(), iso_format_string.data(), &year, &week) != 2)
^be/src/vec/functions/function_timestamp.cpp:1541: +1, nesting level increased to 3
} else {
^be/src/vec/functions/function_timestamp.cpp:1542: +4, including nesting penalty of 3, nesting level increased to 4
if (sscanf(src_string.data(), iso_format_string.data(), &year, &week,
^be/src/vec/functions/function_timestamp.cpp:1549: +3, including nesting penalty of 2, nesting level increased to 3
if (weekday < 1 || weekday > 7 || week < 1 || week > 53) [[unlikely]] {
^be/src/vec/functions/function_timestamp.cpp:1549: +1
if (weekday < 1 || weekday > 7 || week < 1 || week > 53) [[unlikely]] {
^be/src/vec/functions/function_timestamp.cpp:1555: +3, including nesting penalty of 2, nesting level increased to 3
if (!(ts_value.template set_time_unit<YEAR>(
^be/src/vec/functions/function_timestamp.cpp:1558: +1
first_day_of_week.month().operator unsigned int()) &&
^be/src/vec/functions/function_timestamp.cpp:1569: +1, nesting level increased to 2
} else if (iso_string_format_value == 4) {
^be/src/vec/functions/function_timestamp.cpp:1570: +3, including nesting penalty of 2, nesting level increased to 3
if (sscanf(src_string.data(), iso_format_string.data(), &year, &day_of_year) != 2)
^be/src/vec/functions/function_timestamp.cpp:1576: +3, including nesting penalty of 2, nesting level increased to 3
if (is_leap(year)) {
^be/src/vec/functions/function_timestamp.cpp:1577: +4, including nesting penalty of 3, nesting level increased to 4
if (day_of_year < 0 || day_of_year > 366) [[unlikely]] {
^be/src/vec/functions/function_timestamp.cpp:1577: +1
if (day_of_year < 0 || day_of_year > 366) [[unlikely]] {
^be/src/vec/functions/function_timestamp.cpp:1580: +1, nesting level increased to 3
} else {
^be/src/vec/functions/function_timestamp.cpp:1581: +4, including nesting penalty of 3, nesting level increased to 4
if (day_of_year < 0 || day_of_year > 365) [[unlikely]] {
^be/src/vec/functions/function_timestamp.cpp:1581: +1
if (day_of_year < 0 || day_of_year > 365) [[unlikely]] {
^be/src/vec/functions/function_timestamp.cpp:1585: +3, including nesting penalty of 2, nesting level increased to 3
if (!(ts_value.template set_time_unit<YEAR>(year) &&
^be/src/vec/functions/function_timestamp.cpp:1586: +1
ts_value.template set_time_unit<MONTH>(1) &&
^be/src/vec/functions/function_timestamp.cpp:1594: +1, nesting level increased to 2
} else {
^| return make_nullable(std::make_shared<DataTypeDateV2>()); | ||
| } | ||
|
|
||
| static Status execute(FunctionContext* context, Block& block, const ColumnNumbers& arguments, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: function 'execute' exceeds recommended size/complexity thresholds [readability-function-size]
static Status execute(FunctionContext* context, Block& block, const ColumnNumbers& arguments,
^Additional context
be/src/vec/functions/function_timestamp.cpp:1385: 215 lines including whitespace and comments (threshold 80)
static Status execute(FunctionContext* context, Block& block, const ColumnNumbers& arguments,
^|
TeamCity be ut coverage result: |
|
run buildall |
|
TeamCity be ut coverage result: |
bp #40695 and #41075
#41075 : fix #40695 mac compile
Proposed changes
Added three functions:
normal_cdf,to_iso8601,from_iso8601_datenormal_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) → stringForDATEtype, it will be converted toYYYY-MM-DD. ForDATETIMEtype, it will be converted toYYYY-MM-DDThh:mm:ss.xxxxxx.from_iso8601_date(string) → DATEConvert iso8601 string toDATEtype.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.