You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by HG <ha...@gmail.com> on 2022/02/15 14:45:42 UTC
method select(org.apache.flink.table.api.ApiExpression cannot find symbol .select($("handlingTime"),
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
Re: method select(org.apache.flink.table.api.ApiExpression cannot find symbol .select($("handlingTime"),
Posted by HG <ha...@gmail.com>.
😬
it worked
Table t = tupled3DsTable
.window(Session.withGap(lit(5).minutes()).on($("handlingTime")).as("w"))
.groupBy($("transactionId"))
.select($("handlingTime"), $("transactionId"),
$("originalEvent"), $("handlingTime").sum().over($("w")));
Op di 15 feb. 2022 om 15:50 schreef Chesnay Schepler <ch...@apache.org>:
> 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
>
>
>
Re: method select(org.apache.flink.table.api.ApiExpression cannot find symbol .select($("handlingTime"),
Posted by HG <ha...@gmail.com>.
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 <ch...@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
>
>
>
Re: method select(org.apache.flink.table.api.ApiExpression cannot find symbol .select($("handlingTime"),
Posted by Chesnay Schepler <ch...@apache.org>.
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