Uploaded image for project: 'Talend Component Kit'
  1. Talend Component Kit
  2. TCOMP-1906

Redefine equals on RecordImpl

Apply templateInsert Lucidchart Diagram
    XMLWordPrintable

Details

    • Work Item
    • Resolution: Done
    • Minor
    • 1.36.0
    • None
    • schema-record
    • All
    • GreenHopper Ranking:
      0|i23l5n:
    • 9223372036854775807
    • Small

    Description

      Currently Equals  record1.equal(record2) returns false even if schema and values are the same.

      Maybe we hsould add  @EqualsAndHashCode  on RecordImpl.

      Please first identify potential side effects (ex: Set<Record> ).

       

      Comment in retro :

       

      What i wanted to solve:
      On workday, i want to ensure XML -> Record & Json -> Record lead to identical result if XML & Json source are similar.
      Pb i faced:
      For rec1 & rec2 Record instances :Objects.equals(rec1, rec2) always return false even if they have same schema and equals values.
      So, my Assertions.equals(rec1, rec2) is always false.
      What i proposed:
      Add @EqualsAndHashCode annotation on RecordImpl and AvroRecord classes (SchemaImpl and AvroSchema already have @Data which include @EqualsAndHashCode).
      Risks :
      rec1.equals(rec2) will return true if records have same values but are not same instance.
      So, if existing pipeline already use equals want to distinct instances, it won't
      

       

      Attachments

        Activity

          People

            emmanuel_g emmanuel gallois
            ypiel Yves Piel
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: