DL1231 commented on code in PR #20614:
URL: https://github.com/apache/kafka/pull/20614#discussion_r2454763009
##########
generator/src/main/java/org/apache/kafka/message/SchemaGenerator.java:
##########
@@ -107,15 +107,15 @@ void generateSchemas(String className, StructSpec struct,
for (FieldSpec field : struct.fields()) {
if (field.type().isStructArray()) {
FieldType.ArrayType arrayType = (FieldType.ArrayType)
field.type();
- generateSchemas(arrayType.elementType().toString(),
structRegistry.findStruct(field), versions);
+ generateSchemas(arrayType.elementType().toString(),
structRegistry.findStruct(field), versions, field.nullableVersions());
Review Comment:
I think you're right. It doesn't make sense to allow null elements in an
array. If we need to represent null value, the NULLABLE_ARRAY should be used.
##########
generator/src/main/java/org/apache/kafka/message/SchemaGenerator.java:
##########
@@ -107,15 +107,15 @@ void generateSchemas(String className, StructSpec struct,
for (FieldSpec field : struct.fields()) {
if (field.type().isStructArray()) {
FieldType.ArrayType arrayType = (FieldType.ArrayType)
field.type();
- generateSchemas(arrayType.elementType().toString(),
structRegistry.findStruct(field), versions);
+ generateSchemas(arrayType.elementType().toString(),
structRegistry.findStruct(field), versions, field.nullableVersions());
Review Comment:
I think you're right. It doesn't make sense to allow null elements in an
array. If we need to represent null value, the `NULLABLE_ARRAY` should be used.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]