Skip to content

Conversation

@tianchen92
Copy link
Contributor

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

@tianchen92
Copy link
Contributor Author

cc @pravindra

compareChilren(leftField.getChildren(), rightField.getChildren());
}

private boolean compareChilren(List<Field> leftChildren, List<Field> rightChildren) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo - compareChilren -> compareChildren

Copy link
Contributor Author

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) {
Copy link
Contributor

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 ?

Copy link
Contributor Author

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() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo : Metadate -> Metadata

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed.

@wesm wesm closed this in 323948a Aug 21, 2019
pribor pushed a commit to GlobalWebIndex/arrow that referenced this pull request Oct 24, 2025
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants