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

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

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



##########
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:
       This is just mirroring what was there before, which used the old 
ExternalConfigurationPayload to encode a single field "data" with the 
string_utf8 coder. The equivalent with the new version  of 
ExternalConfigurationPayload is to encode a single field "data" with type 
STRING.




----------------------------------------------------------------
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: 467469)
    Time Spent: 1h  (was: 50m)

> 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
>  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