当前位置:   article > 正文

Flink 侧输出报错:Could not determine TypeInformation for the OutputTag type.

could not determine typeinformation for the outputtag type. the most common

一、问题描述

flink侧输出报错 The program finished with the following exception

 The program finished with the following exception:

Could not determine TypeInformation for the OutputTag type. The most common reas                                                                                                                   on is forgetting to make the OutputTag an anonymous inner class. It is also not                                                                                                                    possible to use generic type variables with OutputTags, such as 'Tuple2<A, B>'.
        org.apache.flink.util.OutputTag.<init>(OutputTag.java:68)
  • 1
  • 2
  • 3
  • 4

在这里插入图片描述

二、问题原因

因为代码中new OutputTag(“test”)后面少写了大括号{}

private static OutputTag<String> outputTag = new OutputTag<String>("test");

  • 1
  • 2

对于scala是可以少些的,但是java不能少些,这个使用java编写的时候需要注意。

三、解决办法

最后加一个大括号 “{}”

private static OutputTag<String> outputTag = new OutputTag<String>("test"){};
  • 1

四、参考文章

1.https://blog.csdn.net/YongDaiMe/article/details/108593102

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/知新_RL/article/detail/500540
推荐阅读
相关标签
  

闽ICP备14008679号