senthh commented on code in PR #50355:
URL: https://github.com/apache/spark/pull/50355#discussion_r2009500542


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/timeExpressions.scala:
##########
@@ -233,3 +233,74 @@ object MinuteExpressionBuilder extends ExpressionBuilder {
     }
   }
 }
+
+@ExpressionDescription(

Review Comment:
   @MaxGekk Yes I tried to regenerate. But still I m seeing the same test case 
and it looks like without this PR changes also this test case is failing and I 
think it's normal to fail as "spark.sql("SELECT hour('20[18-07-30] 
12:58:59')").schema.catalogString" and "spark.sql("SELECT hour('20[28-07-30] 
12:58:59')").schema.catalogString" are not one and the same.
   
   
   DIFFERENT SCHEMAS
   ```
   
   scala> val schema1 = spark.sql("SELECT hour('20[18-07-30] 
12:58:59')").schema.catalogString.replaceAll("\\|", "|")
        | val schema2 = spark.sql("SELECT hour('20[28-07-30] 
12:58:59')").schema.catalogString.replaceAll("\\|", "|")
   val schema1: String = struct<hour(20[18-07-30] 12:58:59):int>
   val schema2: String = struct<hour(20[28-07-30] 12:58:59):int>
   
   scala> if (schema1 == schema2) {
        |   println("Schemas are the same: " + schema1)
        | } else {
        |   println(s"Schemas are different:\nSchema1: $schema1\nSchema2: 
$schema2")
        | }
   Schemas are different:
   Schema1: struct<hour(20[18-07-30] 12:58:59):int>
   Schema2: struct<hour(20[28-07-30] 12:58:59):int>
   ```
   
   SAME SCHEMA:
   
   ```
   scala> val schema1 = spark.sql("SELECT hour('20[18-07-30] 
12:58:59')").schema.catalogString.replaceAll("\\|", "&#124;")
        | val schema2 = spark.sql("SELECT hour('20[18-07-30] 
12:58:59')").schema.catalogString.replaceAll("\\|", "&#124;")
   val schema1: String = struct<hour(20[18-07-30] 12:58:59):int>
   val schema2: String = struct<hour(20[18-07-30] 12:58:59):int>
   
   scala> if (schema1 == schema2) {
        |   println("Schemas are the same: " + schema1)
        | } else {
        |   println(s"Schemas are different:\nSchema1: $schema1\nSchema2: 
$schema2")
        | }
   Schemas are the same: struct<hour(20[18-07-30] 12:58:59):int>
   ```
   
   So I feel we can ignore this test failure and create new PR to fix on this 
mismatch on schema match



-- 
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-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to