如何在 HDInsight Jupyter 上添加外部依赖项?

How to add external dependencies on HDInsight Jupyter?

我在 Azure 上使用 HDInsight Spark 集群,Jupyter 无法添加外部依赖项。试过这个:

但是,如果我故意犯了错误:

%%configure
{ "packages":["com.websudos:phantom_2.10:1.27.111111111111"] }

所以这是在尝试解析包,只是不加载它们?

有没有其他方法可以使这个东西起作用?

这篇来自 HDInsight 网站的文章可能对您有所帮助: https://azure.microsoft.com/en-us/documentation/articles/hdinsight-apache-spark-jupyter-notebook-use-external-packages/

您使用的软件包不正确。故意的错误实际上是告诉你它无法解析那个包。

您可能真正想要使用的软件包似乎是 com.websudos:phantom-spark,因为这是他们构建 Spark 支持的基础? Link

%%configure -f
{ "packages":["com.websudos:phantom-spark_2.10:1.8.0"] }

然后你可以导入

import com.websudos.phantom.spark._

但是,如果您想要的是 Spark-Cassandra 连接器,datastax connector 似乎是您可以使用的连接器。

我应该说我以前从未将 Spark 与 Cassandra 一起使用过,所以请务必按照在线教程进行设置。