git.net

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GitHub] jihoonson commented on a change in pull request #5958: Part 2 of changes for SQL Compatible Null Handling


jihoonson commented on a change in pull request #5958: Part 2 of changes for SQL Compatible Null Handling
URL: https://github.com/apache/incubator-druid/pull/5958#discussion_r201164223
 
 

 ##########
 File path: common/src/main/java/io/druid/math/expr/Expr.java
 ##########
 @@ -365,15 +371,21 @@ public ExprEval eval(ObjectBinding bindings)
 
     // Result of any Binary expressions is null if any of the argument is null.
     // e.g "select null * 2 as c;" or "select null + 1 as c;" will return null as per Standard SQL spec.
-    if (NullHandling.sqlCompatible() && (leftVal.isNull() || rightVal.isNull())) {
+    if (NullHandling.sqlCompatible() && (leftVal.value() == null || rightVal.value() == null)) {
       return ExprEval.of(null);
     }
 
     if (leftVal.type() == ExprType.STRING && rightVal.type() == ExprType.STRING) {
       return evalString(leftVal.asString(), rightVal.asString());
     } else if (leftVal.type() == ExprType.LONG && rightVal.type() == ExprType.LONG) {
+      if (NullHandling.sqlCompatible() && (leftVal.isNumericNull() || rightVal.isNumericNull())) {
 
 Review comment:
   Wonder why we check this here instead of changing `evalLong()` or `evalDouble` to return a nullable `Long` or `Double`, respectively. Is this to avoid boxing/unboxing? If so, I wonder how much it affects to the performance.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@xxxxxxxxxxxxxxxx


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: dev-help@xxxxxxxxxxxxxxxx




( ! ) Warning: include(msgfooter.php): failed to open stream: No such file or directory in /var/www/git/apache-druid-developers/msg00440.html on line 110
Call Stack
#TimeMemoryFunctionLocation
10.0007364664{main}( ).../msg00440.html:0

( ! ) Warning: include(): Failed opening 'msgfooter.php' for inclusion (include_path='.:/var/www/git') in /var/www/git/apache-druid-developers/msg00440.html on line 110
Call Stack
#TimeMemoryFunctionLocation
10.0007364664{main}( ).../msg00440.html:0