Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[VL] Prefer to use path.getFileSystem instead of FileSystem.get to create FileSystem #6123

Merged
merged 1 commit into from
Jun 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading