LuciferYang commented on code in PR #46957:
URL: https://github.com/apache/spark/pull/46957#discussion_r1637458005
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/ExternalCatalogUtils.scala:
##########
@@ -103,13 +103,13 @@ object ExternalCatalogUtils {
}
var plaintextEndIdx = path.indexOf('%')
val length = path.length
- if (plaintextEndIdx == -1 || plaintextEndIdx + 2 > length) {
+ if (plaintextEndIdx == -1 || plaintextEndIdx + 2 >= length) {
// fast path, no %xx encoding found then return the string identity
path
} else {
val sb = new java.lang.StringBuilder(length)
var plaintextStartIdx = 0
- while(plaintextEndIdx != -1 && plaintextEndIdx + 2 < length) {
+ do {
Review Comment:
Yes, what @yaooqinn said is correct:
```scala
Welcome to Scala 3.3.1 (17.0.11, Java OpenJDK 64-Bit Server VM).
Type in expressions for evaluation. Or try :help.
scala> var x = 10
|
| do {
| println("Value of x: " + x)
| x = x - 1
| } while (x > 0)
-- Error:
----------------------------------------------------------------------
3 |do {
|^^
|end of statement expected but 'do' found
```
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]