cloud-fan commented on a change in pull request #27710: [SPARK-30960][SQL] add
back the legacy date/timestamp format support in CSV/JSON parser
URL: https://github.com/apache/spark/pull/27710#discussion_r386830011
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/DateTimeUtils.scala
##########
@@ -163,6 +163,21 @@ object DateTimeUtils {
instantToMicros(localDateTime.atZone(zoneId).toInstant)
}
+ // A method called by JSON/CSV parser to clean up the legacy timestamp
string by removing the
+ // "GMT" string.
+ def cleanLegacyTimestampStr(s: String): String = {
+ val indexOfGMT = s.indexOf("GMT")
+ if (indexOfGMT != -1) {
+ // ISO8601 with a weird time zone specifier (2000-01-01T00:00GMT+01:00)
+ val s0 = s.substring(0, indexOfGMT)
+ val s1 = s.substring(indexOfGMT + 3)
Review comment:
This will be fixed by #27753
----------------------------------------------------------------
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]