You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/08/07 23:34:19 UTC

[GitHub] [spark] maropu edited a comment on issue #25189: [SPARK-28435][SQL] Support accepting the interval keyword in the schema string

maropu edited a comment on issue #25189: [SPARK-28435][SQL] Support accepting the interval keyword in the schema string
URL: https://github.com/apache/spark/pull/25189#issuecomment-519305483
 
 
   Yea, pg can explicitly cast a text to interval;
   ```
   postgres=# \d t
                     Table "public.t"
      Column    | Type | Collation | Nullable | Default 
   -------------+------+-----------+----------+---------
    intervalstr | text |           |          | 
   
   postgres=# select * from t;
    intervalstr 
   -------------
    1 hour
   (1 row)
   
   postgres=# select cast(intervalstr as interval) from t;
    intervalstr 
   -------------
    01:00:00
   (1 row)
   
   postgres=# create temporary view v as select cast(intervalstr as interval) from t;
   postgres=# \d v
                      View "pg_temp_3.v"
      Column    |   Type   | Collation | Nullable | Default 
   -------------+----------+-----------+----------+---------
    intervalstr | interval |           |          | 
   
   // literal case
   postgres=# select cast('1 hour' as interval);
    interval 
   ----------
    01:00:00
   (1 row)
   ```

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

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