You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@samza.apache.org by GitBox <gi...@apache.org> on 2019/10/03 07:39:33 UTC

[GitHub] [samza] atoomula commented on a change in pull request #1153: SAMZA-2320: Samza-sql: Refactor validation to cover more cases and make it more extensible.

atoomula commented on a change in pull request #1153: SAMZA-2320: Samza-sql: Refactor validation to cover more cases and make it more extensible.
URL: https://github.com/apache/samza/pull/1153#discussion_r324391708
 
 

 ##########
 File path: samza-sql/src/main/java/org/apache/samza/sql/avro/AvroTypeFactoryImpl.java
 ##########
 @@ -52,15 +52,18 @@ public SqlSchema createType(Schema schema) {
       throw new SamzaException(msg);
     }
 
-    return convertSchema(schema.getFields());
+    return convertSchema(schema.getFields(), true);
   }
 
-  private SqlSchema convertSchema(List<Schema.Field> fields) {
+  protected boolean isOptional(Schema.Field field, boolean isTopLevel) {
+    return field.defaultValue() != null;
+  }
+
+  private SqlSchema convertSchema(List<Schema.Field> fields, boolean isTopLevel) {
 
     SqlSchemaBuilder schemaBuilder = SqlSchemaBuilder.builder();
 
 Review comment:
   Added the reasoning for isTopLevel in javdoc for isOptional()

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services