Will try.
The order of clauses is a little bit obscure to me.

I would expect the groupBy to come first
In the docs it only does the window and select
Indeed I need to groupBy.

Will share the complete final class when I have finished this project so
that others can benefit.

On Tue, Feb 15, 2022, 15:50 Chesnay Schepler <ches...@apache.org> wrote:

> Aren't you missing a groupBy() between window() and select()?
>
> On 15/02/2022 15:45, HG wrote:
>
> Hi all,
>
> When I execute the code :
>
> Table tupled3DsTable = tableEnv.fromDataStream(tuple3ds, Schema.newBuilder()
>                     .column("f0","TIMESTAMP_LTZ(3)") // Only  
> TIMESTAMP_LTZ(0) to TIMESTAMP_LTZ(3) allowed                    
> .column("f1","STRING")
>                     .column("f2","STRING")
>                     .watermark("f0", "SOURCE_WATERMARK()")
>                     .build()).as("handlingTime", "transactionId", 
> "originalEvent");
>
>         tupled3DsTable.printSchema();
>
>         Table t = tupled3DsTable
>           
> .window(Session.withGap(lit(5).minutes()).on($("handlingTime")).as("w"))
>           .select($("handlingTime"), $("transactionId"), $("originalEvent"), 
> $("handlingTime").sum().over($("w")));
>
> I get:
>
> error: cannot find symbol
>                 .select($("handlingTime"), $("transactionId"),
> $("originalEvent"), $("handlingTime").sum().over($("w")));
>                 ^
>   symbol:   method
> select(org.apache.flink.table.api.ApiExpression,org.apache.flink.table.api.ApiExpression,org.apache.flink.table.api.ApiExpression,org.apache.flink.table.api.ApiExpression)
>   location: interface org.apache.flink.table.api.GroupWindowedTable
>
>  The printSchema gives:
>
> (
>   `handlingTime` TIMESTAMP_LTZ(3) *ROWTIME*,
>   `transactionId` STRING,
>   `originalEvent` STRING
>
> )
>
>  Regards Hans
>
>
>

Reply via email to