could not find implicit value for evidence parameter of type
Error:(34, 26) could not find implicit value for evidence parameter of type org.apache.flink.api.common.typeinfo.TypeInformation[(String, Long, Int)]
val tsDS = dataDS.map(str => {
Error:(34, 26) not enough arguments for method map: (implicit evidence$8: org.apache.flink.api.common.typeinfo.TypeInformation[(String, Long, Int)])org.apache.flink.streaming.api.scala.DataStream[(String, Long, Int)].
Unspecified value parameter evidence$8.
val tsDS = dataDS.map(str => {
/home/appleyuchi/桌面/Flink_Code/水位线实验/src/main/scala/PunctuatedWatermarks.scala
Error:(20, 26) could not find implicit value for evidence parameter of type org.apache.flink.api.common.typeinfo.TypeInformation[(String, Long, Int)]
val tsDS = dataDS.map(str => {
Error:(20, 26) not enough arguments for method map: (implicit evidence$8: org.apache.flink.api.common.typeinfo.TypeInformation[(String, Long, Int)])org.apache.flink.streaming.api.scala.DataStream[(String, Long, Int)].
Unspecified value parameter evidence$8.
val tsDS = dataDS.map(str => {
网上绝大多数博客都说要:
①import org.apache.flink.streaming.api.scala._
然而发现并没有卵用。。。
还需要注意版本,我的版本如下:
sdk2.12.12
我的pom.xml版本:
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>org.example</groupId> <artifactId>datastream_api</artifactId> <version>1.0-SNAPSHOT</version> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.1</version> <configuration> <source>1.8</source> <target>1.8</target> </configuration> </plugin> </plugins> </build> <dependencies> <!-- https://mvnrepository.com/artifact/org.apache.flink/flink-streaming-scala --> <dependency> <groupId>org.apache.flink</groupId> <artifactId>flink-streaming-scala_2.12</artifactId> <version>1.11.1</version> <!--<scope>provided</scope>--> </dependency> <dependency> <groupId>org.apache.flink</groupId> <artifactId>flink-streaming-java_2.12</artifactId> <version>1.11.1</version> <!--<scope>compile</scope>--> </dependency> <dependency> <groupId>org.apache.flink</groupId> <artifactId>flink-clients_2.12</artifactId> <version>1.11.1</version> </dependency> <dependency> <groupId>org.apache.flink</groupId> <artifactId>flink-core</artifactId> <version>1.11.1</version> </dependency> </dependencies> </project>
所以这个问题注意同时检查pom.xml和sdk以及①
不要只添加个①哈。