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/04/29 07:39:23 UTC
[GitHub] [spark] AngersZhuuuu commented on pull request #32271: [SPARK-35112][SQL] Support Cast string to day-second interval
AngersZhuuuu commented on pull request #32271:
URL: https://github.com/apache/spark/pull/32271#issuecomment-829010078
@MaxGekk I meet a case
IntervalUtils.fromDayTimeString("2:03:04") throw exception
```
[info] Cause: java.lang.IllegalArgumentException: requirement failed: Interval string must match day-time format of '^(?<sign>[+|-])?(?<day>\d+) (?<hour>\d{1,2}):(?<minute>\d{1,2}):(?<second>(\d{1,2})(\.(\d{1,9}))?)$': 2:03:04, set spark.sql.legacy.fromDayTimeString.enabled to true to restore the behavior before Spark 3.0.
```
It's a But right? since `IntervalUtils.fromDayTimeString`'s comment is
```
/**
* Parse dayTime string in form: [-]d HH:mm:ss.nnnnnnnnn and [-]HH:mm:ss.nnnnnnnnn
*
* adapted from HiveIntervalDayTime.valueOf
*/
def fromDayTimeString(s: String): CalendarInterval = {
fromDayTimeString(s, DAY, SECOND)
}
```
--
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