0

I want to create a flink project written in scala.

when i importing

'flink-scala_2.11',
'flink-streaming-scala_2.11'
'flink-core', 

i can run a code like:

val someEventScalaStream = myScalaStreamm.map{x=>x.Part3} (it is using scala map function)

but i see that for each:

flink-connector-rabbitmq_2.11
flink-connector-filesystem_2.11
flink-clients_2.11

all of them depends on 'flink-java'

so when all of them imported into my solution the project is trying to use the map function of the java version & doesn't compile.

any solution?

thanks.

1 Answer 1

1

Generally apis for java and scala are put into separate packages. So make sure you use the right one. E.g. for DataStream you have

Java:

org.apache.flink.streaming.api.datastream.DataStream

Scala:

org.apache.flink.streaming.api.scala.DataStream

In this case in scala it is recommended to import:

org.apache.flink.streaming.api.scala._

If that does not cover your question could you post a concrete example when a java version of a map function is used?

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.