Jackie-Jiang commented on code in PR #13573:
URL: https://github.com/apache/pinot/pull/13573#discussion_r1674488712


##########
pinot-common/src/main/java/org/apache/pinot/common/function/FunctionRegistry.java:
##########
@@ -46,44 +52,96 @@ private FunctionRegistry() {
 
   private static final Logger LOGGER = 
LoggerFactory.getLogger(FunctionRegistry.class);
 
-  // TODO: consolidate the following 2
-  // This FUNCTION_INFO_MAP is used by Pinot server to look up function by # 
of arguments
-  private static final Map<String, Map<Integer, FunctionInfo>> 
FUNCTION_INFO_MAP = new HashMap<>();
-  // This FUNCTION_MAP is used by Calcite function catalog to look up function 
by function signature.
-  private static final NameMultimap<Function> FUNCTION_MAP = new 
NameMultimap<>();
+  // Key is canonical name
+  public static final Map<String, PinotScalarFunction> FUNCTION_MAP;
 
   private static final int VAR_ARG_KEY = -1;
 
   /**
    * Registers the scalar functions via reflection.
-   * NOTE: In order to plugin methods using reflection, the methods should be 
inside a class that includes ".function."
-   *       in its class path. This convention can significantly reduce the 
time of class scanning.
+   * NOTE:
+   * - To plug in a class, the class should be annotated with {@link 
ScalarFunction}, implement
+   *   {@link PinotScalarFunction}, and be under the package of name 
'*.function.*'.
+   * - To plug in a method, the method should be annotated with {@link 
ScalarFunction}, and be inside a class under the
+   *   package of name '*.function.*'.
+   * - The package name convention is used to reduce the time of class 
scanning.

Review Comment:
   Updated the doc and moved it to the top



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