maropu commented on a change in pull request #26779: [SPARK-30150][SQL]AddFile
Command do not accept quoted path
URL: https://github.com/apache/spark/pull/26779#discussion_r355795971
##########
File path:
sql/core/src/test/scala/org/apache/spark/sql/execution/SparkSqlParserSuite.scala
##########
@@ -259,4 +259,20 @@ class SparkSqlParserSuite extends AnalysisTest {
parser.parsePlan("ALTER SCHEMA foo SET DBPROPERTIES ('x' = 'y')"))
assertEqual("DESC DATABASE foo", parser.parsePlan("DESC SCHEMA foo"))
}
+
+ test("manage resources") {
+ assertEqual("ADD FILE abc.txt", AddFileCommand("abc.txt"))
+ assertEqual("ADD FILE \'abc.txt\'", AddFileCommand("abc.txt"))
+ assertEqual("ADD FILE \"/path/to/abc.txt\"",
AddFileCommand("/path/to/abc.txt"))
+ assertEqual("LIST FILE abc.txt", ListFilesCommand("abc.txt".split("\\s+")))
+ assertEqual("LIST FILE \'/path//abc.txt\'",
ListFilesCommand("/path//abc.txt".split("\\s+")))
+ assertEqual("LIST FILE \"/path2/abc.txt\"",
ListFilesCommand("/path2/abc.txt".split("\\s+")))
+ assertEqual("ADD JAR /path2/_2/abc.jar",
AddJarCommand("/path2/_2/abc.jar"))
+ assertEqual("ADD JAR \'/test/path_2/jar/abc.jar\'",
AddJarCommand("/test/path_2/jar/abc.jar"))
+ assertEqual("ADD JAR \"abc.jar\"", AddJarCommand("abc.jar"))
+ assertEqual("LIST JAR /path-with-dash/abc.jar",
+ ListJarsCommand("/path-with-dash/abc.jar".split("\\s+")))
+ assertEqual("LIST JAR \'abc.jar\'",
ListJarsCommand("abc.jar".split("\\s+")))
+ assertEqual("LIST JAR \"abc.jar\"",
ListJarsCommand("abc.jar".split("\\s+")))
Review comment:
I saw the other pr working on supporting spaces in
`SparkContext.addJar`https://github.com/apache/spark/pull/26773
If this pr accepts `STRING` as filepath, these commands also accept spaces?
If so, can you add tests for that?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]