srowen commented on a change in pull request #25981: [SPARK-28420][SQL] Support
the `INTERVAL` type in `date_part()`
URL: https://github.com/apache/spark/pull/25981#discussion_r332485044
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala
##########
@@ -2067,6 +2082,10 @@ object DatePart {
224
> SELECT _FUNC_('SECONDS', timestamp'2019-10-01 00:00:01.000001');
1.000001
+ > SELECT _FUNC_('days', interval 1 year 10 months 5 days);
Review comment:
Yeah, it seems inconsistent. Sometimes the entire interval's length is
return in the given unit, sometimes just a portion of the interval matching
that unit is returned. I wonder if there is any other standard to look at.
Doesn't this current PR have the same consistency question, given the
current test output?
I'm mostly concerned with having consistent semantics, whatever they are. If
it can't be done reasonably, hm, should we implement this?
I'm trying to figure out the use case for "a date part of an interval". I
can only think of cases where the interval should be converted entirely into
some unit.
----------------------------------------------------------------
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]