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/10/09 08:17:11 UTC

[GitHub] [spark] MaxGekk commented on a change in pull request #26055: [SPARK-29368][SQL][TEST] Port interval.sql

MaxGekk commented on a change in pull request #26055: [SPARK-29368][SQL][TEST] Port interval.sql
URL: https://github.com/apache/spark/pull/26055#discussion_r332882613
 
 

 ##########
 File path: sql/core/src/test/resources/sql-tests/inputs/postgreSQL/interval.sql
 ##########
 @@ -0,0 +1,330 @@
+--
+-- Portions Copyright (c) 1996-2019, PostgreSQL Global Development Group
+--
+--
+-- INTERVAL
+-- https://github.com/postgres/postgres/blob/REL_12_STABLE/src/test/regress/sql/interval.sql
+
+-- SET DATESTYLE = 'ISO';
+-- SET IntervalStyle to postgres;
+
+-- check acceptance of "time zone style"
+-- [SPARK-29369] Accept strings without `interval` prefix in casting to intervals
+-- [SPARK-29370] Interval strings without explicit unit markings
+-- SELECT INTERVAL '01:00' AS `One hour`;
+-- SELECT INTERVAL '+02:00' AS `Two hours`;
+-- SELECT INTERVAL '-08:00' AS `Eight hours`;
+-- SELECT INTERVAL '-1 +02:03' AS `22 hours ago...`;
+-- SELECT INTERVAL '-1 days +02:03' AS `22 hours ago...`;
+-- [SPARK-29371] Support interval field values with fractional parts
+-- SELECT INTERVAL '1.5 weeks' AS `Ten days twelve hours`;
+-- SELECT INTERVAL '1.5 months' AS `One month 15 days`;
+-- SELECT INTERVAL '10 years -11 month -12 days +13:14' AS `9 years...`;
+
+-- [SPARK-29382] Support the `INTERVAL` type by Parquet datasource
 
 Review comment:
   ok. I just looked at other `*.sql` to see how we solved issue of creating a table with explicit datasource like this:
   ```
   spark-sql> CREATE TABLE INTERVAL_TBL (f1 int);
   19/10/09 11:07:19 WARN HiveMetaStore: Location: file:/user/hive/warehouse/interval_tbl specified for non-external table:interval_tbl
   Error in query: org.apache.hadoop.hive.ql.metadata.HiveException: MetaException(message:file:/user/hive/warehouse/interval_tbl is not a directory or unable to create one);
   ```
   So, we added `USING parquet` everywhere. If using parquet is some kind of common agreement. Isn't the issue in the Parquet datasource because it doesn't allow writing values of `CalendarIntervalType`.
   
   > We need to update the JIRA issue title and this comment.
   
   Could you give me any clues what would you like to see in the title. Your comment "Since this is not Parquet specific issue" gave me nothing, sorry. 

----------------------------------------------------------------
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