[
https://issues.apache.org/jira/browse/FLINK-18683?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Timo Walther closed FLINK-18683.
--------------------------------
Fix Version/s: 1.12.0
Resolution: Fixed
Fixed in 1.12.0: 3fd1f64e6bd5d6b0729484a0999ba12be99e364b
> Support @DataTypeHint for TableFunction output types
> ----------------------------------------------------
>
> Key: FLINK-18683
> URL: https://issues.apache.org/jira/browse/FLINK-18683
> Project: Flink
> Issue Type: Sub-task
> Components: Table SQL / API
> Reporter: Fabian Hueske
> Assignee: Timo Walther
> Priority: Minor
> Labels: pull-request-available
> Fix For: 1.12.0
>
>
> For ScalarFunctions, the return type of an eval method can be declared with a
> {{@DataTypeHint}}:
> {code:java}
> @DataTypeHint("INT")
> public Integer eval(Integer value) {
> return value * 2;
> }{code}
> This does not work for TableFunctions because the {{@DataTypeHint}}
> annotation refers to the {{void}} return type. Hence, {{TableFunction}}
> {{eval()}} methods must always be annotated with the more complex
> {{@FunctionHint}} method.
> However, I think that context, it is clear that the {{@DataTypeHint}}
> annotation refers to the actual return type of the table function (the type
> parameter of {{TableFunction<OUT>}}).
> We could consider allowing {{@DataTypeHint}} annotations also on
> {{TableFunction}} classes (defining the output type of all eval methods) and
> {{eval()}} methods.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)