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
53 lines
1.7 KiB
Plaintext
53 lines
1.7 KiB
Plaintext
-- This file is automatically generated. You should know what you did if you want to edit this
|
|
-- !sql --
|
|
test_materialized_view1 DUP_KEYS record_id INT INT Yes true \N true
|
|
seller_id INT INT Yes true \N true
|
|
store_id INT INT Yes true \N true
|
|
sale_date DATE DATEV2 Yes false \N NONE true
|
|
sale_amt BIGINT BIGINT Yes false \N NONE true
|
|
|
|
amt_sum AGG_KEYS mv_store_id INT INT Yes true \N true `store_id`
|
|
mva_SUM__`sale_amt` BIGINT BIGINT Yes false \N SUM true `sale_amt`
|
|
|
|
-- !sql --
|
|
test_materialized_view2 DUP_KEYS record_id INT INT Yes true \N true
|
|
seller_id INT INT Yes true \N true
|
|
store_id INT INT Yes true \N true
|
|
sale_date DATE DATEV2 Yes false \N NONE true
|
|
sale_amt BIGINT BIGINT Yes false \N NONE true
|
|
|
|
seller_id_order DUP_KEYS mv_store_id INT INT Yes true \N true `store_id`
|
|
mv_seller_id INT INT Yes true \N true `seller_id`
|
|
mv_sale_amt BIGINT BIGINT Yes false \N NONE true `sale_amt`
|
|
|
|
-- !sql --
|
|
1 1 1 2020-05-30 100
|
|
2 1 1 2020-05-30 100
|
|
|
|
-- !sql --
|
|
1 200
|
|
|
|
-- !sql --
|
|
1 1 1 2020-05-30 100
|
|
2 1 1 2020-05-30 100
|
|
|
|
-- !sql --
|
|
1 200
|
|
|
|
-- !sql --
|
|
|
|
|
|
mva_SUM__CASE WHEN `sale_amt` IS NULL THEN 0 ELSE 1 END BIGINT BIGINT No false \N SUM true CASE WHEN `sale_amt` IS NULL THEN 0 ELSE 1 END
|
|
mva_SUM__`sale_amt` BIGINT BIGINT Yes false \N SUM true `sale_amt`
|
|
sale_amt BIGINT BIGINT Yes false \N NONE true
|
|
sale_date DATE DATEV2 Yes false \N NONE true
|
|
seller_id INT INT Yes true \N true
|
|
store_id INT INT Yes true \N true
|
|
amt_count AGG_KEYS mv_store_id INT INT Yes true \N true `store_id`
|
|
amt_sum AGG_KEYS mv_store_id INT INT Yes true \N true `store_id`
|
|
test_materialized_view1 DUP_KEYS record_id INT INT Yes true \N true
|
|
|
|
-- !sql --
|
|
1 2
|
|
|