Hi

Actually I have also line “import org.apache.flink.streaming.api.scala” on my 
code, but this line seems to be highlighted weaker in window of IDEA IntelliJ 
editor. What does this mean ?

But the same errors will still be generated.

Esa

From: Fabian Hueske [mailto:fhue...@gmail.com]
Sent: Wednesday, February 21, 2018 9:41 PM
To: Esa Heikkinen <esa.heikki...@student.tut.fi>
Cc: user@flink.apache.org
Subject: Re: Problems to use toAppendStream

Hi Esa,
whenever you observe the error "could not find implicit value for evidence 
parameter of type X" in a streaming program, you need to add the following 
import:
import org.apache.flink.streaming.api.scala._
Best, Fabian

2018-02-21 19:49 GMT+01:00 Esa Heikkinen 
<heikk...@student.tut.fi<mailto:heikk...@student.tut.fi>>:



Hi





I have tried to solve below Errors for long time, but no succeed yet. Could you 
give some hint how to solve it ?



Errors in compiling:

------------------

Error:(56, 46) could not find implicit value for evidence parameter of type 
org.apache.flink.api.common.typeinfo.TypeInformation[org.apache.flink.types.Row]

    val stream = tableEnv.toAppendStream[Row](tableTest)



Error:(56, 46) not enough arguments for method toAppendStream: (implicit 
evidence$3: 
org.apache.flink.api.common.typeinfo.TypeInformation[org.apache.flink.types.Row])org.apache.flink.streaming.api.scala.DataStream[org.apache.flink.types.Row].

Unspecified value parameter evidence$3.

    val stream = tableEnv.toAppendStream[Row](tableTest)



Code:

-----------------

import org.apache.flink.types.Row

import org.apache.flink.streaming.api.TimeCharacteristic

import org.apache.flink.streaming.api.scala.{DataStream, 
StreamExecutionEnvironment}

import org.apache.flink.table.api.TableEnvironment

import org.apache.flink.table.sources.CsvTableSource

import org.apache.flink.api.common.typeinfo.Types



object CepTest2 {



  def main(args: Array[String]) {



    println("Start ...")



    val env = StreamExecutionEnvironment.getExecutionEnvironment

    env.setStreamTimeCharacteristic(TimeCharacteristic.EventTime)



    //val tableEnv = StreamTableEnvironment.getTableEnvironment(env)

    val tableEnv = TableEnvironment.getTableEnvironment(env)



    val csvtable = CsvTableSource

      .builder

      .path("/home/esa/Log_EX1_gen_track_5.csv")

      .ignoreFirstLine

      .fieldDelimiter(",")

      .field("time", Types.INT)

      .field("id", Types.STRING)

      .field("sources", Types.STRING)

      .field("targets", Types.STRING)

      .field("attr", Types.STRING)

      .field("data", Types.STRING)

      .build



    tableEnv.registerTableSource("test", csvtable)



    val tableTest = 
tableEnv.scan("test").where("id='5'").select("id,sources,targets")



    val stream = tableEnv.toAppendStream[Row](tableTest)



    stream.print

    env.execute()

  }

}

--------------------



Reply via email to