MaxGekk commented on a change in pull request #24342: [SPARK-27438][SQL] Parse 
strings with timestamps by to_timestamp() in microsecond precision
URL: https://github.com/apache/spark/pull/24342#discussion_r276168172
 
 

 ##########
 File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala
 ##########
 @@ -203,7 +203,11 @@ object Cast {
       > SELECT _FUNC_('10' as int);
        10
   """)
-case class Cast(child: Expression, dataType: DataType, timeZoneId: 
Option[String] = None)
+case class Cast(
+    child: Expression,
+    dataType: DataType,
+    timeZoneId: Option[String] = None,
+    timestampScaleFactor: Long = MICROS_PER_SECOND)
 
 Review comment:
   I have to preserve semantic of `Cast` in `ParseToTimestamp`. I could create 
a parent class for `Cast` like `BaseCast` with `timestampScaleFactor`, and 
inherit it in `Cast` with `timestampScaleFactor` set to `MICROS_PER_SECOND`. 
WDYT?

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