美文网首页
the type miss expected process

the type miss expected process

作者: 邵红晓 | 来源:发表于2019-11-21 16:06 被阅读0次

在scala代码中报错如题目

.keyBy("itemType").process(new ProcessWindowFunction[DataInfo,GetItemTag,String,GlobalWindow] {
      override def process(key: String, context: Context, elements: Iterable[DataInfo], out: Collector[GetItemTag]): Unit = ???
    })
  • 解决办法如下
    1、.keyBy 返回的是Tuple key类型
    2、检查引入的包是否正确
.keyBy("itemType").process[GetItemTag](new ProcessWindowFunction[DataInfo,GetItemTag,Tuple,GlobalWindow] {
      override def process(key: Tuple, context: Context, elements: Iterable[DataInfo], out: Collector[GetItemTag]): Unit = {
        
      }
    }
  • fastjson在scala中使用,不要使用scala的class对象,全部对象必须使用java,否则报错
    val s = JSON.toJSONString(params,SerializerFeature.WriteMapNullValue)

相关文章

网友评论

      本文标题:the type miss expected process

      本文链接:https://www.haomeiwen.com/subject/jietwctx.html