-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-32539][INFRA] Disallow FileSystem.get(Configuration conf) in style check by default
#29357
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -165,7 +165,7 @@ class ParquetInteroperabilitySuite extends ParquetCompatibilityTest with SharedS | |
| // the assumption on column stats, and also the end-to-end behavior. | ||
|
|
||
| val hadoopConf = spark.sessionState.newHadoopConf() | ||
| val fs = FileSystem.get(hadoopConf) | ||
| val fs = new Path(tableDir.getAbsolutePath).getFileSystem(hadoopConf) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we have this pattern at https://github.com/apache/spark/pull/29357/files#diff-2f2d1e1ffed122e56f3cb20cf7c320d6R276, too?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @dongjoon-hyun Do you mean making it here?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The method Path.getFileSystem(Configuration) is suggested: https://github.com/apache/spark/pull/29357/files#diff-2f2d1e1ffed122e56f3cb20cf7c320d6R273
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ideally we should not change the actual code when we just want to add a style check. But this is test and I think it's safe.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You are right, @gengliangwang ~ |
||
| val parts = fs.listStatus(new Path(tableDir.getAbsolutePath), new PathFilter { | ||
| override def accept(path: Path): Boolean = !path.getName.startsWith("_") | ||
| }) | ||
|
|
||
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 think it's a bit arguable to disallow it in style. If you want to just get the default file system (when path is not available),
FileSystem.getis a valid usage and a good fallback to use.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 agree this is arguable. The rule is motivated by a regression of another project. I think it is worth doing so if we treat it as a warning for potential mistakes.
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.
Okay, I am fine with it.