ccciudatu commented on a change in pull request #13572:
URL: https://github.com/apache/beam/pull/13572#discussion_r546291398
##########
File path:
sdks/java/io/thrift/src/main/java/org/apache/beam/sdk/io/thrift/ThriftSchema.java
##########
@@ -183,7 +184,12 @@ private Schema schemaFor(Class<?> targetClass) {
private Schema.Field beamField(FieldMetaData fieldDescriptor) {
try {
final FieldType type = beamType(fieldDescriptor.valueMetaData);
- return Schema.Field.nullable(fieldDescriptor.fieldName, type);
+ switch (fieldDescriptor.requirementType) {
Review comment:
Agreed.
My intention here was to leave room for special handling of the `DEFAULT`
"field requiredness", as that's somewhere in between, i.e. defined as "opt-in,
req-out", so it may not always fall into the "nullable" default case, the same
as `OPTIONAL`.
Would it be better if I listed all the options (with some comments, perhaps)
and just fall-through to the default (nullable) case?
I can also switch (pun intended) to an if/else or ternary statement, if you
think we don't have to make it obvious that each thrift requirement type can be
handled separately.
----------------------------------------------------------------
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]