from pyspark import SparkContext
from pyspark.sql import SparkSession
from pyspark.sql.types import *
import os
os.environ['PYSPARK_SUBMIT_ARGS'] = '--packages com.databricks:spark-xml_2.10:0.4.1 pyspark-shell'
conf = SparkConf().setAppName('Stackoverflow')
sc = SparkContext(master="local", appName="test")
sc.setLogLevel("Error")
spark = SparkSession.builder.getOrCreate()
df=spark.read.format("com.databricks.spark.xml").option("rowTag","Transaction").load("C:/Users/Rajaraman/Desktop/task/data/transactions.xml")
Unable to Traceback (most recent call last): File "C:/Users/Rajaraman/test.py", line 6, in conf = SparkConf().setAppName('Stackoverflow') NameError: name 'SparkConf' is not defined
敬请检阅
您需要导入代码中引用的库
添加此行以导入引用的包
相关问题 更多 >
编程相关推荐