This is an automated email from the ASF dual-hosted git repository.
dataroaring pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new 36be7dcc13b [enhancement](regression) add normal query before date
convert for debug (#25970)
36be7dcc13b is described below
commit 36be7dcc13b80578a5eee5dd52843bcd8cd833e2
Author: zhengyu <[email protected]>
AuthorDate: Thu Oct 26 21:37:28 2023 +0800
[enhancement](regression) add normal query before date convert for debug
(#25970)
Signed-off-by: freemandealer <[email protected]>
---
.../datetime_functions/test_date_function.out | 4 ++
.../datetime_functions/test_date_function.groovy | 48 +++++++++++-----------
2 files changed, 29 insertions(+), 23 deletions(-)
diff --git
a/regression-test/data/nereids_p0/sql_functions/datetime_functions/test_date_function.out
b/regression-test/data/nereids_p0/sql_functions/datetime_functions/test_date_function.out
index 8ff8872f77b..005e71e9fb7 100644
---
a/regression-test/data/nereids_p0/sql_functions/datetime_functions/test_date_function.out
+++
b/regression-test/data/nereids_p0/sql_functions/datetime_functions/test_date_function.out
@@ -23,6 +23,10 @@
-- !sql --
\N
+-- !sql --
+2019-08-01T13:21:03.000123
+2019-08-01T13:21:03.123
+
-- !sql --
2019-08-01T13:21:03.000123 2019-07-31T22:21:03.000123
2019-08-01T13:21:03.123 2019-07-31T22:21:03.123
diff --git
a/regression-test/suites/nereids_p0/sql_functions/datetime_functions/test_date_function.groovy
b/regression-test/suites/nereids_p0/sql_functions/datetime_functions/test_date_function.groovy
index 6f4718d1f34..a66c77a8163 100644
---
a/regression-test/suites/nereids_p0/sql_functions/datetime_functions/test_date_function.groovy
+++
b/regression-test/suites/nereids_p0/sql_functions/datetime_functions/test_date_function.groovy
@@ -18,6 +18,7 @@
import java.text.SimpleDateFormat
suite("test_date_function") {
+ sql """ SET enable_profile = true """
sql "SET enable_nereids_planner=true"
sql "SET enable_fallback_to_original_planner=false"
def tableName = "test_date_function"
@@ -70,6 +71,7 @@ suite("test_date_function") {
)
"""
sql """ insert into ${tableScale6} values ("2019-08-01
13:21:03.000123"),("2019-08-01 13:21:03.123") """
+ qt_sql """ SELECT * from ${tableScale6} order by k1 """
// convert_tz
qt_sql """ SELECT k1, convert_tz(k1, 'Asia/Shanghai',
'America/Los_Angeles') result from ${tableScale6} order by k1 """
qt_sql """ SELECT k1, convert_tz(k1, '+08:00', 'America/Los_Angeles')
result from ${tableScale6} order by k1 """
@@ -595,23 +597,23 @@ suite("test_date_function") {
sql """ DROP TABLE IF EXISTS ${tableName}; """
sql """
CREATE TABLE IF NOT EXISTS ${tableName} (
- birth date,
- birth1 datev2,
- birth2 datetime,
+ birth date,
+ birth1 datev2,
+ birth2 datetime,
birth3 datetimev2)
UNIQUE KEY(birth, birth1, birth2, birth3)
- DISTRIBUTED BY HASH (birth) BUCKETS 1
+ DISTRIBUTED BY HASH (birth) BUCKETS 1
PROPERTIES( "replication_allocation" = "tag.location.default: 1");
"""
sql """
- insert into ${tableName} values
- ('2022-01-01', '2022-01-01', '2022-01-01 00:00:00', '2022-01-01
00:00:00'),
- ('2000-02-01', '2000-02-01', '2000-02-01 00:00:00', '2000-02-01
00:00:00.123'),
+ insert into ${tableName} values
+ ('2022-01-01', '2022-01-01', '2022-01-01 00:00:00', '2022-01-01
00:00:00'),
+ ('2000-02-01', '2000-02-01', '2000-02-01 00:00:00', '2000-02-01
00:00:00.123'),
('2022-02-27', '2022-02-27', '2022-02-27 00:00:00', '2022-02-27
00:00:00'),
('2022-02-28', '2022-02-28', '2022-02-28T23:59:59',
'2022-02-28T23:59:59');"""
qt_sql """
- select last_day(birth), last_day(birth1),
- last_day(birth2), last_day(birth3)
+ select last_day(birth), last_day(birth1),
+ last_day(birth2), last_day(birth3)
from ${tableName};
"""
sql """ DROP TABLE IF EXISTS ${tableName}; """
@@ -619,16 +621,16 @@ suite("test_date_function") {
sql """ DROP TABLE IF EXISTS ${tableName}; """
sql """
CREATE TABLE IF NOT EXISTS ${tableName} (
- birth date,
+ birth date,
birth1 datetime)
UNIQUE KEY(birth, birth1)
- DISTRIBUTED BY HASH (birth) BUCKETS 1
+ DISTRIBUTED BY HASH (birth) BUCKETS 1
PROPERTIES( "replication_allocation" = "tag.location.default: 1");
"""
sql """
- insert into ${tableName} values
- ('2022-01-01', '2022-01-01 00:00:00'),
- ('2000-02-01', '2000-02-01 00:00:00'),
+ insert into ${tableName} values
+ ('2022-01-01', '2022-01-01 00:00:00'),
+ ('2000-02-01', '2000-02-01 00:00:00'),
('2022-02-27', '2022-02-27 00:00:00'),
('2022-02-28', '2022-02-28 23:59:59');"""
qt_sql """
@@ -640,24 +642,24 @@ suite("test_date_function") {
sql """ DROP TABLE IF EXISTS ${tableName}; """
sql """
CREATE TABLE IF NOT EXISTS ${tableName} (
- birth date,
- birth1 datev2,
- birth2 datetime,
+ birth date,
+ birth1 datev2,
+ birth2 datetime,
birth3 datetimev2)
UNIQUE KEY(birth, birth1, birth2, birth3)
- DISTRIBUTED BY HASH (birth) BUCKETS 1
+ DISTRIBUTED BY HASH (birth) BUCKETS 1
PROPERTIES( "replication_allocation" = "tag.location.default: 1");
"""
sql """
- insert into ${tableName} values
- ('2022-01-01', '2022-01-01', '2022-01-01 00:00:00', '2022-01-01
00:00:00'),
- ('2000-02-01', '2000-02-01', '2000-02-01 00:00:00', '2000-02-01
00:00:00.123'),
+ insert into ${tableName} values
+ ('2022-01-01', '2022-01-01', '2022-01-01 00:00:00', '2022-01-01
00:00:00'),
+ ('2000-02-01', '2000-02-01', '2000-02-01 00:00:00', '2000-02-01
00:00:00.123'),
('2022-02-27', '2022-02-27', '2022-02-27 00:00:00', '2022-02-27
00:00:00'),
('2022-02-28', '2022-02-28', '2022-02-28 23:59:59', '2022-02-28
23:59:59'),
('1970-01-02', '1970-01-02', '1970-01-02 01:02:03', '1970-01-02
02:03:04');"""
qt_sql """
- select to_monday(birth), to_monday(birth1),
- to_monday(birth2), to_monday(birth3)
+ select to_monday(birth), to_monday(birth1),
+ to_monday(birth2), to_monday(birth3)
from ${tableName};
"""
sql """ DROP TABLE IF EXISTS ${tableName}; """
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]