You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2022/06/04 01:54:54 UTC

[GitHub] [beam] kennknowles opened a new issue, #19507: Bug in RuntimeValueProvider JSON serialization

kennknowles opened a new issue, #19507:
URL: https://github.com/apache/beam/issues/19507

   Classes affected:
    org.apache.beam.sdk.options.ValueProvider.Serializer
    org.apache.beam.sdk.options.ValueProvider.Deserializer
   
   The problem is that according to the JsonDeserializer documentation, the deserialize method isn't executed for null nodes:
    ( [https://static.javadoc.io/com.fasterxml.jackson.core/jackson-databind/2.9.6/com/fasterxml/jackson/databind/JsonDeserializer.html#deserialize(com.fasterxml.jackson.core.JsonParser,%20com.fasterxml.jackson.databind.DeserializationContext)](https://static.javadoc.io/com.fasterxml.jackson.core/jackson-databind/2.9.6/com/fasterxml/jackson/databind/JsonDeserializer.html#deserialize(com.fasterxml.jackson.core.JsonParser,%20com.fasterxml.jackson.databind.DeserializationContext) )
    )
    "Note that this method is never called for JSON null literal, and thus deserializers need (and should) not check for it."
   
   If we serialize a RuntimeValueProvider, the isAccessible() will return false, so we call a writeNull(). During deserialization this isn't handled properly as mentioned and our deserialization will return null.
   
   The end result is that getters with ValueProvider return values will return "null". AFAIK ValueProvider getters should be never null.
   
   My guess is that either we should completely omit serializing RuntimeValueProviders, or during deserialization the proper runtime value provider should be created again - which requires more than just a simple "null" being present in the json.
   
   Imported from Jira [BEAM-6963](https://issues.apache.org/jira/browse/BEAM-6963). Original Jira may contain additional context.
   Reported by: bnemeth.


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

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org