[ https://issues.apache.org/jira/browse/BEAM-9240?focusedWorklogId=380322&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-380322 ]
ASF GitHub Bot logged work on BEAM-9240: ---------------------------------------- Author: ASF GitHub Bot Created on: 01/Feb/20 08:04 Start Date: 01/Feb/20 08:04 Worklog Time Spent: 10m Work Description: rahul8383 commented on issue #10744: [BEAM-9240]: Check for Nullability in typesEqual() method of FieldTyp… URL: https://github.com/apache/beam/pull/10744#issuecomment-581006152 > Can you explain how this would work? equals() checks field names and typesEqual does not. > […](#) > On Fri, Jan 31, 2020 at 11:48 PM Rahul Patwari ***@***.***> wrote: Also, the typesEqual() method of FieldType class is redundant as the behaviour is a subset of equals() method. Instead of doing this: public boolean typesEqual(Field other) { return getType().typesEqual(other.getType()); } we can test typesEquality by doing: public boolean typesEqual(Field other) { return getType().equals(other.getType()); } and we can *remove* tyesEqual() method in FieldType class. — You are receiving this because your review was requested. Reply to this email directly, view it on GitHub <#10744?email_source=notifications&email_token=AFAYJVPSBQEAL3QFY5OAYYDRAUSK7A5CNFSM4KORR6UKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEKQW6VQ#issuecomment-581005142>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AFAYJVK5RVUPMIYZVSKMEZDRAUSK7ANCNFSM4KORR6UA> . Oh! equals() won't work if the Schema has nested Schema. Sorry! didn't think of that. ---------------------------------------------------------------- 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: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 380322) Time Spent: 40m (was: 0.5h) > Check for Nullability in typesEqual() method of FieldType class > --------------------------------------------------------------- > > Key: BEAM-9240 > URL: https://issues.apache.org/jira/browse/BEAM-9240 > Project: Beam > Issue Type: Bug > Components: dsl-sql > Affects Versions: 2.18.0 > Reporter: Rahul Patwari > Assignee: Rahul Patwari > Priority: Major > Fix For: 2.19.0 > > Time Spent: 40m > Remaining Estimate: 0h > > {{If two schemas are created like this:}} > {{Schema schema1 = Schema.builder().addStringField("col1").build();}} > {{Schema schema2 = Schema.builder().addNullableField("col1", > FieldType.STRING).build();}} > > {{schema1.typeEquals(schema2) returns "true" even though the schemas differ > by Nullability}} -- This message was sent by Atlassian Jira (v8.3.4#803005)