2017-03-28 5 views
1

Jupiter of Azure Sparkに外部パッケージを追加しようとしています。Jupiter of Azure Sparkでの外部パッケージの使用方法Spark

%%configure -f 
{ "packages" : [ "com.microsoft.azure:spark-streaming-eventhubs_2.11:2.0.4" ] } 

その出力:

Current session configs: {u'kind': 'spark', u'packages': [u'com.microsoft.azure:spark-streaming-eventhubs_2.11:2.0.4']} 

しかし、私はインポートしようとしたときに:私も試した

The code failed because of a fatal error: Invalid status code '400' from http://an0-o365au.zdziktedd3sexguo45qd4z4qhg.xx.internal.cloudapp.net:8998/sessions with error payload: "Unrecognized field \"packages\" (class com.cloudera.livy.server.interactive.CreateInteractiveRequest), not marked as ignorable (15 known properties: \"executorCores\", \"conf\", \"driverMemory\", \"name\", \"driverCores\", \"pyFiles\", \"archives\", \"queue\", \"kind\", \"executorMemory\", \"files\", \"jars\", \"proxyUser\", \"numExecutors\", \"heartbeatTimeoutInSecond\" [truncated]])\n at [Source: [email protected]; line: 1, column: 32] (through reference chain: com.cloudera.livy.server.interactive.CreateInteractiveRequest[\"packages\"])".

Some things to try: a) Make sure Spark has enough available resources for Jupyter to create a Spark context. For instructions on how to assign resources see http://go.microsoft.com/fwlink/?LinkId=717038 b) Contact your cluster administrator to make sure the Spark magics library is configured correctly.

import org.apache.spark.streaming.eventhubs.EventHubsUtils 

が、私はエラーを得ました
%%configure 
{ "conf": {"spark.jars.packages": "com.microsoft.azure:spark-streaming-eventhubs_2.11:2.0.4" }} 

同じエラーが発生しました。

Azure SparkのJupyterで外部パッケージを使用する正しい方法を教えてもらえますか?

+0

私は同じ問題を扱っています。これは、eventhubが必要としているライブラリーの異なるスカラバージョンに対応していると思われます。 –

答えて

0

HDInsight 3.6を使用している場合は、以下を使用してください。あなたのパッケージ名、バージョンとScalaのバージョンが正しいことを確認し、また

%%configure -f {"conf":{"spark.jars.packages":"com."com.microsoft.azure:spark-streaming-eventhubs_2.11:2.0.4"}}

:また、これを実行する前に、あなたのカーネルを再起動してください。具体的には、使用しようとしているJARがこの質問の投稿以降に名前を変更しました。それが現在呼び出されているものに関する詳細は、こちらをご覧ください:https://github.com/Azure/azure-event-hubs-spark

+0

まだ動作していません、エラーが発生しました "致命的なエラーのためコードが失敗しました: \tセッション9が予期せず最終ステータス 'dead'になりました。 "しかし、設定を削除して再起動すると、エラーは発生しません。 – derek

+0

これは、JAR名やバージョン番号が間違っていたときに起こったことです。 Jarの名前を確認して、名前とバージョン番号が正しいことを確認しましたか?あなたが追加しようとしているJAR(EventHubs-spark)が名前を変更したと私の答えで言及しました。更新されたJARの名前とバージョンの詳細については、リンク先のGitHubリポジトリを参照してください。 – DataGeek

+0

これは私が試したものです:%% configure -f {"conf":{"spark.jars.packages": "com.microsoft.azure:azure-eventhubs-spark_2.11:2.1.6-SNAPSHOT"} }と "import org.apache.spark.eventhubs._"のエラーメッセージが表示されます: "java.lang.Exception:120秒でタグlivy-session-11-h64fyxzfでYARNアプリケーションが見つかりません。ステータス、それは非常に忙しいかもしれません。 – derek

関連する問題