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

ASF GitHub Bot updated FLINK-40271:
-----------------------------------
    Labels: pull-request-available  (was: )

> Group window properties produce invalid SQL in 
> QueryOperation#asSerializableString
> ----------------------------------------------------------------------------------
>
>                 Key: FLINK-40271
>                 URL: https://issues.apache.org/jira/browse/FLINK-40271
>             Project: Flink
>          Issue Type: Bug
>          Components: Table SQL / API
>            Reporter: Timo Theusner
>            Assignee: Timo Theusner
>            Priority: Major
>              Labels: pull-request-available
>
> Table API group-window properties ({{{}$("w").rowtime(){}}}, 
> {{{}$("w").proctime(){}}}, {{{}$("w").start(){}}}, {{$("w").end())}} are not 
> translated to the corresponding windowing-TVF output columns when a 
> {{WindowAggregateQueryOperation}} is serialized back to SQL. Instead, the 
> window alias is emitted as if it were a column reference, producing SQL that 
> does not parse.
> Replication:
> {code:java}
> Table t = env.from("orders")
>         .window(Tumble.over(lit(1).minutes()).on($("ts")).as("w"))
>         .groupBy($("product_id"), $("w"))
>         .select($("product_id"), $("w").start(), $("w").end(), 
> $("w").rowtime(), $("price").sum()); 
> String sql = t.getQueryOperation()
>               .asSerializableString(DefaultSqlFactory.INSTANCE);
> env.sqlQuery(sql); // fails
> {code}
> Corresponding error message:
> {code:java}
> org.apache.flink.table.api.ValidationException: SQL validation failed. Column 
> 'w' not found in any table {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to