cloud-fan commented on a change in pull request #26497: 
[SPARK-29873][SQL][TESTS] Support `--import` directive to load queries from 
another test case in SQLQueryTestSuite
URL: https://github.com/apache/spark/pull/26497#discussion_r345756589
 
 

 ##########
 File path: sql/core/src/test/resources/sql-tests/inputs/interval.sql
 ##########
 @@ -88,3 +88,47 @@ select justify_interval(interval '1 month -59 day 25 hour');
 select justify_days(interval '1 month 59 day -25 hour');
 select justify_hours(interval '1 month 59 day -25 hour');
 select justify_interval(interval '1 month 59 day -25 hour');
+
+-- interval
+select interval 13.123456789 seconds, interval -13.123456789 second;
+select interval 1 year 2 month 3 week 4 day 5 hour 6 minute 7 seconds 8 
millisecond 9 microsecond;
+select interval '30' year '25' month '-100' day '40' hour '80' minute 
'299.889987299' second;
+select interval '0 0:0:0.1' day to second;
+select interval '10-9' year to month;
+select interval '20 15:40:32.99899999' day to hour;
+select interval '20 15:40:32.99899999' day to minute;
+select interval '20 15:40:32.99899999' day to second;
+select interval '15:40:32.99899999' hour to minute;
+select interval '15:40.99899999' hour to second;
+select interval '15:40' hour to second;
+select interval '15:40:32.99899999' hour to second;
+select interval '20 40:32.99899999' minute to second;
+select interval '40:32.99899999' minute to second;
+select interval '40:32' minute to second;
+
+-- ns is not supported
+select interval 10 nanoseconds;
+
+-- map + interval test
+select map(1, interval 1 day, 2, interval 3 week);
+
+-- typed interval expression
+select interval 'interval 3 year 1 hour';
+select interval '3 year 1 hour';
+
+-- malformed interval literal
+select interval;
+select interval 1 fake_unit;
+select interval 1 year to month;
+select interval '1' year to second;
+select interval '10-9' year to month '2-1' year to month;
+select interval '10-9' year to month '12:11:10' hour to second;
+select interval '1 15:11' day to minute '12:11:10' hour to second;
+select interval 1 year '2-1' year to month;
+select interval 1 year '12:11:10' hour to second;
+select interval '10-9' year to month '1' year;
+select interval '12:11:10' hour to second '1' year;
+
+-- awareness of the negative sign before type
+select +integer '7';
 
 Review comment:
   we shouldn't test integer in `interval.sql`, but we should test `-interval 
'1 second'` to match the comment

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to