MaxGekk commented on a change in pull request #32999:
URL: https://github.com/apache/spark/pull/32999#discussion_r655896995
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala
##########
@@ -2701,8 +2702,11 @@ case class SubtractDates(
override def inputTypes: Seq[AbstractDataType] = Seq(DateType, DateType)
override def dataType: DataType = {
- // TODO(SPARK-35727): Return INTERVAL DAY from dates subtraction
- if (legacyInterval) CalendarIntervalType else DayTimeIntervalType()
+ if (legacyInterval) {
+ CalendarIntervalType
+ } else {
+ DayTimeIntervalType(DAY)
+ }
Review comment:
nit: minimal changes would be:
```
if (legacyInterval) CalendarIntervalType else DayTimeIntervalType(DAY)
```
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala
##########
@@ -2701,8 +2702,11 @@ case class SubtractDates(
override def inputTypes: Seq[AbstractDataType] = Seq(DateType, DateType)
override def dataType: DataType = {
- // TODO(SPARK-35727): Return INTERVAL DAY from dates subtraction
- if (legacyInterval) CalendarIntervalType else DayTimeIntervalType()
+ if (legacyInterval) {
+ CalendarIntervalType
+ } else {
+ DayTimeIntervalType(DAY)
+ }
Review comment:
nit: minimal changes would be:
```scala
if (legacyInterval) CalendarIntervalType else DayTimeIntervalType(DAY)
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]