boyuanzz commented on a change in pull request #12520: URL: https://github.com/apache/beam/pull/12520#discussion_r468269112
########## File path: sdks/java/core/src/main/java/org/apache/beam/sdk/schemas/utils/AutoValueUtils.java ########## @@ -139,11 +139,15 @@ private static boolean matchConstructor( Collectors.toMap( f -> ReflectUtils.stripGetterPrefix(f.getMethod().getName()), Function.identity())); - for (FieldValueTypeInformation type : getterTypes) { - if (typeMap.get(type.getName()) == null) { + + // Verify that constructor parameters match (name and type) the inferred schema. + for (Parameter parameter : constructor.getParameters()) { + FieldValueTypeInformation type = typeMap.getOrDefault(parameter.getName(), null); + if (type == null || type.getRawType() != parameter.getType()) { Review comment: I believe the getterTypes is the list of schema name, where typeMap is the attribute name from AutoValue class. It's trying to verify whether the schema matches the AutoValue class since it wants to get a constructor. ---------------------------------------------------------------- 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: us...@infra.apache.org