unable to addSource to StreamExecutionEnvironment?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

unable to addSource to StreamExecutionEnvironment?

James Yu
Hi,

I am following the Taxi example provided on "http://training.data-artisans.com/exercises/taxiData.html", however, I got the following error message when I copy addSource line into my Intellij IDE.

error message -->
Incompatible types. Required DataStream<TaxiRide> but 'addSource' was inferred to DataStreamSource<OUT>: no instance(s) of type variable(s) OUT exist so that DataStreamSource<OUT> conforms to DataStream<TaxiRide>

addSource line -->
DataStream<TaxiRide> rides = env.addSource(
  new TaxiRideSource("/path/to/nycTaxiRides.gz", maxDelay, servingSpeed));

My question would be: how do we addSource in latest Flink? I am running flink-1.4.2.


This is a UTF-8 formatted mail
-----------------------------------------------
James C.-C.Yu
+886988713275
Reply | Threaded
Open this post in threaded view
|

Re: unable to addSource to StreamExecutionEnvironment?

James Yu
Just found out that IDE seems auto import wrong class.
While "org.apache.flink.streaming.api.datastream.DataStream" is required, "org.apache.flink.streaming.api.scala.DataStream" was imported.

This is a UTF-8 formatted mail
-----------------------------------------------
James C.-C.Yu
+886988713275

2018-03-20 16:55 GMT+08:00 James Yu <[hidden email]>:
Hi,

I am following the Taxi example provided on "http://training.data-artisans.com/exercises/taxiData.html", however, I got the following error message when I copy addSource line into my Intellij IDE.

error message -->
Incompatible types. Required DataStream<TaxiRide> but 'addSource' was inferred to DataStreamSource<OUT>: no instance(s) of type variable(s) OUT exist so that DataStreamSource<OUT> conforms to DataStream<TaxiRide>

addSource line -->
DataStream<TaxiRide> rides = env.addSource(
  new TaxiRideSource("/path/to/nycTaxiRides.gz", maxDelay, servingSpeed));

My question would be: how do we addSource in latest Flink? I am running flink-1.4.2.


This is a UTF-8 formatted mail
-----------------------------------------------
James C.-C.Yu
<a href="tel:+886%20988%20713%20275" value="+886988713275" target="_blank">+886988713275

Reply | Threaded
Open this post in threaded view
|

Re: unable to addSource to StreamExecutionEnvironment?

Fabian Hueske-2
Thanks for reporting back!

2018-03-20 10:42 GMT+01:00 James Yu <[hidden email]>:
Just found out that IDE seems auto import wrong class.
While "org.apache.flink.streaming.api.datastream.DataStream" is required, "org.apache.flink.streaming.api.scala.DataStream" was imported.

This is a UTF-8 formatted mail
-----------------------------------------------
James C.-C.Yu
<a href="tel:+886%20988%20713%20275" value="+886988713275" target="_blank">+886988713275

2018-03-20 16:55 GMT+08:00 James Yu <[hidden email]>:
Hi,

I am following the Taxi example provided on "http://training.data-artisans.com/exercises/taxiData.html", however, I got the following error message when I copy addSource line into my Intellij IDE.

error message -->
Incompatible types. Required DataStream<TaxiRide> but 'addSource' was inferred to DataStreamSource<OUT>: no instance(s) of type variable(s) OUT exist so that DataStreamSource<OUT> conforms to DataStream<TaxiRide>

addSource line -->
DataStream<TaxiRide> rides = env.addSource(
  new TaxiRideSource("/path/to/nycTaxiRides.gz", maxDelay, servingSpeed));

My question would be: how do we addSource in latest Flink? I am running flink-1.4.2.


This is a UTF-8 formatted mail
-----------------------------------------------
James C.-C.Yu
<a href="tel:+886%20988%20713%20275" value="+886988713275" target="_blank">+886988713275