richardstartin commented on a change in pull request #8304:
URL: https://github.com/apache/pinot/pull/8304#discussion_r825835310



##########
File path: 
pinot-common/src/main/java/org/apache/pinot/common/function/scalar/ArithmeticFunctions.java
##########
@@ -104,4 +111,30 @@ public static double ln(double a) {
   public static double sqrt(double a) {
     return Math.sqrt(a);
   }
+
+  @ScalarFunction
+  public static double sign(double a) {
+    return Math.signum(a);
+  }
+
+  @ScalarFunction
+  public static double pi() { return Math.PI; }
+
+  @ScalarFunction
+  public static double e() { return Math.E; }
+
+  @ScalarFunction
+  public static double power(double a, double b) {
+    return Math.pow(a, b);
+  }
+
+  @ScalarFunction
+  public static double log(double a) {
+    return Math.log10(a);
+  }

Review comment:
       I understand that it would be _nice_ to have these available for 
ingestion transforms, but that isn't actually a SQL interface and those 
functions don't need to have the names used in SQL (though for simplicity it 
would be ideal if they did match!), so if the goal of adding the functions at 
all is to increase SQL compliance I would prioritise usage in SQL, which means 
implementing TransformFunctions, given the huge performance gap. 
   
   Support for ingestion transform configs can be added later when it's 
possible to do it without making queries inefficient. Moreover, once something 
has been added, it can't be removed, so queries relying on `@ScalarFunction` 
will be difficult to optimise without major rework.




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