[
https://issues.apache.org/jira/browse/BEAM-9113?focusedWorklogId=372177&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-372177
]
ASF GitHub Bot logged work on BEAM-9113:
----------------------------------------
Author: ASF GitHub Bot
Created on: 15/Jan/20 07:32
Start Date: 15/Jan/20 07:32
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_r366727476
##########
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:
The more I think about it... the better the named schema's seem to be. You
really want to have the schema static, as it's a know Schema for beam and
deserves a unique UUID. I don't know if the **buildNamed** is a good method
though, as named doesn't imply UUID and you don't necessarily can ask the name
to the Schema again, as it's transformed to a UUID.
----------------------------------------------------------------
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: 372177)
Time Spent: 1h 10m (was: 1h)
> 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 10m
> 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)