viirya commented on a change in pull request #32599:
URL: https://github.com/apache/spark/pull/32599#discussion_r637626293



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/json/JacksonParser.scala
##########
@@ -325,6 +328,36 @@ class JacksonParser(
         parseJsonToken[AnyRef](parser, 
dataType)(PartialFunction.empty[JsonToken, AnyRef])
   }
 
+  def makeKeyConverter(dataType: DataType): KeyConverter = dataType match {
+    case BooleanType => (key: String) => key.toBoolean
+    case ByteType => (key: String) => key.toByte
+    case ShortType => (key: String) => key.toShort
+    case IntegerType => (key: String) => key.toInt
+    case LongType => (key: String) => key.toLong
+    case FloatType => (key: String) => key match {
+      case "NaN" => Float.NaN
+      case "Infinity" => Float.PositiveInfinity
+      case "-Infinity" => Float.NegativeInfinity

Review comment:
       Is it case-sensitive?




-- 
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.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to