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

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

                Author: ASF GitHub Bot
            Created on: 21/Aug/19 22:11
            Start Date: 21/Aug/19 22:11
    Worklog Time Spent: 10m 
      Work Description: TheNeuralBit commented on pull request #9188: 
[BEAM-7886] Make row coder a standard coder and implement in Python
URL: https://github.com/apache/beam/pull/9188#discussion_r316424584
 
 

 ##########
 File path: 
sdks/java/core/src/main/java/org/apache/beam/sdk/schemas/PortableSchemaCoder.java
 ##########
 @@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.beam.sdk.schemas;
+
+import org.apache.beam.sdk.transforms.SerializableFunctions;
+import org.apache.beam.sdk.values.Row;
+
+/**
+ * A version of SchemaCoder that can only produce/consume Row instances.
+ *
+ * <p>Implements the beam:coders:row:v1 standard coder while still satisfying 
the requirement that a
+ * PCollection is only considered to have a schema if its coder is an instance 
of SchemaCoder.
+ */
+public class PortableSchemaCoder extends SchemaCoder<Row> {
 
 Review comment:
   Yeah, I need a unique class for the map in CoderTranslation. I originally 
tried to use `RowCoder` for this directly, but that didn't work since it needs 
to be a sub-class of SchemaCoder for PCollection.hasSchema. 
   
   This was the easiest solution I came up with to make it work, but I'm 
definitely open to other ideas. Maybe I could re-work the CoderTranslation 
logic so that `SchemaCoder<Row>` instances translate to `beam:coder:row:v1`?
 
----------------------------------------------------------------
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: 299042)
    Time Spent: 6.5h  (was: 6h 20m)

> Make row coder a standard coder and implement in python
> -------------------------------------------------------
>
>                 Key: BEAM-7886
>                 URL: https://issues.apache.org/jira/browse/BEAM-7886
>             Project: Beam
>          Issue Type: Improvement
>          Components: beam-model, sdk-java-core, sdk-py-core
>            Reporter: Brian Hulette
>            Assignee: Brian Hulette
>            Priority: Major
>          Time Spent: 6.5h
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.3.2#803003)

Reply via email to