[
https://issues.apache.org/jira/browse/DRILL-3988?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16646220#comment-16646220
]
ASF GitHub Bot commented on DRILL-3988:
---------------------------------------
arina-ielchiieva commented on a change in pull request #1483: DRILL-3988:
Expose Drill built-in functions & UDFs in a system table
URL: https://github.com/apache/drill/pull/1483#discussion_r224387658
##########
File path:
exec/java-exec/src/test/java/org/apache/drill/exec/expr/fn/registry/FunctionRegistryHolderTest.java
##########
@@ -155,6 +162,47 @@ public void testGetAllJarNames() {
compareTwoLists(expectedResult, registryHolder.getAllJarNames());
}
+ @Test
+ public void testGetAllJarsWithFunctionHolders() {
+ Map<String, List<FunctionHolder>> fnHoldersInRegistry =
registryHolder.getAllJarsWithFunctionHolders();
+ //Iterate and confirm lists are same
+ for (String jarName : newJars.keySet()) {
+ List<DrillFuncHolder> expectedHolderList = newJars.get(jarName).stream()
+ .map(FunctionHolder::getHolder) //Extract DrillFuncHolder
+ .collect(Collectors.toList());
+ List<DrillFuncHolder> testHolderList =
fnHoldersInRegistry.get(jarName).stream()
+ .map(FunctionHolder::getHolder) //Extract DrillFuncHolder
+ .collect(Collectors.toList());
+
+ compareTwoLists(expectedHolderList, testHolderList);
+ }
+
+ Map<String, String> shuffleFunctionMap = new HashMap<>();
+ // Confirm that same function spans multiple jars with different signatures
+ //Init: Expected Map of items
+ for (String jarName : newJars.keySet()) {
+ for (FunctionHolder funcHolder : newJars.get(jarName)) {
+ if (funcHolder.getName().equals(SHUFFLE_FUNC_NAME)) {
Review comment:
General recommendation is not use equals on constant to avoid NPE:
`SHUFFLE_FUNC_NAME.equals(funcHolder.getName())`. Please change here and in the
code below.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Create a sys.functions table to expose available Drill functions
> ----------------------------------------------------------------
>
> Key: DRILL-3988
> URL: https://issues.apache.org/jira/browse/DRILL-3988
> Project: Apache Drill
> Issue Type: Sub-task
> Components: Metadata
> Reporter: Jacques Nadeau
> Assignee: Kunal Khatua
> Priority: Major
> Labels: doc-impacting
> Fix For: 1.15.0
>
>
> Create a new sys.functions table that returns a list of all available
> functions.
> Key considerations:
> - one row per name or one per argument set. I'm inclined to latter so people
> can use queries to get to data.
> - we need to create a delineation between user functions and internal
> functions and only show user functions. 'CastInt' isn't something the user
> should be able to see (or run).
> - should we add a description annotation that could be included in the
> sys.functions table?
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)