Skip to content

Even after adapting the code to new version of DSX on spark getting errors #6

Description

@tjhgit

See my pull request.

%AddJar https://github.com/tjhgit/jarhub/raw/master/streaming-twitter-assembly-1.6.jar -f
val demo = com.ibm.cds.spark.samples.StreamingTwitter
// val config = demo.getConfig()
//Watson Tone Analyzer service
demo.setConfig("watson.tone.url","https://gateway.watsonplatform.net/tone-analyzer/api")
demo.setConfig("watson.api.version","2017-09-21")
demo.setConfig("watson.tone.password","xxx")
demo.setConfig("watson.tone.username","xxxx")

demo.setConfig("twitter4j.oauth.consumerKey","xxxx")
demo.setConfig("twitter4j.oauth.consumerSecret","xxxx")
demo.setConfig("twitter4j.oauth.accessToken","xxxx")
demo.setConfig("twitter4j.oauth.accessTokenSecret","xxxx")

import org.apache.spark.streaming._
demo.startTwitterStreaming(sc, Seconds(30))

Leads to the following error:

Name: Compile Error
Message: :42: error: type mismatch;
found : org.apache.spark.org.apache.spark.org.apache.spark.org.apache.spark.org.apache.spark.SparkContext
required: org.apache.spark.org.apache.spark.org.apache.spark.org.apache.spark.org.apache.spark.SparkContext
demo.startTwitterStreaming(sc, Seconds(30))
^
StackTrace:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions