jonahgao commented on code in PR #11571:
URL: https://github.com/apache/datafusion/pull/11571#discussion_r1685746159


##########
datafusion/functions/src/math/log.rs:
##########
@@ -82,7 +82,13 @@ impl ScalarUDFImpl for LogFunc {
     }
 
     fn output_ordering(&self, input: &[ExprProperties]) -> 
Result<SortProperties> {
-        match (input[0].sort_properties, input[1].sort_properties) {
+        let (base_sort_properties, num_sort_properties) = if input.len() == 1 {
+            // log(x) defaults to log(10, x)
+            (SortProperties::Singleton, input[0].sort_properties)
+        } else {
+            (input[0].sort_properties, input[1].sort_properties)
+        };
+        match (num_sort_properties, base_sort_properties) {

Review Comment:
   I agree with you. I noticed that other logic also does not consider 
`nulls_first`, for example 
https://github.com/apache/datafusion/blob/36660fe10d9c0cdff62e0da0b94bee28422d3419/datafusion/expr/src/sort_properties.rs#L48-L62
   
   Maybe @berkaysynnada  can help confirm it.



-- 
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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to