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 2021/08/14 05:24:18 UTC

[GitHub] [spark] MaxGekk commented on a change in pull request #33709: [SPARK-36418][SQL] Use CAST in parsing of dates/timestamps with default pattern

MaxGekk commented on a change in pull request #33709:
URL: https://github.com/apache/spark/pull/33709#discussion_r688869845



##########
File path: mllib/src/test/scala/org/apache/spark/ml/source/image/ImageFileFormatSuite.scala
##########
@@ -95,14 +96,14 @@ class ImageFileFormatSuite extends SparkFunSuite with MLlibTestSparkContext {
       .collect()
 
     assert(Set(result: _*) === Set(
-      Row("29.5.a_b_EGDP022204.jpg", "kittens", "2018-01"),

Review comment:
       After the changes, the partition value `2018-01` became a valid date value. New partition formatter can parse it as 2018-01-01, see patterns that supported by the CAST expression:
   https://github.com/apache/spark/blob/ed0e351f05ac6edc132c3a630206b2031c419e1c/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DateTimeUtils.scala#L228
   As a consequence, Spark infers DateType as the type of partition values. And finally, it converts all strings to the type. 




-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

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