You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Maxim Gekk (Jira)" <ji...@apache.org> on 2019/10/08 10:08:00 UTC

[jira] [Created] (SPARK-29385) Make `INTERVAL` values comparable

Maxim Gekk created SPARK-29385:
----------------------------------

             Summary: Make `INTERVAL` values comparable
                 Key: SPARK-29385
                 URL: https://issues.apache.org/jira/browse/SPARK-29385
             Project: Spark
          Issue Type: Sub-task
          Components: SQL
    Affects Versions: 3.0.0
            Reporter: Maxim Gekk


PostgreSQL allows to compare interval by `=`, `<>`, `<`, `<=`, `>`, `>=`. For example:
{code}
maxim=# select interval '1 month' > interval '29 days';
 ?column? 
----------
 t
{code}
but the same fails in Spark:
{code}
spark-sql> select interval 1 month > interval 29 days;
Error in query: cannot resolve '(interval 1 months > interval 4 weeks 1 days)' due to data type mismatch: GreaterThan does not support ordering on type interval; line 1 pos 7;
'Project [unresolvedalias((interval 1 months > interval 4 weeks 1 days), None)]
+- OneRowRelation
{code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org