[ 
https://issues.apache.org/jira/browse/FLINK-13741?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16909015#comment-16909015
 ] 

Bowen Li commented on FLINK-13741:
----------------------------------

Thanks [~Terry1897] for the summary of existing systems!

Hi [~twalthr], w.r.t. "Once FunctionCatalog has been integrated into the 
catalog API and built-in functions are stored there as well, this should be 
easily doable.", currently {{FunctionCatalog}} wraps {{CatalogManager}} and 
builtin functions can be easily obtained thru 
{{BuiltInFunctionDefinitions.getDefinitions()}}, thus my understanding is it's 
already doable, no?

seems to me what need to be done is 1) add {{listFuntions()}} API to 
TableEnvironment and FunctionCatalog 2) add new {{Executor.listFunctions()}} 
API (I'll just keep {{Executor.listUserDefinedFunctions()}} API for now in case 
we want to support showing UDFs only in the future) 3) make {{SHOW FUNCTIONS;}} 
call {{executor.listFunctions()}}

W.r.t. "We should also introduce a syntax SHOW EXTENDED FUNCTION", shall they 
be {{DESCRIBE FUNCTION <function_name>;}} and {{DESCRIBE FUNCTION EXTENDED 
<function_name>;}}?

> "SHOW FUNCTIONS" should include Flink built-in functions' names
> ---------------------------------------------------------------
>
>                 Key: FLINK-13741
>                 URL: https://issues.apache.org/jira/browse/FLINK-13741
>             Project: Flink
>          Issue Type: Bug
>          Components: Table SQL / API
>    Affects Versions: 1.9.0
>            Reporter: Bowen Li
>            Assignee: Bowen Li
>            Priority: Critical
>              Labels: pull-request-available
>             Fix For: 1.10.0
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Currently "SHOW FUNCTIONS;" only returns catalog functions and 
> FunctionDefinitions registered in memory, but does not include Flink built-in 
> functions' names.
> AFAIK, it's standard for "SHOW FUNCTIONS;" to show all available functions 
> for use in queries in SQL systems like Hive, Presto, Teradata, etc, thus it 
> includes built-in functions naturally. Besides, 
> {{FunctionCatalog.lookupFunction(name)}} resolves calls to built-in 
> functions, it's not feeling right to not displaying functions but can 
> successfully resolve to them.
> It seems to me that the root cause is the call stack for "SHOW FUNCTIONS;" 
> has been a bit messy - it calls {{tEnv.listUserDefinedFunctions()}} which 
> further calls {{FunctionCatalog.getUserDefinedFunctions()}}, and I'm not sure 
> what's the intention of those two APIs. Are they dedicated to getting all 
> functions, or just user defined functions excluding built-in ones?
> In the end, I believe "SHOW FUNCTIONS;" should display built-in functions. To 
> achieve that, we either need to modify and/or rename existing APIs mentioned 
> above, or add new APIs to return all functions from FunctionCatalog.
> cc [~xuefuz] [~lirui] [~twalthr]



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

Reply via email to