-
Notifications
You must be signed in to change notification settings - Fork 346
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
Exclude non-existing objects from absolute addresses list #4367
Conversation
val hcValues = | ||
spark.sparkContext.broadcast(HadoopUtils.getHadoopConfigurationValues(hc, "fs.")) | ||
val configMapper = new ConfigMapper(hcValues) | ||
absolutePathsDF.filter(x => isPathExist(x, configMapper)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use fs.exists
?
absolutePathsDF.filter(x => isPathExist(x, configMapper)) | |
absolutePathsDF.filter(x => { | |
val p = new Path(x) | |
p.getFileSystem(configMapper.configuration).exists(p) | |
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are absolutely right :) I forgot about it, thanks!
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also think that to unify our usage we should get the FS from the path, and also exists
saves a few lines of code, but you should catch IOException
, and it might be still implemented under the isPathExist
method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (only @johnnyaug's comment)
Fixes #4366
How was this tested