samuelcolvin commented on issue #6390:
URL: https://github.com/apache/arrow-rs/issues/6390#issuecomment-2350940100

   The most likely scenario where it could come up is `select interval '5 day' 
hour`, but I agree even that seems like either allowing a common mistake, or a 
side effect of their very permissive parser.
   
   ---
   
   While we're talking about weird things postgres supports, as per 
https://github.com/sqlparser-rs/sqlparser-rs/issues/1345#issuecomment-2334514705,
 the following  are also supported:
   
   ```sql
   select interval '1 month + 2 day'
   select interval '1 minute + 2 s'  -- makes sense, all units are supported in 
arithmetic expressions
   select interval '1 minute - 2 s'
   select interval '1 minute + 2'  -- makes sense since raw numbers are 
interpreted as seconds
   select interval '1 minute * 2s'  -- this is crazy! the "*" operator is 
interpretted as "+" so this evaluates as 0:01:02
   select interval '1 minute minute' -- repeated units are ignored
   select interval '1 month + 2 day' day -- same thing with the units just 
concatenated
   ```


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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to