自定义表函数 需定义啥参数来接受 flink sql 内置函数COLLECT(DISTINCT t.tag_id) 结果?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

自定义表函数 需定义啥参数来接受 flink sql 内置函数COLLECT(DISTINCT t.tag_id) 结果?

jindy_liu

有个聚合结果  SELECT id, COLLECT(DISTINCT tag_id) AS tagids GROUP id

定义表函数进行处理,想处理tagids
@FunctionHint(output = @DataTypeHint("ROW<frule_id INT>"))
public class IdsMatched extends TableFunction<Row> {
    public void eval(Map<Integer, Integer> tagids) {
        for Integer key : tagids.keySet()) {
              collect(Row.of(key + 10 ));
        }
    }
}

提示Caused by: org.apache.calcite.sql.validate.SqlValidatorException: No match
found for function signature IdsMatched(<INTEGER MULTISET>)

应该用啥参数接这个INTEGER MULTISET?




--
Sent from: http://apache-flink.147419.n8.nabble.com/