ibm-watson-data-lab / spark.samples

tutorials and samples that show you how get the most out of IBM Analytics for Apache Spark
https://developer.ibm.com/clouddataservices/docs/spark/
Apache License 2.0
79 stars 67 forks source link

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

Open tjhgit opened 6 years ago

tjhgit commented 6 years ago

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:

vaibhavisavani1910 commented 6 years ago

@tjhgit

I m having the same error