This is an automated email from the ASF dual-hosted git repository.

gurwls223 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/master by this push:
     new 1e13d8d8accb [SPARK-46974][SQL][TEST] Recover a test case for 
day-of-year 2-letter 'DD' pattern parsing 3-digit values
1e13d8d8accb is described below

commit 1e13d8d8accb12d263198b2e3fcec738fd40ddd3
Author: Kent Yao <[email protected]>
AuthorDate: Mon Feb 5 14:48:44 2024 +0900

    [SPARK-46974][SQL][TEST] Recover a test case for day-of-year 2-letter 'DD' 
pattern parsing 3-digit values
    
    ### What changes were proposed in this pull request?
    
    This PR recovers a test case for day-of-year 2-letter 'DD' pattern parsing 
3-digit values
    
    ### Why are the changes needed?
    
    test coverage.
    
    ### Does this PR introduce _any_ user-facing change?
    
    no
    ### How was this patch tested?
    
    new tests
    
    ### Was this patch authored or co-authored using generative AI tooling?
    
    no
    
    Closes #45024 from yaooqinn/SPARK-46974.
    
    Authored-by: Kent Yao <[email protected]>
    Signed-off-by: Hyukjin Kwon <[email protected]>
---
 .../sql-tests/analyzer-results/datetime-parsing-legacy.sql.out    | 7 +++++++
 .../resources/sql-tests/analyzer-results/datetime-parsing.sql.out | 7 +++++++
 .../test/resources/sql-tests/inputs/datetime-parsing-invalid.sql  | 2 --
 sql/core/src/test/resources/sql-tests/inputs/datetime-parsing.sql | 1 +
 .../resources/sql-tests/results/datetime-parsing-legacy.sql.out   | 8 ++++++++
 .../src/test/resources/sql-tests/results/datetime-parsing.sql.out | 8 ++++++++
 6 files changed, 31 insertions(+), 2 deletions(-)

diff --git 
a/sql/core/src/test/resources/sql-tests/analyzer-results/datetime-parsing-legacy.sql.out
 
b/sql/core/src/test/resources/sql-tests/analyzer-results/datetime-parsing-legacy.sql.out
index f24dee822749..7325f2756949 100644
--- 
a/sql/core/src/test/resources/sql-tests/analyzer-results/datetime-parsing-legacy.sql.out
+++ 
b/sql/core/src/test/resources/sql-tests/analyzer-results/datetime-parsing-legacy.sql.out
@@ -111,6 +111,13 @@ Project [to_timestamp(99, Some(DD), TimestampType, 
Some(America/Los_Angeles), fa
 +- OneRowRelation
 
 
+-- !query
+select to_timestamp('100', 'DD')
+-- !query analysis
+Project [to_timestamp(100, Some(DD), TimestampType, Some(America/Los_Angeles), 
false) AS to_timestamp(100, DD)#x]
++- OneRowRelation
+
+
 -- !query
 select to_timestamp('009', 'DDD')
 -- !query analysis
diff --git 
a/sql/core/src/test/resources/sql-tests/analyzer-results/datetime-parsing.sql.out
 
b/sql/core/src/test/resources/sql-tests/analyzer-results/datetime-parsing.sql.out
index f24dee822749..7325f2756949 100644
--- 
a/sql/core/src/test/resources/sql-tests/analyzer-results/datetime-parsing.sql.out
+++ 
b/sql/core/src/test/resources/sql-tests/analyzer-results/datetime-parsing.sql.out
@@ -111,6 +111,13 @@ Project [to_timestamp(99, Some(DD), TimestampType, 
Some(America/Los_Angeles), fa
 +- OneRowRelation
 
 
+-- !query
+select to_timestamp('100', 'DD')
+-- !query analysis
+Project [to_timestamp(100, Some(DD), TimestampType, Some(America/Los_Angeles), 
false) AS to_timestamp(100, DD)#x]
++- OneRowRelation
+
+
 -- !query
 select to_timestamp('009', 'DDD')
 -- !query analysis
diff --git 
a/sql/core/src/test/resources/sql-tests/inputs/datetime-parsing-invalid.sql 
b/sql/core/src/test/resources/sql-tests/inputs/datetime-parsing-invalid.sql
index a6d743cab548..1f5a9b117ca2 100644
--- a/sql/core/src/test/resources/sql-tests/inputs/datetime-parsing-invalid.sql
+++ b/sql/core/src/test/resources/sql-tests/inputs/datetime-parsing-invalid.sql
@@ -12,8 +12,6 @@ select to_timestamp('1234567', 'yyyyyyy'); -- the length of 
'y' pattern must be
 -- parsing invalid values with pattern 'D'
 select to_timestamp('366', 'D');
 select to_timestamp('9', 'DD');
--- in java 8 this case is invalid, but valid in java 11, disabled for jenkins
--- select to_timestamp('100', 'DD');
 select to_timestamp('366', 'DD');
 select to_timestamp('9', 'DDD');
 select to_timestamp('99', 'DDD');
diff --git a/sql/core/src/test/resources/sql-tests/inputs/datetime-parsing.sql 
b/sql/core/src/test/resources/sql-tests/inputs/datetime-parsing.sql
index e058bd675c37..f87ae556867b 100644
--- a/sql/core/src/test/resources/sql-tests/inputs/datetime-parsing.sql
+++ b/sql/core/src/test/resources/sql-tests/inputs/datetime-parsing.sql
@@ -33,6 +33,7 @@ select to_timestamp('9', 'D');
 select to_timestamp('300', 'D');
 select to_timestamp('09', 'DD');
 select to_timestamp('99', 'DD');
+select to_timestamp('100', 'DD');
 select to_timestamp('009', 'DDD');
 select to_timestamp('365', 'DDD');
 select to_timestamp('31-365', 'dd-DDD');
diff --git 
a/sql/core/src/test/resources/sql-tests/results/datetime-parsing-legacy.sql.out 
b/sql/core/src/test/resources/sql-tests/results/datetime-parsing-legacy.sql.out
index 97908f782ad0..b041c96bf287 100644
--- 
a/sql/core/src/test/resources/sql-tests/results/datetime-parsing-legacy.sql.out
+++ 
b/sql/core/src/test/resources/sql-tests/results/datetime-parsing-legacy.sql.out
@@ -127,6 +127,14 @@ struct<to_timestamp(99, DD):timestamp>
 1970-04-09 00:00:00
 
 
+-- !query
+select to_timestamp('100', 'DD')
+-- !query schema
+struct<to_timestamp(100, DD):timestamp>
+-- !query output
+1970-04-10 00:00:00
+
+
 -- !query
 select to_timestamp('009', 'DDD')
 -- !query schema
diff --git 
a/sql/core/src/test/resources/sql-tests/results/datetime-parsing.sql.out 
b/sql/core/src/test/resources/sql-tests/results/datetime-parsing.sql.out
index a28e2d33cbaa..d45154f97005 100644
--- a/sql/core/src/test/resources/sql-tests/results/datetime-parsing.sql.out
+++ b/sql/core/src/test/resources/sql-tests/results/datetime-parsing.sql.out
@@ -127,6 +127,14 @@ struct<to_timestamp(99, DD):timestamp>
 1970-04-09 00:00:00
 
 
+-- !query
+select to_timestamp('100', 'DD')
+-- !query schema
+struct<to_timestamp(100, DD):timestamp>
+-- !query output
+1970-04-10 00:00:00
+
+
 -- !query
 select to_timestamp('009', 'DDD')
 -- !query schema


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to