You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2020/02/21 10:44:30 UTC

[GitHub] [druid] clintropolis commented on a change in pull request #9367: string -> expression -> string -> expression

clintropolis commented on a change in pull request #9367: string -> expression -> string -> expression
URL: https://github.com/apache/druid/pull/9367#discussion_r382514476
 
 

 ##########
 File path: core/src/main/java/org/apache/druid/math/expr/ExprMacroTable.java
 ##########
 @@ -132,17 +141,29 @@ private BindingDetails supplyAnalyzeInputs()
    */
   public abstract static class BaseScalarMacroFunctionExpr implements Expr
   {
+    protected final String name;
     protected final List<Expr> args;
 
     // Use Supplier to memoize values as ExpressionSelectors#makeExprEvalSelector() can make repeated calls for them
     private final Supplier<BindingDetails> analyzeInputsSupplier;
 
-    public BaseScalarMacroFunctionExpr(final List<Expr> args)
+    public BaseScalarMacroFunctionExpr(String name, final List<Expr> args)
     {
+      this.name = name;
       this.args = args;
       analyzeInputsSupplier = Suppliers.memoize(this::supplyAnalyzeInputs);
     }
 
+    @Override
+    public String stringify()
+    {
+      return StringUtils.format(
+          "%s(%s)",
+          name,
+          Joiner.on(", ").join(args.stream().map(Expr::stringify).iterator())
 
 Review comment:
   changed

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

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