Why I'm doing:
Fixes#61695
What I'm doing:
Fixes#61695 , add WEEKDAY function similar to the dayofweek_iso function, but it returns numbers from 0 to 6 (corresponding to Monday to Sunday)
Signed-off-by: wangshifa.1 <wangshifa.1@jd.com>
Fixes https://github.com/StarRocks/starrocks/issues/27022
When the target table is created with `PARTITION BY date_trunc('YEAR',
event_time)`, in which the fmt is in upper case, the insert would get
failure. This PR fixes the issue.
Fixes
#23422
## Description
Converts a date into a string according to the format that is compatible
with JodaTime’s DateTimeFormat pattern format. Currently it supports
strings with a maximum of 128 bytes. If the length of the returned value
exceeds 128, NULL is returned.
## Syntax
```Haskell
VARCHAR JODATIME_FORMAT(DATETIME date, VARCHAR format)
```
## Parameters
- The `date` parameter must be a valid date or date expression.
- `format` specifies the output format of the date or time.
The available formats could refer to [joda-time
format](https://joda-time.sourceforge.net/apidocs/org/joda/time/format/DateTimeFormat.html)
## Examples
```Plain Text
mysql> select jodatime_format('2020-06-25 15:58:51', 'yyyy-MM-dd');
+------------------------------------------------------+
| jodatime_format('2020-06-25 15:58:51', 'yyyy-MM-dd') |
+------------------------------------------------------+
| 2020-06-25 |
+------------------------------------------------------+
mysql> select jodatime_format('2020-06-25 15:58:51', 'yyyy-MM-dd HH:mm:ss');
+---------------------------------------------------------------+
| jodatime_format('2020-06-25 15:58:51', 'yyyy-MM-dd HH:mm:ss') |
+---------------------------------------------------------------+
| 2020-06-25 15:58:51 |
+---------------------------------------------------------------+
```
Signed-off-by: Youngwb <yangwenbo_mailbox@163.com>