TheNeuralBit commented on a change in pull request #13003:
URL: https://github.com/apache/beam/pull/13003#discussion_r499022266



##########
File path: 
sdks/java/core/src/main/java/org/apache/beam/sdk/schemas/FieldValueTypeInformation.java
##########
@@ -118,6 +123,29 @@ public static FieldValueTypeInformation forField(Field 
field) {
         .build();
   }
 
+  public static <T extends AnnotatedElement & Member> String getNameOverride(
+      String original, T member) {
+    SchemaFieldName fieldName = member.getAnnotation(SchemaFieldName.class);
+    SchemaCaseFormat caseFormatAnnotation = 
member.getAnnotation(SchemaCaseFormat.class);
+    SchemaCaseFormat classCaseFormatAnnotation =
+        member.getDeclaringClass().getAnnotation(SchemaCaseFormat.class);

Review comment:
       Hm I didn't consider inheritance at all. I think your assessment about 
how this will behave is correct. I think this behavior would be fine, except in 
a context like this:
   
   ```java
   class SomethingOutOfMyControl {
      ... fields ...
   }
   
   @SchemaCaseFormat(B)
   class MyBeamObject extends SomethingOutOfMyControl { }
   ```
   
   Not sure how often something like that comes up, but maybe that's enough 
reason to scope the case format to the class we're inferring the schema from.




----------------------------------------------------------------
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]


Reply via email to