[ 
https://issues.apache.org/jira/browse/BEAM-10243?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17134514#comment-17134514
 ] 

Kyle Weaver commented on BEAM-10243:
------------------------------------

Thanks for preparing a test. It looks like the exception is due to the schema 
not being resolved.

I changed this line to 
{{FieldAccessDescriptor.withFieldNames(e.getKey()).resolve(getSchema()),}} and 
your test passed.

https://github.com/apache/beam/blob/13411a6b546253336d862f8495ca57aa2376ac67/sdks/java/core/src/main/java/org/apache/beam/sdk/values/Row.java#L684

> Incorrect checkState condition in withFieldValues in Row.java
> -------------------------------------------------------------
>
>                 Key: BEAM-10243
>                 URL: https://issues.apache.org/jira/browse/BEAM-10243
>             Project: Beam
>          Issue Type: Bug
>          Components: sdk-java-core
>    Affects Versions: 2.22.0
>            Reporter: Pedro Teixeira
>            Priority: P2
>
>  
> In the following code:
> {code:java}
> public FieldValueBuilder withFieldValues(Map<String, Object> values) { 
>    checkState(values.isEmpty()); 
>    return new FieldValueBuilder(schema, null).withFieldValues(values); 
> }  
> {code}
>  
> checkState should check `this.values` instead of the passed arguments.
> The issue is that as it is now, we cannot use this function to build a Row 
> from Map.
>  
> thanks.
>  



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

Reply via email to