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_r260223455
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/HiveResult.scala
##########
@@ -124,4 +124,46 @@ object HiveResult {
case (other, _ : UserDefinedType[_]) => other.toString
case (other, tpe) if primitiveTypes.contains(tpe) => other.toString
}
+
+ /** Escape a String in JSON format. */
+ private def escapeString(str: String): String = {
Review comment:
> you check what Hive does? I assume they have similar code for this, so
checking theirs seems safer
It was taken from Hive. I'll add a comment there.
----------------------------------------------------------------
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]