File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -233,6 +233,16 @@ class DynamicPartitionDataWriter(
233233 committer.newTaskTempFile(taskAttemptContext, partDir, ext)
234234 }
235235
236+ // Creation of intermediate folders with mkdirs() required because
237+ // intermediate folders created by create() don't inherit permission bits
238+ // https://maprdrill.atlassian.net/browse/SPARK-638
239+ def createIntermediateFolder (filePath : String , taskAttemptContext : TaskAttemptContext ) {
240+ val folderPath = new Path (filePath).getParent
241+ val fileSystem = folderPath.getFileSystem(taskAttemptContext.getConfiguration)
242+ fileSystem.mkdirs(folderPath)
243+ }
244+ createIntermediateFolder(currentPath, taskAttemptContext)
245+
236246 currentWriter = description.outputWriterFactory.newInstance(
237247 path = currentPath,
238248 dataSchema = description.dataColumns.toStructType,
You can’t perform that action at this time.
0 commit comments