neilconway commented on code in PR #23922:
URL: https://github.com/apache/datafusion/pull/23922#discussion_r3980447545


##########
datafusion/functions/src/math/factorial.rs:
##########
@@ -116,6 +117,16 @@ impl ScalarUDFImpl for FactorialFunc {
         }
     }
 
+    fn output_ordering(&self, inputs: &[ExprProperties]) -> 
Result<SortProperties> {
+        // Keep the same ordering as the input
+        Ok(inputs[0].sort_properties)
+    }

Review Comment:
   Worth adding a test for this?



##########
datafusion/functions/src/math/factorial.rs:
##########
@@ -116,6 +117,16 @@ impl ScalarUDFImpl for FactorialFunc {
         }
     }
 
+    fn output_ordering(&self, inputs: &[ExprProperties]) -> 
Result<SortProperties> {
+        // Keep the same ordering as the input
+        Ok(inputs[0].sort_properties)
+    }
+
+    fn strictly_order_preserving(&self, _inputs: &[ExprProperties]) -> 
Result<bool> {
+        // factorial(0) == factorial(1) == 1 so orderingis not preserved

Review Comment:
   Typo in 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.

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