Jefffrey opened a new issue, #18175:
URL: https://github.com/apache/datafusion/issues/18175

   ### Describe the bug
   
   Calling ceil/floor via sql allows passing in two arguments which is not 
intended.
   
   ### To Reproduce
   
   ```sql
   > select ceil(50.5123, 1);
   +------------------------+
   | ceil(Float64(50.5123)) |
   +------------------------+
   | 51.0                   |
   +------------------------+
   1 row(s) fetched.
   Elapsed 0.002 seconds.
   
   > select floor(50.5123, 2347819);
   +-------------------------+
   | floor(Float64(50.5123)) |
   +-------------------------+
   | 50.0                    |
   +-------------------------+
   ```
   
   ### Expected behavior
   
   These should return a clear error that we expect only one argument.
   
   ### Additional context
   
   Issue seems to be here:
   
   
https://github.com/apache/datafusion/blob/7c215ed8dc850bcc2632fa5183ccdc58dd6491e7/datafusion/sql/src/expr/mod.rs#L497-L504
   
   - Specifically the ignored `field` fields
   
   We should check these fields to make sure we accept only SQL expressions 
that correspond to `ceil(1)` and `floor(1)` (single arguments).
   
   We should also add tests to our sqllogictest suite to capture this expected 
error (if not already present).


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


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

Reply via email to