Power BI和Spark on Azure HDInsight jupyter错误

时间:2018-10-27 06:09:11

标签: python azure apache-spark powerbi hdinsight

我目前正在研究PowerBI,并使用本指南介绍如何在HDInsight http://radacad.com/power-bi-and-spark-on-azure-hdinsight-step-by-step-guide#comment-87691上连接到Spark

每次运行以下脚本时,都会出现以下错误

"from pyspark import SparkContext
from pyspark.sql import *
from pyspark.sql import HiveContext
from pyspark.sql import Row
# Create Spark and Hive contexts
sc = SparkContext('yarn-client')
hiveCtx = HiveContext(sc)

它抛出

Cannot run multiple SparkContexts at once; existing SparkContext(app=remotesparkmagics, master=yarn) created by __init__ at /mnt/resource/hadoop/yarn/local/usercache/livy/appcache/application_1540610068228_0022/container_1540610068228_0022_01_000001/tmp/5339487565003813329:595 
Traceback (most recent call last):
  File "/usr/hdp/current/spark2-client/python/pyspark/context.py", line 116, in __init__
    SparkContext._ensure_initialized(self, gateway=gateway, conf=conf)
  File "/usr/hdp/current/spark2-client/python/pyspark/context.py", line 318, in _ensure_initialized
    callsite.function, callsite.file, callsite.linenum))
ValueError: Cannot run multiple SparkContexts at once; existing SparkContext(app=remotesparkmagics, master=yarn) created by __init__ at /mnt/resource/hadoop/yarn/local/usercache/livy/appcache/application_1540610068228_0022/container_1540610068228_0022_01_000001/tmp/5339487565003813329:595

我该如何解决?

谢谢**强

0 个答案:

没有答案