Github user HyukjinKwon commented on a diff in the pull request:
https://github.com/apache/spark/pull/17987#discussion_r116534680
--- Diff:
sql/core/src/test/scala/org/apache/spark/sql/execution/command/DDLSuite.scala
---
@@ -2041,15 +2046,22 @@ abstract class DDLSuite extends QueryTest with
SQLTestUtils {
Seq("a b", "a:b", "a%b").foreach { specialChars =>
test(s"location uri contains $specialChars for datasource table") {
+ // On Windows, it looks colon in the file name is illegal by
default. See
+ // https://support.microsoft.com/en-us/help/289627
+ assume(!Utils.isWindows || specialChars != "a:b")
+
withTable("t", "t1") {
withTempDir { dir =>
val loc = new File(dir, specialChars)
loc.mkdir()
+ // The parser does not recognizes the backslashes on Windows as
they are.
+ // These currently should be escaped.
+ val escapedLoc = loc.getAbsolutePath.replace("\\", "\\\\")
--- End diff --
Here, with special characters with path, it seems we can't use URI because
it has double-encoding problem. For example, a white space ` ` becomes `%20`
from path to URI and `%20` becomes `%2520` with another encoding.
So, here, it just tries to make `\` to `\\` in order to make the Windows
path goes through the parser.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]