You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I read the windos local folder and told me that there is insufficient permission for the java. io. FileNotFoundException. But it can be read from a single file. Is there a solution?
Is there an existing issue for this?
Current Behavior
I used the following method to read all the files in the folder, but the efficiency was slow
val files = new File(directoryPath).listFiles.filter(_.getName.endsWith(".xls"))
var df = spark.emptyDataFrame
for ((file, index) <- files.zipWithIndex) {
val temdf = spark.read.excel(
header = true,
dataAddress = "0!A1"
).load(file.toString)
if (index == 0) {
df = temdf
}else{
df = df.union(temdf)
}
}
Expected Behavior
Is it possible to directly read all the files under the folder? Union is too time-consuming
Steps To Reproduce
No response
Environment
Anything else?
No response
The text was updated successfully, but these errors were encountered: