-
Notifications
You must be signed in to change notification settings - Fork 4k
ARROW-6288: [Java] Implement TypeEqualsVisitor comparing vector type equals considering names and metadata #5119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…equals considering names and metadata
|
cc @pravindra |
| compareChilren(leftField.getChildren(), rightField.getChildren()); | ||
| } | ||
|
|
||
| private boolean compareChilren(List<Field> leftChildren, List<Field> rightChildren) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo - compareChilren -> compareChildren
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, fixed.
| return compareField(left.getField(), right.getField()); | ||
| } | ||
|
|
||
| private boolean compareField(Field leftField, Field rightField) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add a fastpath for leftField == rightField ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed.
| } | ||
|
|
||
| @Test | ||
| public void testTypeEqualsWithMetadate() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo : Metadate -> Metadata
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed.
…equals considering names and metadata Related to [ARROW-6288](https://issues.apache.org/jira/browse/ARROW-6288). Currently when we compare range/vector equals, we first compare vector Field by its equals method, in this case, it’s hard to specify whether compare names or metadata. Implement a TypeEqualsVisitor will make type comparisons more flexible like cpp implementation dose https://github.com/apache/arrow/blob/master/cpp/src/arrow/compare.cc#L712 Closes apache#5119 from tianchen92/ARROW-6288 and squashes the following commits: fa4975f <tianchen> resolve comments 425a849 <tianchen> ARROW-6288: Implement TypeEqualsVisitor comparing vector type equals considering names and metadata Authored-by: tianchen <niki.lj@alibaba-inc.com> Signed-off-by: Wes McKinney <wesm+git@apache.org>
Related to ARROW-6288.
Currently when we compare range/vector equals, we first compare vector Field by its equals method, in this case, it’s hard to specify whether compare names or metadata.
Implement a TypeEqualsVisitor will make type comparisons more flexible like cpp implementation dose https://github.com/apache/arrow/blob/master/cpp/src/arrow/compare.cc#L712