-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-27552][SQL]The configuration hive.exec.stagingdir is invalid on Windows OS
#24446
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
Conversation
|
Test build #104849 has finished for PR 24446 at commit
|
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.
This drops theme:
scala> new Path("hdfs://0.0.0:8020/a/b/c").toString
res1: String = hdfs://0.0.0:8020/a/b/c
scala> new Path("hdfs://0.0.0:8020/a/b/c").toUri.getPath
res2: String = /a/b/cSo, if the theme is different from the default, it looks it's going to be ignored.
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.
+1 for @HyukjinKwon 's comment.
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.
Can we change this codes:
val inputPathUri: URI = inputPath.toUri
val inputPathName: String = inputPathUri.getPath
to:
val inputPathName: String = inputPath.toString
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.
Can you add a set of tests for this method getStagingDir?
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.
+1 not to use toUri, please see the following:
scala> import org.apache.hadoop.fs.Path
import org.apache.hadoop.fs.Path
scala> val f = new java.io.File("/tmp/chk %#chk")
f: java.io.File = /tmp/chk %#chk
scala> new Path(new Path(f.toURI()), "foo").toString
res0: String = file:/tmp/chk %#chk/foo
scala> new Path(new Path(f.toURI()), "foo").toUri.toString
res1: String = file:/tmp/chk%20%25%23chk/foo
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.
Yea, it's a common mistake for double-encoded problem.
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.
add a set of tests
Sorry for the late reply.
I'll try to add some unit tests.
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.
invokePrivate?
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.
Many members are undefined in SaveAsHiveFile trait, so object creation impossible for it .
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.
Then why not just private[hive] def getStagingDir?
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.
OK, it looks better, I will change it, thanks
|
Test build #105247 has finished for PR 24446 at commit
|
|
Looks like relevant issue: |
|
Test build #105251 has finished for PR 24446 at commit
|
|
Test build #105254 has finished for PR 24446 at commit
|
gaborgsomogyi
left a comment
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.
|
@HyukjinKwon does this address your comment? |
|
Merged to master |
What changes were proposed in this pull requesst?
If we set
hive.exec.stagingdir=.test-staging\tmp,But the staging directory is still
.hive-stagingon Windows OS.Reasons for failure:
Test code:
Output:
We can see that
path.toUri.getPathhas one more separator thanpath.toString, and the separator is ' / ', not ' \ 'So
stagingPathName.stripPrefix(inputPathName).stripPrefix(File.separator).startsWith(".")will return falseHow was this patch tested?