flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (Jira)" <j...@apache.org>
Subject [jira] [Updated] (FLINK-14782) CoreModule#getFunctionDefinition should return empty optional when function does not exist
Date Thu, 14 Nov 2019 21:24:00 GMT

     [ https://issues.apache.org/jira/browse/FLINK-14782?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

ASF GitHub Bot updated FLINK-14782:
-----------------------------------
    Labels: pull-request-available  (was: )

> CoreModule#getFunctionDefinition should return empty optional when function does not
exist
> ------------------------------------------------------------------------------------------
>
>                 Key: FLINK-14782
>                 URL: https://issues.apache.org/jira/browse/FLINK-14782
>             Project: Flink
>          Issue Type: Bug
>          Components: Table SQL / Planner
>    Affects Versions: 1.10.0
>            Reporter: Dawid Wysakowicz
>            Assignee: Bowen Li
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.10.0
>
>
> As in the subject CoreModule#getFunctionDefinition throws exception when function does
not exist, while it should just return an Optional.empty(). 
> {code}
> 	@Test
> 	public void testGetFunction() {
> 		Optional<FunctionDefinition> optional = CoreModule.INSTANCE.getFunctionDefinition("AAA");
> 	}
> {code}
> An easy fix would be to change the {{CoreModule#getFunctionDefinition}} to
> {code}
> 	@Override
> 	public Optional<FunctionDefinition> getFunctionDefinition(String name) {
> 		return BuiltInFunctionDefinitions.getDefinitions().stream()
> 			.filter(f -> f.getName().equalsIgnoreCase(name))
> 			.findFirst()
> 			.map(Function.identity());
> 	}
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Mime
View raw message