[ https://issues.apache.org/jira/browse/SPARK-51555?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
ASF GitHub Bot updated SPARK-51555: ----------------------------------- Labels: pull-request-available (was: ) > Add the timediff() function > --------------------------- > > Key: SPARK-51555 > URL: https://issues.apache.org/jira/browse/SPARK-51555 > Project: Spark > Issue Type: Sub-task > Components: SQL > Affects Versions: 4.1.0 > Reporter: Max Gekk > Priority: Major > Labels: pull-request-available > > Add the timediff function which returns the difference between two times > measured in units. > h4. Syntax > {code} > timediff(unit, start, end) > unit > { MICROSECOND | > MILLISECOND | > SECOND | > MINUTE | > HOUR } > {code} > h4. Arguments > * unit: A unit of measure. > * start: A starting TIME expression. > * end: An ending TIME expression. > h4. Returns > A INTEGER. > If start is greater than end the result is negative. > h4. Examples > {code:sql} > > SELECT timediff(HOUR, TIME'20:30:29', '21:30:28'); > 0 > > SELECT timediff(HOUR, TIME'20:30:29', '21:30:29'); > 1 > > SELECT timediff(HOUR, TIME'20:30:29', '12:00:00'); > -8 > {code} -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org