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



##########
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:
       Good point. I got it from makeConverter, but in  
Cast.processFloatingPointSpecialLiterals I think we have a more complete use 
case. I'm going to change it in makeConverter in other PR to avoid mix things.




-- 
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:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to