WangGuangxin commented on a change in pull request #23460: [SPARK-26544][SQL]
Escape string to keep alignment with hive
URL: https://github.com/apache/spark/pull/23460#discussion_r260575298
##########
File path:
sql/core/src/test/scala/org/apache/spark/sql/execution/HiveResultSuite.scala
##########
@@ -44,4 +45,11 @@ class HiveResultSuite extends SparkFunSuite with
SharedSQLContext {
val tpe = new ExamplePointUDT()
assert(HiveResult.toHiveString((point, tpe)) === "(50.0, 50.0)")
}
+
+ test("SPARK-26544: toHiveString correctly escape map type") {
+ val m = Map("log_pb" -> """{"impr_id":"20181231"}""", "request_id" ->
"001")
Review comment:
I've added one more case to cover special chars like `\b \t \n \r` and `\u`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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]