0
내 코드는 다음과 같습니다의 PrintWriter 대신 HDFS 경로에 이중 슬래시의 한 슬래시를 고려하고있다
val df = sqlContext.read
.format("com.databricks.spark.xml")
.option("rowTag", header)
.load("/input/du3_init.dat")
val dfCI2 = df.select("CI2")
dfCI2.printSchema()
val path="hdfs://nameservice/user/CI2_Schema"
new PrintWriter(path) { write(dfCI2.schema.treeString);close}
내가 스파크에서 실행, 내가
Exception in thread "main" java.io.FileNotFoundException: hdfs:/nameservice/user/CI2_Schema (No such file or directory)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:221)
at java.io.FileOutputStream.<init>(FileOutputStream.java:110)
하나의 슬래시를 얻고 것은에 존재 hdfs 경로는 예외로 표시됩니다. 이 문제를 해결하는 방법? 미리 감사드립니다.
'PrintWriter'는'hdfs : //'또는'ftp : //'를 가진 네트워크 경로를 이해하지 못합니다. 그것은 로컬 파일 시스템과 함께 작동합니다. 그리고 로컬 파일 시스템 경로는'a/b/c' 형식입니다. –