You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2022/06/04 15:44:35 UTC

[GitHub] [beam] damccorm opened a new issue, #20199: Error occurred when transforming from row to a new row without setCoder

damccorm opened a new issue, #20199:
URL: https://github.com/apache/beam/issues/20199

   The output row from transform function uses the input row schema to verify which causes error. Ex:
   
   ```
   
           .apply(MapElements.via(
                   new SimpleFunction<Row, Row>() \{
                 
        @Override
                       public Row apply(Row line) {
                           return Row.withSchema(newSchema).addValues("a",
   1, "b").build();
                       }
                   }));
   
   ```
   
   
   Got error when the output row schema is not the same as the input row.
   
   Need to add `.setCoder(RowCoder.of(newSchema))` after the transform function to make it work.
   
   Related link: [https://stackoverflow.com/questions/61236972/beam-sql-udf-to-split-one-column-into-multiple-columns](https://stackoverflow.com/questions/61236972/beam-sql-udf-to-split-one-column-into-multiple-columns)
   
   Imported from Jira [BEAM-9814](https://issues.apache.org/jira/browse/BEAM-9814). Original Jira may contain additional context.
   Reported by: ruixuel.


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

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org