scala - Overloaded method value createDirectStream in error Spark Streaming -
when making call
val kafkaparams: map[string, string] =... var topic: string = .. val input2 = kafkautils.createdirectstream[string, string, stringdecoder, stringdecoder](ssc, kafkaparams, topic.toset)
i error:
overloaded method value createdirectstream alternatives: (jssc: org.apache.spark.streaming.api.java.javastreamingcontext,keyclass: class[string],valueclass: class[string],keydecoderclass: class[kafka.serializer.stringdecoder],valuedecoderclass: class[kafka.serializer.stringdecoder],kafkaparams: java.util.map[string,string],topics: java.util.set[string])org.apache.spark.streaming.api.java.javapairinputdstream[string,string] (ssc: org.apache.spark.streaming.streamingcontext,kafkaparams: scala.collection.immutable.map[string,string],topics: scala.collection.immutable.set[string])(implicit evidence$19: scala.reflect.classtag[string], implicit evidence$20: scala.reflect.classtag[string], implicit evidence$21: scala.reflect.classtag[kafka.serializer.stringdecoder], implicit evidence$22: scala.reflect.classtag[kafka.serializer.stringdecoder])org.apache.spark.streaming.dstream.inputdstream[(string, string)] cannot applied (org.apache.spark.streaming.streamingcontext, scala.collection.immutable.map[string,string], scala.collection.immutable.set[char])
i similar error when calling parameterised version of createstream.
any idea what's issue?
that long message topics needs set[string]
, not set[char]
.
the best way can see fix do:
topic.map(_.tostring).toset
but, if have 1 topic, set(topic)
above splits string set of single characters.
Comments
Post a Comment