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

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

                Author: ASF GitHub Bot
            Created on: 23/Dec/19 01:12
            Start Date: 23/Dec/19 01:12
    Worklog Time Spent: 10m 
      Work Description: reuvenlax commented on pull request #10449: [BEAM-7274] 
Implement the Protobuf schema provider for compiled protocol buffers
URL: https://github.com/apache/beam/pull/10449#discussion_r360741860
 
 

 ##########
 File path: 
sdks/java/extensions/protobuf/src/main/java/org/apache/beam/sdk/extensions/protobuf/ProtoDynamicMessageSchema.java
 ##########
 @@ -0,0 +1,55 @@
+package org.apache.beam.sdk.extensions.protobuf;
+
+import com.google.protobuf.DynamicMessage;
+import org.apache.beam.sdk.annotations.Experimental;
+import org.apache.beam.sdk.annotations.Experimental.Kind;
+import org.apache.beam.sdk.schemas.FieldValueGetter;
+import org.apache.beam.sdk.schemas.FieldValueTypeInformation;
+import org.apache.beam.sdk.schemas.GetterBasedSchemaProvider;
+import org.apache.beam.sdk.schemas.Schema;
+import org.apache.beam.sdk.schemas.SchemaProvider;
+import org.apache.beam.sdk.schemas.SchemaUserTypeCreator;
+import org.apache.beam.sdk.transforms.SerializableFunction;
+import org.apache.beam.sdk.values.Row;
+import org.apache.beam.sdk.values.TypeDescriptor;
+import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.Lists;
+
+import javax.annotation.Nullable;
+import java.util.List;
+
+@Experimental(Kind.SCHEMAS)
+public class ProtoDynamicMessageSchema extends GetterBasedSchemaProvider {
+    private static final TypeDescriptor<DynamicMessage> 
DYNAMIC_MESSAGE_TYPE_DESCRIPTOR =
+            TypeDescriptor.of(DynamicMessage.class);
+    @Nullable
+    @Override
+    public <T> Schema schemaFor(TypeDescriptor<T> typeDescriptor) {
+        checkForDynamicType(typeDescriptor);
+        return ProtoSchemaTranslator.getSchema((Class<DynamicMessage>) 
typeDescriptor.getRawType());
+    }
+
+    @Override
+    public List<FieldValueGetter> fieldValueGetters(Class<?> targetClass, 
Schema schema) {
+        return null;
 
 Review comment:
   Actually, I meant to remove this file from this PR - it belongs in the next 
PR. I'll remove it.
 
----------------------------------------------------------------
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: 362374)
    Time Spent: 20h 50m  (was: 20h 40m)

> Protobuf Beam Schema support
> ----------------------------
>
>                 Key: BEAM-7274
>                 URL: https://issues.apache.org/jira/browse/BEAM-7274
>             Project: Beam
>          Issue Type: Improvement
>          Components: sdk-java-core
>            Reporter: Alex Van Boxel
>            Assignee: Alex Van Boxel
>            Priority: Minor
>          Time Spent: 20h 50m
>  Remaining Estimate: 0h
>
> Add support for the new Beam Schema to the Protobuf extension.



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

Reply via email to