我正在开发一个使用 Apache Flink 的 Table API (1.12.0) 对图形流进行分组/汇总的项目。在我们的算法中,我们首先处理顶点,即将它们分组并聚合一些属性。这是我的应用程序的片段:
Table table1 = vertices
.window(Tumble.over(lit(10).seconds()).on($(EVENT_TIME)).as("w1"))
.groupBy($(ID), $(LABEL), $("w1"))
.select($(ID), $(LABEL), $("w1").rowtime().as("w1_rowtime"));
// table1.execute().print(); --> works well
// 2. Group vertices by label and/or property values
Table table2 = table1
.window(Tumble.over(lit(10).seconds()).on($("w1_rowtime")).as("w2"))
.groupBy($(LABEL), $("w2"))
.select(
$(LABEL).as("super_label"),
lit(1).count().as("super_count"),
$("w2").rowtime().as("w2_rowtime"));
// table2.execute().print(); --> works well
table2.select($("super_label"), $("w2_rowtime"))
.execute().print(); // --> throws exception
第一个窗口分组是删除重复项,因为多个边可以具有相同的源/目标顶点(即,相同的 id、标签等)和不同的时间戳(时间戳是从边获取的)。第二个分组用于按给定配置对不同的顶点进行分组并聚合其值。
问题:当我groupedVertices
在后续步骤中使用时,比如只是投影(请参阅我的剪辑的最后几行),我得到以下异常(请参阅评论中的 Jira 问题)。似乎别名w1_rowtime
不再“注册”。
有谁知道这种情况的解决方案或解决方法?