xiangfu0 commented on code in PR #18932:
URL: https://github.com/apache/pinot/pull/18932#discussion_r3663963776


##########
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:
   Yes. With ingestion replay determinism now fully decoupled from query 
determinism, unseeded `rand()` needs an explicit 
`isIngestionReplayDeterministic = false`; seeded `rand(seed)` keeps the default 
`true`.



##########
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:
   Agreed. Replaced the tri-state/`INHERIT` property with an independent 
boolean `isIngestionReplayDeterministic()` (default `true`). 
`isDeterministic()` no longer participates in ingestion replay classification, 
and the tests now cover both independent axes plus method/class propagation.



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