spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dylan Guedes (JIRA)" <>
Subject [jira] [Created] (SPARK-28602) Recognize interval as a numeric type
Date Fri, 02 Aug 2019 12:03:00 GMT
Dylan Guedes created SPARK-28602:

             Summary: Recognize interval as a numeric type
                 Key: SPARK-28602
             Project: Spark
          Issue Type: Sub-task
          Components: SQL
    Affects Versions: 3.0.0
            Reporter: Dylan Guedes

Spark does not recognize `interval` type as a `numeric` one, which means that we can't use
`interval` columns in aggregated functions. For instance, the following query works on PgSQL
but does not work on Spark:
{code:sql}SELECT i,AVG(cast(v as interval)) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND
UNBOUNDED FOLLOWING) FROM (VALUES(1,'1 sec'),(2,'2 sec'),(3,NULL),(4,NULL)) t(i,v);{code}

{code:sql}cannot resolve 'avg(CAST(`v` AS INTERVAL))' due to data type mismatch: function
average requires numeric types, not interval; line 1 pos 9{code}

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message