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


##########
processing/src/main/java/org/apache/druid/math/expr/BuiltInExprMacros.java:
##########
@@ -214,4 +224,31 @@ public Object getLiteralValue()
       }
     }
   }
+
+  /***
+   * Alias Expression macro to create an alias and delegate operations to the 
same base macro

Review Comment:
   javadocs on this should probably mention that for macros aliased by this 
thing, the `Expr` spit out by the `apply` method should use `name()` in all the 
places instead of an internal constant so that things like error messages 
behave correctly.



##########
extensions-core/datasketches/src/test/java/org/apache/druid/query/aggregation/datasketches/tuple/sql/ArrayOfDoublesSketchSqlAggregatorTest.java:
##########
@@ -324,7 +323,11 @@ public void testMetricsSumEstimateIntersect()
                   )
                   .context(QUERY_CONTEXT_DEFAULT)
                   .build()
-        ),
+        );
+    testQuery(sql, expectedQueries, expectedResults);
+    testQuery(
+        StringUtils.replace(sql, "COMPLEX_DECODE_BASE64", 
"DECODE_BASE64_COMPLEX"),

Review Comment:
   nit: this seems kind of unnecessary to test both, maybe we should just 
update it to use `DECODE_BASE64_COMPLEX` since that is the new preferred 
function name



##########
processing/src/main/java/org/apache/druid/math/expr/BuiltInExprMacros.java:
##########
@@ -214,4 +237,31 @@ public Object getLiteralValue()
       }
     }
   }
+
+  /***
+   * Alias Expression macro create an alias and deligates operations to same 
base macro
+   */
+  public static class AliasExprMacro implements ExprMacroTable.ExprMacro

Review Comment:
   An internal class of `ExprMacroTable` would also probably be a more 
appropriate place for this to live so it is more obvious that functions defined 
by extensions could also use this



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