You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2015/09/15 19:13:46 UTC

[jira] [Commented] (FLINK-2637) Add abstract equals, hashCode and toString methods to TypeInformation

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

ASF GitHub Bot commented on FLINK-2637:
---------------------------------------

GitHub user tillrohrmann opened a pull request:

    https://github.com/apache/flink/pull/1134

    [FLINK-2637] [api-breaking] [scala, types] Adds equals and hashCode method to TypeInformations and TypeSerializers

    Adds abstract `equals`, `hashCode`, `canEqual` and `toString` methods to `TypeInformation`. Adds missing implementations to subtypes. The `canEqual(Object obj)` method returns true iff the `obj` can be equaled with the called instance.
    
    Adds abstract `equals`, `hashCode` and `canEqual` methods to `TypeSerializer`.
    
    Makes `CompositeType` subtypes serializable by removing non-serializable fields which were only used for the comparator construction. The comparator construction is now realized within a builder object which keeps the intermediate state. Consequently, the PR #943 is now obsolete and can be closed.  
    
    Refactors the `ObjectArrayTypeInfo` so that the type extraction logic now happens within the `TypeExtractor` and no longer in the `TypeInformation` subtype.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/tillrohrmann/flink fixOptionTypeInfo

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/flink/pull/1134.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1134
    
----
commit 35a18b3f5148ec3fdddc318ea4d5971427fffda3
Author: Till Rohrmann <tr...@apache.org>
Date:   2015-09-07T23:12:09Z

    [FLINK-2637] [api-breaking] [scala, types] Adds equals and hashCode method to TypeInformations and TypeSerializers. Fixes ObjectArrayTypeInfo. Makes CompositeTypes serializable.
    
    Adds test for equality relation's symmetric property

----


> Add abstract equals, hashCode and toString methods to TypeInformation
> ---------------------------------------------------------------------
>
>                 Key: FLINK-2637
>                 URL: https://issues.apache.org/jira/browse/FLINK-2637
>             Project: Flink
>          Issue Type: Improvement
>          Components: Core
>    Affects Versions: 0.9, 0.10
>            Reporter: Fabian Hueske
>            Assignee: Till Rohrmann
>              Labels: starter
>             Fix For: 0.10
>
>
> Flink expects that implementations of {{TypeInformation}} have valid implementations of {{hashCode}} and {{equals}}. However, the API does not enforce to implement these methods. Hence, this is a common origin for bugs such as for example FLINK-2633.
> This can be avoided by adding abstract {{hashCode}} and {{equals}} methods to TypeInformation. An abstract {{toString}} method could also be added.
> This change will brake the API and require to fix a couple of broken {{TypeInformation}} implementations.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)