[Feature](Nereids) add executable function to support fold constant for functions (#18209)

1. Add date-time functions for fold constant for Nereids.
This is the list of executable date-time function nereids supports up to now:
- now()
- now(int)
- current_timestamp()
- current_timestamp(int)
- localtime()
- localtimestamp()
- curdate()
- current_date()
- curtime()
- current_time()
- date_{add/sub}(),{years/months/days/hours/minutes/seconds}_{add/sub}()
- datediff()
- {date/datev2}()
- {year/quarter/month/day/hour/minute/second}()
- dayof{year/month/week}()
- date_format()
- date_trunc()
- from_days()
- last_day()
- to_monday()
- from_unixtime()
- unix_timestamp()
- utc_timestamp()
- to_date()
- to_days()
- str_to_date()
- makedate()

2. solved problem:
- enable datev2/datetimev2 default.
- refactor Nereids foldConstantOnFE and support fold nested expression.
- separate the executable into multi-files for easily-reading and adding new functions
This commit is contained in:
mch_ucchi
2023-05-17 21:26:31 +08:00
committed by GitHub
parent 1eb929e1ca
commit 1d05feea1b
45 changed files with 6146 additions and 818 deletions

View File

@ -1505,8 +1505,8 @@ public class Config extends ConfigBase {
/**
* If set to TRUE, FE will convert date/datetime to datev2/datetimev2(0) automatically.
*/
@ConfField(mutable = true, masterOnly = true)
public static boolean enable_date_conversion = false;
@ConfField(mutable = true)
public static boolean enable_date_conversion = true;
@ConfField(mutable = false, masterOnly = true)
public static boolean enable_multi_tags = false;