我正在尝试使用unittest在PyCharm中运行测试文件。
此消息有误:
FileNotFoundError:[错误2]没有这样的文件或目录: 'myfolder / opt / spark /./ bin / spark-submit': 'myfolder / opt / spark /./ bin / spark-submit'
重要的是,路径myfolder/opt/spark/./bin/spark-submit
不存在,但myfolder/opt/spark/bin/spark-submit
存在。我不知道为什么将多余的./
添加到路径中。
路径代码:
sc = SparkContext(appName="CSV2Parquet")
sqlContext = SQLContext(sc)
schema = StructType([ StructField("col1", IntegerType(), True)])
rdd = sc.textFile("/Users/ash/PycharmProjects/practise/test/departments.csv").map(lambda line: line.split(","))
df = sqlContext.createDataFrame(rdd, schema) df.write.parquet('/Users/ash/PycharmProjects/practise