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

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

                Author: ASF GitHub Bot
            Created on: 13/Dec/18 21:21
            Start Date: 13/Dec/18 21:21
    Worklog Time Spent: 10m 
      Work Description: kanterov commented on a change in pull request #7267: 
[BEAM-4454] Support Avro POJO objects
URL: https://github.com/apache/beam/pull/7267#discussion_r241539705
 
 

 ##########
 File path: 
sdks/java/core/src/main/java/org/apache/beam/sdk/schemas/AvroRecordSchema.java
 ##########
 @@ -17,35 +17,35 @@
  */
 package org.apache.beam.sdk.schemas;
 
-import org.apache.avro.specific.SpecificRecord;
-import 
org.apache.beam.sdk.schemas.utils.AvroSpecificRecordTypeInformationFactory;
+import org.apache.beam.sdk.schemas.utils.AvroTypeInformationFactory;
 import org.apache.beam.sdk.schemas.utils.AvroUtils;
 import org.apache.beam.sdk.values.TypeDescriptor;
 
 /**
- * A {@link SchemaProvider} for AVRO generated SpecificRecords.
+ * A {@link SchemaProvider} for AVRO generated SpecificRecords and POJOs.
  *
- * <p>This provider infers a schema from generates SpecificRecord objects, and 
creates schemas and
- * rows that bind to the appropriate fields.
+ * <p>This provider infers a schema from generated SpecificRecord objects, and 
creates schemas and
+ * rows that bind to the appropriate fields. This provider also infers schemas 
from Java POJO
+ * objects, creating a schema that matches that inferred by the AVRO libraries.
  */
-public class AvroSpecificRecordSchema extends GetterBasedSchemaProvider {
+public class AvroRecordSchema extends GetterBasedSchemaProvider {
   @Override
   public <T> Schema schemaFor(TypeDescriptor<T> typeDescriptor) {
-    return AvroUtils.getSchema((Class<? extends SpecificRecord>) 
typeDescriptor.getRawType());
+    return AvroUtils.getSchema(typeDescriptor.getRawType());
   }
 
   @Override
   public FieldValueGetterFactory fieldValueGetterFactory() {
-    return new AvroSpecificRecordGetterFactory();
+    return new AvroClassGetterFactory();
   }
 
   @Override
   public UserTypeCreatorFactory schemaTypeCreatorFactory() {
 
 Review comment:
   I guess `GetterBasedSchemaProvider#schemaTypeCreatorFactory` shouldn't be 
`Nullable` anymore.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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: 175056)
    Time Spent: 10h 20m  (was: 10h 10m)

> Provide automatic schema registration for AVROs
> -----------------------------------------------
>
>                 Key: BEAM-4454
>                 URL: https://issues.apache.org/jira/browse/BEAM-4454
>             Project: Beam
>          Issue Type: Sub-task
>          Components: sdk-java-core
>            Reporter: Reuven Lax
>            Assignee: Reuven Lax
>            Priority: Major
>          Time Spent: 10h 20m
>  Remaining Estimate: 0h
>
> Need to make sure this is a compatible change



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to