You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Dian Fu (JIRA)" <ji...@apache.org> on 2019/01/01 10:30:00 UTC

[jira] [Assigned] (FLINK-11243) GroupBy udf() can not be select in TableAPI

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

Dian Fu reassigned FLINK-11243:
-------------------------------

    Assignee: Dian Fu

> GroupBy udf() can not be select in TableAPI
> -------------------------------------------
>
>                 Key: FLINK-11243
>                 URL: https://issues.apache.org/jira/browse/FLINK-11243
>             Project: Flink
>          Issue Type: Bug
>          Components: Table API &amp; SQL
>    Affects Versions: 1.8.0
>            Reporter: sunjincheng
>            Assignee: Dian Fu
>            Priority: Major
>
> The group key can not be select in the follows TableAPI:
> {code:java}
> val result = order
>   .groupBy('o_time.substring(1, 16))
>   .select('o_time.substring(1, 16), 'o_id.count){code}
> Exception:
> {code:java}
> org.apache.flink.table.api.ValidationException: Cannot resolve field [o_time] given input [('o_time).substring(1, 16), TMP_0].
> at org.apache.flink.table.plan.logical.LogicalNode.failValidation(LogicalNode.scala:156){code}
> BTW, We can only use the following description to avoid the above problem.
> {code:java}
> val result = order
>   .select('o_id, 'c_id, 'o_time.substring(1, 16) as 'key)
>   .groupBy('key)
>   .select('key, 'o_id.count)
> {code}
> But I think it is better to make `groupby udf()` can be select in TableAPI. What do you think?



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)