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

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

                Author: ASF GitHub Bot
            Created on: 14/Jan/20 21:25
            Start Date: 14/Jan/20 21:25
    Worklog Time Spent: 10m 
      Work Description: alexvanboxel commented on pull request #10569: 
[BEAM-9113] Fix serialization proto logical types
URL: https://github.com/apache/beam/pull/10569#discussion_r366580164
 
 

 ##########
 File path: 
sdks/java/extensions/protobuf/src/main/java/org/apache/beam/sdk/extensions/protobuf/ProtoSchemaLogicalTypes.java
 ##########
 @@ -31,8 +32,13 @@
   public abstract static class NanosType<T> implements LogicalType<T, Row> {
     private final String identifier;
 
-    private static final Schema SCHEMA =
-        
Schema.builder().addInt64Field("seconds").addInt32Field("nanos").build();
+    private static final Schema SCHEMA;
+
+    static {
+      Schema schema = 
Schema.builder().addInt64Field("seconds").addInt32Field("nanos").build();
+      schema.setUUID(UUID.fromString("dc5915f1-6db8-3134-9444-4980fb088e92"));
 
 Review comment:
   It's trickier then expected as the static **toRow** functions, is used by 
the bytebuddy generated code and you don't want to create a Schema object for 
each Row.
   
   What about:
   
   ```
   Schema SCHEMA = 
Schema.builder().addInt64Field("seconds").addInt32Field("nanos").buildNamed("NanosType");
   ```
   
   This needs an extension to Schema.
 
----------------------------------------------------------------
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: 371882)
    Time Spent: 1h  (was: 50m)

> Protobuf NanosType<T> serialisation issues
> ------------------------------------------
>
>                 Key: BEAM-9113
>                 URL: https://issues.apache.org/jira/browse/BEAM-9113
>             Project: Beam
>          Issue Type: Bug
>          Components: sdk-java-core
>            Reporter: Alex Van Boxel
>            Assignee: Alex Van Boxel
>            Priority: Major
>          Time Spent: 1h
>  Remaining Estimate: 0h
>
> TheĀ  NanosType<T> has 2 known issues:
>  * Schema serialisation expects the getArgument to not return a null value
>  * UUID of the base type will not be (de)serialised as it is static



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

Reply via email to