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

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

                Author: ASF GitHub Bot
            Created on: 28/Sep/20 11:21
            Start Date: 28/Sep/20 11:21
    Worklog Time Spent: 10m 
      Work Description: piotr-szuberski commented on a change in pull request 
#12827:
URL: https://github.com/apache/beam/pull/12827#discussion_r495866398



##########
File path: 
sdks/java/core/src/main/java/org/apache/beam/sdk/schemas/utils/AvroUtils.java
##########
@@ -428,6 +432,35 @@ public static GenericRecord toGenericRecord(
     return new GenericRecordToRowFn(schema);
   }
 
+  public static Row avroBytesToRow(byte[] bytes, Schema schema) {
+    try {
+      org.apache.avro.Schema avroSchema = AvroUtils.toAvroSchema(schema);
+      AvroCoder<GenericRecord> coder = AvroCoder.of(avroSchema);

Review comment:
       I had a quite hard time as AvroSchema is not serializable (and the tests 
were failing due to DoFn serialization exception), but I've learned the use 
case of transient keyword :) I've chosen the lambda way but had to define a 
class implementing SerializableFunction to be able to use transient for 
avroSchema. Done.




----------------------------------------------------------------
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: 491926)
    Time Spent: 2h 40m  (was: 2.5h)

> Add Avro support to Kafka Table Provider
> ----------------------------------------
>
>                 Key: BEAM-10885
>                 URL: https://issues.apache.org/jira/browse/BEAM-10885
>             Project: Beam
>          Issue Type: New Feature
>          Components: dsl-sql
>    Affects Versions: 2.25.0
>            Reporter: Piotr Szuberski
>            Assignee: Piotr Szuberski
>            Priority: P2
>          Time Spent: 2h 40m
>  Remaining Estimate: 0h
>




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

Reply via email to