Github user NathanHowell commented on a diff in the pull request:

    https://github.com/apache/spark/pull/16386#discussion_r100104738
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/json/JacksonParser.scala
 ---
    @@ -298,22 +312,22 @@ class JacksonParser(
             // Here, we pass empty `PartialFunction` so that this case can be
             // handled as a failed conversion. It will throw an exception as
             // long as the value is not null.
    -        parseJsonToken(parser, dataType)(PartialFunction.empty[JsonToken, 
Any])
    +        parseJsonToken[AnyRef](parser, 
dataType)(PartialFunction.empty[JsonToken, AnyRef])
       }
     
       /**
        * This method skips `FIELD_NAME`s at the beginning, and handles nulls 
ahead before trying
        * to parse the JSON token using given function `f`. If the `f` failed 
to parse and convert the
        * token, call `failedConversion` to handle the token.
        */
    -  private def parseJsonToken(
    +  private def parseJsonToken[R >: Null](
    --- End diff --
    
    It states that `R` must be a nullable type. This enables `null: R` to 
compile and is preferable to the runtime cast `null.asInstanceOf[R]` because it 
is verified at compile time.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to