[ 
https://issues.apache.org/jira/browse/BEAM-10220?focusedWorklogId=449461&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-449461
 ]

ASF GitHub Bot logged work on BEAM-10220:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 22/Jun/20 19:24
            Start Date: 22/Jun/20 19:24
    Worklog Time Spent: 10m 
      Work Description: pabloem commented on a change in pull request #12035:
URL: https://github.com/apache/beam/pull/12035#discussion_r443774541



##########
File path: sdks/java/core/src/main/java/org/apache/beam/sdk/util/RowJson.java
##########
@@ -159,9 +159,16 @@ public String toString() {
 
     private static final boolean SEQUENTIAL = false;
 
-    public enum MissingFieldBehavior {
-      ALLOW_MISSING,
-      REQUIRE_NULL
+    // Configure how we should attempt to parse null values when deserializing 
JSON
+    public enum NullBehavior {
+      // Interpret either a missing field or a null value is a null
+      ALLOW_MISSING_OR_NULL,
+      // Require nulls to be represented as a null value. If the key is 
missing for a nullable field
+      // an error will be thrown.
+      REQUIRE_NULL,
+      // Require nulls to be represented as a missing field. If the key exists 
with a null value an

Review comment:
       Maybe could rephrase the first phrase like `Requires fields with null 
values to be represented with a missing key.` ? - (or something else? I found 
it a little confusing the first time I read it) 
   
   - Requires fields with null values to be represented with a missing key.
   - Requires fields with null values to be missing from JSON representation.
   




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


Issue Time Tracking
-------------------

    Worklog Id:     (was: 449461)
    Time Spent: 6h  (was: 5h 50m)

> Add support for implicit nulls in de/serializing JSON
> -----------------------------------------------------
>
>                 Key: BEAM-10220
>                 URL: https://issues.apache.org/jira/browse/BEAM-10220
>             Project: Beam
>          Issue Type: New Feature
>          Components: extensions-java-json
>            Reporter: Reuben van Ammers
>            Assignee: Reuben van Ammers
>            Priority: P3
>             Fix For: 2.23.0
>
>          Time Spent: 6h
>  Remaining Estimate: 0h
>
> Currently,  RowJson.java doesn't have support for deserialising JSON with 
> fields missing - it fails, even if the beam schema is nullable. This is often 
> a problem for reading JSON as nulls are very commonly represented by omitting 
> the field. Additionally, for this reason, not writing nulls is a reasonable 
> when converting from Beam rows to JSON.
> This would help to allow https://issues.apache.org/jira/browse/BEAM-7624 to 
> be implemented. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to