Skip to content

Commit

Permalink
[VL] Prefer to use path.getFileSystem instead of FileSystem.get to cr…
Browse files Browse the repository at this point in the history
…eate FileSystem (#6123)

Co-authored-by: yikaifei <[email protected]>
  • Loading branch information
yikf and yikaifei authored Jun 19, 2024
1 parent 99596c9 commit 27c32f1
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import org.apache.spark.util.TaskResources

import com.google.common.base.Preconditions
import org.apache.arrow.c.ArrowSchema
import org.apache.hadoop.fs.{FileStatus, FileSystem, Path}
import org.apache.hadoop.fs.{FileStatus, Path}
import org.apache.hadoop.mapreduce.TaskAttemptContext

import java.io.IOException
Expand All @@ -48,8 +48,8 @@ trait VeloxFormatWriterInjects extends GlutenFormatWriterInjectsBase {
// Create the hdfs path if not existed.
val hdfsSchema = "hdfs://"
if (filePath.startsWith(hdfsSchema)) {
val fs = FileSystem.get(context.getConfiguration)
val hdfsPath = new Path(filePath)
val fs = hdfsPath.getFileSystem(context.getConfiguration)
if (!fs.exists(hdfsPath.getParent)) {
fs.mkdirs(hdfsPath.getParent)
}
Expand Down

0 comments on commit 27c32f1

Please sign in to comment.