dongjoon-hyun commented on a change in pull request #26274: 
[SPARK-29109][SQL][TESTS] Port window.sql (Part 3)
URL: https://github.com/apache/spark/pull/26274#discussion_r339404721
 
 

 ##########
 File path: 
sql/core/src/test/resources/sql-tests/inputs/postgreSQL/window_part3.sql
 ##########
 @@ -36,17 +35,17 @@ create table datetimes (
     f_timestamp timestamp
 ) using parquet;
 
-insert into datetimes values
-(1, '11:00', '11:00 BST', '1 year', '2000-10-19 10:23:54+01', '2000-10-19 
10:23:54'),
-(2, '12:00', '12:00 BST', '2 years', '2001-10-19 10:23:54+01', '2001-10-19 
10:23:54'),
-(3, '13:00', '13:00 BST', '3 years', '2001-10-19 10:23:54+01', '2001-10-19 
10:23:54'),
-(4, '14:00', '14:00 BST', '4 years', '2002-10-19 10:23:54+01', '2002-10-19 
10:23:54'),
-(5, '15:00', '15:00 BST', '5 years', '2003-10-19 10:23:54+01', '2003-10-19 
10:23:54'),
-(6, '15:00', '15:00 BST', '5 years', '2004-10-19 10:23:54+01', '2004-10-19 
10:23:54'),
-(7, '17:00', '17:00 BST', '7 years', '2005-10-19 10:23:54+01', '2005-10-19 
10:23:54'),
-(8, '18:00', '18:00 BST', '8 years', '2006-10-19 10:23:54+01', '2006-10-19 
10:23:54'),
-(9, '19:00', '19:00 BST', '9 years', '2007-10-19 10:23:54+01', '2007-10-19 
10:23:54'),
-(10, '20:00', '20:00 BST', '10 years', '2008-10-19 10:23:54+01', '2008-10-19 
10:23:54');
+-- Spark cannot safely cast StringType to TimestampType
+insert into datetimes values (1, cast ('11:00' as timestamp), cast ('11:00 
BST' as timestamp), cast ('1 year' as timestamp), cast ('2000-10-19 
10:23:54+01' as timestamp), cast('2000-10-19 10:23:54' as timestamp));
 
 Review comment:
   Ur, does this work?
   ```
   spark-sql> select cast ('11:00 BST' as timestamp);
   NULL
   Time taken: 2.248 seconds, Fetched 1 row(s)
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to