[ https://issues.apache.org/jira/browse/FLINK-16568?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17110993#comment-17110993 ]
Jingsong Lee commented on FLINK-16568: -------------------------------------- It is hard to support this, because the inputs of a aggregation are all non-constant from calcite in Flink. > Cannot call Hive UDAF that requires constant arguments > ------------------------------------------------------ > > Key: FLINK-16568 > URL: https://issues.apache.org/jira/browse/FLINK-16568 > Project: Flink > Issue Type: Bug > Components: Connectors / Hive > Reporter: Rui Li > Priority: Major > > Calling Hive's {{percentile_approx}} would fail: > {code} > hiveShell.execute("create table src (key double,val string)"); > tableEnv.loadModule("hive", new HiveModule()); > tableEnv.sqlQuery("select percentile_approx(key,0.5) from src"); > TableUtils.collectToList(tableEnv.sqlQuery("select > percentile_approx(key,0.5) from src")); > {code} > With error: > {noformat} > Caused by: org.apache.hadoop.hive.ql.exec.UDFArgumentTypeException: The > second argument must be a constant, but decimal(2,1) was passed instead. > at > org.apache.hadoop.hive.ql.udf.generic.GenericUDAFPercentileApprox.getEvaluator(GenericUDAFPercentileApprox.java:145) > at > org.apache.flink.table.functions.hive.HiveGenericUDAF.createEvaluator(HiveGenericUDAF.java:120) > at > org.apache.flink.table.functions.hive.HiveGenericUDAF.init(HiveGenericUDAF.java:92) > at > org.apache.flink.table.functions.hive.HiveGenericUDAF.getHiveResultType(HiveGenericUDAF.java:196) > ... 58 more > {noformat} -- This message was sent by Atlassian Jira (v8.3.4#803005)