You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Flink Jira Bot (Jira)" <ji...@apache.org> on 2022/04/06 22:39:00 UTC

[jira] [Updated] (FLINK-19004) Fail to call Hive percentile function together with distinct aggregate call

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

Flink Jira Bot updated FLINK-19004:
-----------------------------------
    Labels: auto-deprioritized-major pull-request-available stale-assigned  (was: auto-deprioritized-major pull-request-available)

I am the [Flink Jira Bot|https://github.com/apache/flink-jira-bot/] and I help the community manage its development. I see this issue is assigned but has not received an update in 30 days, so it has been labeled "stale-assigned".
If you are still working on the issue, please remove the label and add a comment updating the community on your progress.  If this issue is waiting on feedback, please consider this a reminder to the committer/reviewer. Flink is a very active project, and so we appreciate your patience.
If you are no longer working on the issue, please unassign yourself so someone else may work on it.


> Fail to call Hive percentile function together with distinct aggregate call
> ---------------------------------------------------------------------------
>
>                 Key: FLINK-19004
>                 URL: https://issues.apache.org/jira/browse/FLINK-19004
>             Project: Flink
>          Issue Type: Bug
>          Components: Connectors / Hive, Table SQL / Planner
>            Reporter: Rui Li
>            Assignee: luoyuxia
>            Priority: Minor
>              Labels: auto-deprioritized-major, pull-request-available, stale-assigned
>
> The following test case would fail:
> {code}
> 	@Test
> 	public void test() throws Exception {
> 		TableEnvironment tableEnv = getTableEnvWithHiveCatalog();
> 		tableEnv.unloadModule("core");
> 		tableEnv.loadModule("hive", new HiveModule());
> 		tableEnv.loadModule("core", CoreModule.INSTANCE);
> 		tableEnv.executeSql("create table src(x int,y int)");
> 		tableEnv.executeSql("select count(distinct y),`percentile`(y,`array`(0.5,0.99)) from src group by x").collect();
> 	}
> {code}
> The error is:
> {noformat}
> org.apache.flink.table.api.TableException: Cannot generate a valid execution plan for the given query: 
> FlinkLogicalLegacySink(name=[collect], fields=[EXPR$0, EXPR$1])
> +- FlinkLogicalCalc(select=[EXPR$0, EXPR$1])
>    +- FlinkLogicalAggregate(group=[{0}], EXPR$0=[COUNT($1) FILTER $3], EXPR$1=[MIN($2) FILTER $4])
>       +- FlinkLogicalCalc(select=[x, y, EXPR$1, =(CASE(=($e, 0:BIGINT), 0:BIGINT, 1:BIGINT), 0) AS $g_0, =(CASE(=($e, 0:BIGINT), 0:BIGINT, 1:BIGINT), 1) AS $g_1])
>          +- FlinkLogicalAggregate(group=[{0, 1, 3}], EXPR$1=[percentile($4, $2)])
>             +- FlinkLogicalExpand(projects=[x, y, $f2, $e, y_0])
>                +- FlinkLogicalCalc(select=[x, y, array(0.5:DECIMAL(2, 1), 0.99:DECIMAL(3, 2)) AS $f2])
>                   +- FlinkLogicalLegacyTableSourceScan(table=[[test-catalog, default, src, source: [HiveTableSource(x, y) TablePath: default.src, PartitionPruned: false, PartitionNums: null]]], fields=[x, y])
> Min aggregate function does not support type: ''ARRAY''.
> {noformat}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)