dongjoon-hyun commented on a change in pull request #26438: [SPARK-29408][SQL] 
Support sign before `interval` in interval literals
URL: https://github.com/apache/spark/pull/26438#discussion_r344470780
 
 

 ##########
 File path: sql/core/src/test/resources/sql-tests/inputs/interval.sql
 ##########
 @@ -41,3 +41,20 @@ select max(cast(v as interval)) from VALUES ('1 seconds'), 
('4 seconds'), ('3 se
 
 -- min
 select min(cast(v as interval)) from VALUES ('1 seconds'), ('4 seconds'), ('3 
seconds') t(v);
+
+-- multiply and divide an interval by a number
+select 3 * (timestamp'2019-10-15 10:11:12.001002' - date'2019-10-15');
+select interval 4 month 2 weeks 3 microseconds * 1.5;
+select (timestamp'2019-10-15' - timestamp'2019-10-14') / 1.5;
+
+-- interval operation with null and zero case
+select interval '2 seconds' / 0;
+select interval '2 seconds' / null;
+select interval '2 seconds' * null;
+select null * interval '2 seconds';
 
 Review comment:
   +1 for this moving from `datetime.sql` to `interval.sql`.

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