somu-imply commented on code in PR #15034:
URL: https://github.com/apache/druid/pull/15034#discussion_r1346676671
##########
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
Review Comment:
``` suggestion
* Alias Expression macro to create an alias and delegate operations to
the same base macro
```
##########
processing/src/test/java/org/apache/druid/math/expr/FunctionTest.java:
##########
@@ -952,6 +952,15 @@ public void testComplexDecode()
),
expected
);
+ // test with alias
Review Comment:
Nit. Might be good to add a test with 2 aliases, just to drive the point
home that we can support multiple aliases for the same
##########
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:
Is there a need to make this static? This can exist as a separate public
class maybe?
##########
processing/src/main/java/org/apache/druid/math/expr/BuiltInExprMacros.java:
##########
@@ -29,10 +29,24 @@
public class BuiltInExprMacros
{
+ public static final String COMPLEX_DECODE_BASE64_NAME =
"complex_decode_base64";
+ public static final String COMPLEX_DECODE_BASE64_ALIAS_NAME =
"decode_base64_complex";
Review Comment:
Do we plan to hold a set of built-in aliases for different macros here? In
that case, we can keep a Map of <alias_name, actual_name> so that a new
function can add to the map
--
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]