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

Fabian Hueske commented on FLINK-7291:
--------------------------------------

I think you are right that {{getArity()}} was introduced for composite types 
(not sure why it wasn't added to CompositeType). So, this is probably not an 
issue, because the method is (hopefully) only called for composite types.
However, IIRC the method should return the number of record fields a type has 
(without nesting). All primitive types and array types implement the method by 
returning 1. So, we should go for consistency here, IMO.

The {{getTotalFields()}} method is a bigger issue because it is recursively 
called by composite types on their field types (composite or not) to compute 
the number of nested fields (e.g., in the constructor of PojoTypeInfo or 
TupleTypeInfoBase).

> Incorrect return value of getArity() in ListTypeInfo and MapTypeInfo
> --------------------------------------------------------------------
>
>                 Key: FLINK-7291
>                 URL: https://issues.apache.org/jira/browse/FLINK-7291
>             Project: Flink
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.3.1, 1.4.0
>            Reporter: Fabian Hueske
>
> The implementation of {{getArity()}} in {{ListTypeInfo}} and {{MapTypeInfo}} 
> returns 0 but should return 1.
> The implementation of {{MapTypeInfo.getTotalFields()}} is also incorrect and 
> must return 1 instead of 2.
> The JavaDocs of {{TypeInformation.getArity()}} and 
> {{TypeInformation.getTotalFields()}} should be extended as well to avoid 
> future confusion about this method. The method returns the arity for current 
> type. For atomic types, this is 1 for composite types, the number of 
> non-nested fields (or number of fields on the first nesting-level).



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to