jihoonson commented on a change in pull request #11185:
URL: https://github.com/apache/druid/pull/11185#discussion_r633747391



##########
File path: core/src/main/java/org/apache/druid/math/expr/ExprEval.java
##########
@@ -543,7 +543,18 @@ public String asString()
   }
 
   /**
-   * returns true if numeric primitive value for this ExprEval is null, 
otherwise false.
+   * The method returns true if numeric primitive value for this {@link 
ExprEval} is null, otherwise false.
+   *
+   * If this method returns false, then the values returned by {@link 
#asLong()}, {@link #asDouble()},
+   * and {@link #asInt()} are "valid", since this method is primarily used 
during {@link Expr} evaluation to decide
+   * if primitive numbers can be fetched to use.
+   *
+   * If a type cannot sanely convert into a primitive numeric value, then this 
method should always return true so that
+   * these primitive numeric getters are not called, since returning false is 
assumed to mean these values are valid.
+   *
+   * Note that all types must still return values for {@link #asInt()}, {@link 
#asLong()}}, and {@link #asDouble()},
+   * since this can still happen if {@link NullHandling#sqlCompatible()} is 
false, but it should be assumed that this
+   * can only happen in that mode and 0s are typical and expected for values 
that would otherwise be null.

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

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