[ 
https://issues.apache.org/jira/browse/BEAM-10633?focusedWorklogId=468958&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-468958
 ]

ASF GitHub Bot logged work on BEAM-10633:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 11/Aug/20 01:09
            Start Date: 11/Aug/20 01:09
    Worklog Time Spent: 10m 
      Work Description: 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:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 468958)
    Time Spent: 2h 40m  (was: 2.5h)

> UdfImpl when returns java.util.List will hit a NPE
> --------------------------------------------------
>
>                 Key: BEAM-10633
>                 URL: https://issues.apache.org/jira/browse/BEAM-10633
>             Project: Beam
>          Issue Type: Improvement
>          Components: dsl-sql
>            Reporter: Rui Wang
>            Assignee: Rui Wang
>            Priority: P2
>          Time Spent: 2h 40m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to