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/09/13 18:07:59 UTC

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

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

 ##########
 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:
   Where is isTopLevel being used? It's not used in this function or in 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