You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/07/27 06:22:53 UTC

[GitHub] [spark] yaooqinn commented on a change in pull request #29220: [SPARK-32424][SQL] Fix silent data change for timestamp parsing if overflow happens

yaooqinn commented on a change in pull request #29220:
URL: https://github.com/apache/spark/pull/29220#discussion_r460670176



##########
File path: sql/core/src/test/resources/sql-tests/inputs/datetime-parsing.sql
##########
@@ -1,5 +1,33 @@
 --- TESTS FOR DATETIME PARSING FUNCTIONS ---
 
+-- parsing with pattern 'y'.
+-- the range of valid year is [1, 294247],
+-- but particularly, some thrift client use java.sql.Timestamp to parse timestamp, which allows
+-- only year values less or equal than 9999. So the cases bellow only use 9999 at most to pass
+-- ThriftServerQueryTestSuite
+select to_timestamp('1', 'y');
+select to_timestamp('009999', 'y');
+
+-- reduced two digit form is used, the range of valid year is 20-[01, 99]
+select to_timestamp('00', 'yy');
+select to_timestamp('99', 'yy');
+
+-- the range of valid year is [1, 294247], the field width padding to the range [3, 6]
+select to_timestamp('001', 'yyy');

Review comment:
       yes, that' right. I will fix this.
   




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org