clintropolis commented on code in PR #14956:
URL: https://github.com/apache/druid/pull/14956#discussion_r1322206158


##########
processing/src/main/java/org/apache/druid/query/expression/LookupExprMacro.java:
##########
@@ -116,4 +126,15 @@ public void decorateCacheKeyBuilder(CacheKeyBuilder 
builder)
 
     return new LookupExpr(arg);
   }
+
+  private String getReplaceMissingValueWith(final List<Expr> args)
+  {
+    if (args.size() > 2) {
+      final Expr missingValExpr = args.get(2);
+      if (missingValExpr.isLiteral() && missingValExpr.getLiteralValue() != 
null) {
+        return missingValExpr.getLiteralValue().toString();
+      }
+    }
+    return null;

Review Comment:
   I think if you are not going to handle a dynamic argument for the 'missing 
value' parameter, this should be an exception if the argument is not a literal. 
There is `validationHelperCheckArgIsLiteral` that can be called if we only want 
to support this argument being a constant.
   
   Silently returning null seems incorrect



##########
processing/src/main/java/org/apache/druid/query/expression/LookupExprMacro.java:
##########
@@ -54,10 +54,11 @@ public String name()
   @Override
   public Expr apply(final List<Expr> args)
   {
-    validationHelperCheckArgumentCount(args, 2);
+    validationHelperCheckMinArgumentCount(args, 2);

Review Comment:
   this should use maybe `validationHelperCheckArgumentRange` since it requires 
2 or 3 arguments exactly



-- 
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: commits-unsubscr...@druid.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@druid.apache.org
For additional commands, e-mail: commits-h...@druid.apache.org

Reply via email to