This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch branch-4.0
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-4.0 by this push:
new 69336b3b877 branch-4.0: [cases](print) Add print date/datetime/time
cases #57332 (#57341)
69336b3b877 is described below
commit 69336b3b8773fa9bfda0dd84ae5244b32bf7992d
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Mon Oct 27 15:39:13 2025 +0800
branch-4.0: [cases](print) Add print date/datetime/time cases #57332
(#57341)
Cherry-picked from #57332
Co-authored-by: zclllyybb <[email protected]>
---
regression-test/data/cast_p0/datelike_print.out | 37 ++++++++++++++++++
.../suites/cast_p0/datelike_print.groovy | 44 ++++++++++++++++++++++
2 files changed, 81 insertions(+)
diff --git a/regression-test/data/cast_p0/datelike_print.out
b/regression-test/data/cast_p0/datelike_print.out
new file mode 100644
index 00000000000..8daa33d482c
--- /dev/null
+++ b/regression-test/data/cast_p0/datelike_print.out
@@ -0,0 +1,37 @@
+-- This file is automatically generated. You should know what you did if you
want to edit this
+-- !sql1 --
+2024-06-15
+
+-- !sql2 --
+2024-06-15 12:34:56
+
+-- !sql3 --
+2024-06-15 12:34:56.000000
+
+-- !sql4 --
+2024-06-15 12:34:56
+
+-- !sql5 --
+2024-06-15 12:34:56.123
+
+-- !sql6 --
+2024-06-15 12:34:56.1230
+
+-- !sql7 --
+2024-06-15 12:34:56.123000
+
+-- !sql8 --
+00:00:00
+
+-- !sql9 --
+00:00:00.000000
+
+-- !sql10 --
+23:59:59.000000
+
+-- !sql11 --
+123:00:00.000000
+
+-- !sql12 --
+800:12:34.560000
+
diff --git a/regression-test/suites/cast_p0/datelike_print.groovy
b/regression-test/suites/cast_p0/datelike_print.groovy
new file mode 100644
index 00000000000..11a4f50046d
--- /dev/null
+++ b/regression-test/suites/cast_p0/datelike_print.groovy
@@ -0,0 +1,44 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+suite("datelike_print") {
+ qt_sql1 "SELECT CAST(CAST('2024-06-15' AS DATE) AS STRING);"
+ qt_sql2 "SELECT CAST(CAST('2024-06-15 12:34:56' AS DATETIME) AS STRING);"
+ qt_sql3 "SELECT CAST(CAST('2024-06-15 12:34:56' AS DATETIME(6)) AS
STRING);"
+ qt_sql4 "SELECT CAST(CAST('2024-06-15 12:34:56.123' AS DATETIME) AS
STRING);"
+ qt_sql5 "SELECT CAST(CAST('2024-06-15 12:34:56.123' AS DATETIME(3)) AS
STRING);"
+ qt_sql6 "SELECT CAST(CAST('2024-06-15 12:34:56.123' AS DATETIME(4)) AS
STRING);"
+ qt_sql7 "SELECT CAST(CAST('2024-06-15 12:34:56.123' AS DATETIME(6)) AS
STRING);"
+ qt_sql8 "SELECT CAST(CAST('0' AS TIME) AS STRING);"
+ qt_sql9 "SELECT CAST(CAST('0' AS TIME(6)) AS STRING);"
+ qt_sql10 "SELECT CAST(CAST('23:59:59' AS TIME(6)) AS STRING);"
+ qt_sql11 "SELECT CAST(CAST('123:00:00' AS TIME(6)) AS STRING);"
+ qt_sql12 "SELECT CAST(CAST('800:12:34.56' AS TIME(6)) AS STRING);"
+
+ testFoldConst("SELECT CAST(CAST('2024-06-15' AS DATE) AS STRING);")
+ testFoldConst("SELECT CAST(CAST('2024-06-15 12:34:56' AS DATETIME) AS
STRING);")
+ testFoldConst("SELECT CAST(CAST('2024-06-15 12:34:56' AS DATETIME(6)) AS
STRING);")
+ testFoldConst("SELECT CAST(CAST('2024-06-15 12:34:56.123' AS DATETIME) AS
STRING);")
+ testFoldConst("SELECT CAST(CAST('2024-06-15 12:34:56.123' AS DATETIME(3))
AS STRING);")
+ testFoldConst("SELECT CAST(CAST('2024-06-15 12:34:56.123' AS DATETIME(4))
AS STRING);")
+ testFoldConst("SELECT CAST(CAST('2024-06-15 12:34:56.123' AS DATETIME(6))
AS STRING);")
+ testFoldConst("SELECT CAST(CAST('0' AS TIME) AS STRING);")
+ testFoldConst("SELECT CAST(CAST('0' AS TIME(6)) AS STRING);")
+ testFoldConst("SELECT CAST(CAST('23:59:59' AS TIME(6)) AS STRING);")
+ testFoldConst("SELECT CAST(CAST('123:00:00' AS TIME(6)) AS STRING);")
+ testFoldConst("SELECT CAST(CAST('800:12:34.56' AS TIME(6)) AS STRING);")
+}
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]