在 EMR Notebooks 中添加外部 jar

Dro*_*l80 5 scala amazon-emr apache-spark jupyter-notebook

我使用连接到 EMR 集群的 EMR Notebook。内核是 Spark,语言是 Scala。我需要一些位于 S3 存储桶中的罐子。我怎样才能添加罐子?

在'spark-shell'的情况下很容易:

spark-shell --jars "s3://some/path/file.jar, s3://some/path/faile2.jar"

同样在 Scala 控制台中我可以做

:require s3://some/path/file.jar

小智 6

启动笔记本后,您可以在单元格中执行此操作:

%%configure -f
{
"conf": {"spark.jars.packages": "com.jsuereth:scala-arm_2.11:2.0,ml.combust.bundle:bundle-ml_2.11:0.13.0,com.databricks:dbutils-api_2.11:0.0.3"},

"jars": [
        "//path to external downloaded jars"
    ],

}
Run Code Online (Sandbox Code Playgroud)


Igo*_*res 6

把它放在你的第一段:

%%configure -f
{
    "conf": {
        "spark.jars": "s3://YOUR_BUCKET/YOUR_DRIVER.jar"
    }
}
Run Code Online (Sandbox Code Playgroud)