在DataStream中的泛型中含有Tuple时,使用Lamada表达式时报错

今天在使用Flink 时泛型采用的时Tuple,在后面进行算子操作时,采用了lamada表达式发现,代码运行时报以下错误
The generic type parameters of ‘Tuple3’ are missing. In many cases lambda methods don’t provide enough information for automatic type extraction when Java generics are involved. An easy workaround is to use an (anonymous) class instead that implements the ‘org.apache.flink.api.common.functions.MapFunction’ interface. Otherwise the type has to be specified explicitly using type information.
其翻译过来缺少“Tuple3”的泛型类型参数。在许多情况下,当涉及Java泛型时,lambda方法不能为自动类型提取提供足够的信息。一个简单的解决方法是使用(匿名)类来实现网址:apache.flink.api.common.functions函数.MapFunction的接口。否则,必须使用类型信息显式指定类型。

解决问题

在这里不能使用lamada表达式,采用匿名内部类的方式解决问题
直接

DataStream<Tuple3<String,
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值