Spark 2.0.0 twitter streaming driver is no longer available

空扰寡人 提交于 2019-11-26 23:32:59

问题


During migration from spark 1.6.2 to spark 2.0.0 appeared that package org.apache.spark.streaming.twitter has been removed and twitter streaming is no longer available as well as dependency

<dependency>
  <groupId>org.apache.spark</groupId>
  <artifactId>spark-streaming-twitter_2.11</artifactId>
  <version>2.0.0</version>
</dependency>

Can anyone suggest how to procced twitter stream in new spark?


回答1:


Twitter (and some other) driver support has been removed in Spark 2.0.

You can see it in the removal section of the Release Notes:

Removals

The following features have been removed in Spark 2.0:

  • Less frequently used streaming connectors, including Twitter, Akka, MQTT, ZeroMQ

They have been extracted as a separate package under the Bahir Project. The twitter extension, streaming-twitter, can be found via:

sbt:

libraryDependencies += "org.apache.bahir" %% "spark-streaming-twitter" % "2.0.0"

Maven:

<dependency>
  <groupId>org.apache.bahir</groupId>
  <artifactId>spark-streaming-twitter_2.11</artifactId>
  <version>2.0.0-preview</version>
</dependency>

More on that (thanks to @IvanShulak) in the Mailing List

Edit:

For Spark 2.0.1, use:

libraryDependencies += "org.apache.bahir" %% "spark-streaming-twitter" % "2.0.1"


来源:https://stackoverflow.com/questions/38714256/spark-2-0-0-twitter-streaming-driver-is-no-longer-available

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!