Skip to content
Open
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 @@ -83,7 +83,8 @@ object ArgsParser {
*/
def validate(args: Arguments)(implicit spark: SparkSession): Boolean = {
val config = spark.sparkContext.hadoopConfiguration
val fs = FileSystem.get(config)
val fsFilePath = new Path(args.inputA)
val fs = fsFilePath.getFileSystem(config)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

plase create a separate fs instance per inputs and for output - it can be different fs - e.g. hdfs and s3 bucket

if (!fs.exists(new Path(args.inputA))) throw new IllegalArgumentException(s"Input ${args.inputA} does not exist")
if (!fs.exists(new Path(args.inputB))) throw new IllegalArgumentException(s"Input ${args.inputB} does not exist")
if (fs.exists(new Path(args.out))) throw new IllegalArgumentException(s"Output ${args.out} already exist")
Expand Down
Loading