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

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

                Author: ASF GitHub Bot
            Created on: 06/Aug/20 18:45
            Start Date: 06/Aug/20 18:45
    Worklog Time Spent: 10m 
      Work Description: amaliujia commented on a change in pull request #12481:
URL: https://github.com/apache/beam/pull/12481#discussion_r466614630



##########
File path: 
runners/core-construction-java/src/test/java/org/apache/beam/runners/core/construction/ValidateRunnerXlangTest.java
##########
@@ -222,14 +228,21 @@ public void partitionTest() {
   }
 
   private byte[] toStringPayloadBytes(String data) throws IOException {
+    Row configRow =
+        Row.withSchema(Schema.of(Field.of("data", FieldType.STRING)))
+            .withFieldValue("data", data)
+            .build();
+
+    ByteString.Output outputStream = ByteString.newOutput();
+    try {
+      RowCoder.of(configRow.getSchema()).encode(configRow, outputStream);
+    } catch (IOException e) {
+      throw new RuntimeException(e);
+    }
     ExternalTransforms.ExternalConfigurationPayload payload =
         ExternalTransforms.ExternalConfigurationPayload.newBuilder()
-            .putConfiguration(
-                "data",
-                ExternalTransforms.ConfigValue.newBuilder()
-                    .addCoderUrn("beam:coder:string_utf8:v1")
-                    .setPayload(ByteString.copyFrom(encodeString(data)))
-                    .build())
+            .setSchema(SchemaTranslation.schemaToProto(configRow.getSchema(), 
false))
+            .setPayload(outputStream.toByteString())

Review comment:
       Got it. Thanks for clarification.




----------------------------------------------------------------
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: 467503)
    Time Spent: 1h 20m  (was: 1h 10m)

> Use schemas for external protocol spec
> --------------------------------------
>
>                 Key: BEAM-10571
>                 URL: https://issues.apache.org/jira/browse/BEAM-10571
>             Project: Beam
>          Issue Type: Improvement
>          Components: cross-language
>            Reporter: Brian Hulette
>            Assignee: Brian Hulette
>            Priority: P2
>             Fix For: 2.24.0
>
>          Time Spent: 1h 20m
>  Remaining Estimate: 0h
>
> Targeting 2.24.0 for this as we'd like to have xlang protos stabilized for 
> it. It looks like it will be the last Python 2 release, and we want to have 
> xlang as an escape hatch for using python 2.7.



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

Reply via email to