zhouyifan279 commented on a change in pull request #1015:
URL: https://github.com/apache/incubator-kyuubi/pull/1015#discussion_r700790251
##########
File path:
kyuubi-common/src/test/scala/org/apache/kyuubi/util/KyuubiHadoopUtilsSuite.scala
##########
@@ -35,4 +37,12 @@ class KyuubiHadoopUtilsSuite extends KyuubiFunSuite {
assert(hadoopConf.get(xyz) === "abc")
assert(hadoopConf.get(test) === "t")
}
+
+ test("encode/decode Writable object") {
+ val writable = new Text("Hello, World!")
+ val decoded = new Text()
+
+ KyuubiHadoopUtils.decodeWritable(decoded,
KyuubiHadoopUtils.encodeWritable(writable))
Review comment:
The methods naming and implements are from
`org.apache.hadoop.security.token.Token#encodeWritable` and
`org.apache.hadoop.security.token.Token#decodeWritable` and should be able to
convert any `Writable` object.
Here, `encodeWritable` is used to convert Credentials to String at Kyuubi
Server side and `decodeWritable` is used to convert String to Credentials at
Kyuuib SQL engine side.
Change `decodeWritable` to `decodeString` and return `Text` maybe is not
proper for its usage.
--
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]