Jackie-Jiang commented on code in PR #18932:
URL: https://github.com/apache/pinot/pull/18932#discussion_r3663788847


##########
pinot-common/src/main/java/org/apache/pinot/common/function/scalar/ArithmeticFunctions.java:
##########
@@ -155,7 +156,8 @@ public static double truncate(double a) {
     return Math.signum(a) * Math.floor(Math.abs(a));
   }
 
-  @ScalarFunction(isDeterministic = false)
+  @ScalarFunction(isDeterministic = false,
+      ingestionReplayDeterminism = 
IngestionReplayDeterminism.NON_DETERMINISTIC)

Review Comment:
   Do we need to change this one?



##########
pinot-spi/src/main/java/org/apache/pinot/spi/annotations/ScalarFunction.java:
##########
@@ -67,5 +67,36 @@
    */
   boolean isDeterministic() default true;
 
+  /**
+   * Whether the scalar function should be treated as deterministic when an 
ingestion transform is replayed.

Review Comment:
   (minor) use markdown



##########
pinot-spi/src/main/java/org/apache/pinot/spi/annotations/ScalarFunction.java:
##########
@@ -67,5 +67,36 @@
    */
   boolean isDeterministic() default true;
 
+  /**
+   * Whether the scalar function should be treated as deterministic when an 
ingestion transform is replayed.
+   *
+   * <p>This is separate from {@link #isDeterministic()}, which controls 
compile-time evaluation. For example,
+   * request-time functions can be evaluated once while compiling a query, but 
must not be recomputed when replaying
+   * ingestion because their result depends on the wall clock.
+   */
+  IngestionReplayDeterminism ingestionReplayDeterminism() default 
IngestionReplayDeterminism.INHERIT;

Review Comment:
   Do you think it is better to keep this dependent on query time evaluation, 
or decouple them? I feel it might be cleaner if we just add another boolean 
flag to mark whether a udf is allowed as ingestion transform



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