Skip to content

[C++] RecordBatch::Equals ignores field names #33285

@asfimport

Description

@asfimport

The RecordBatch::Equals method only checks the equality of the schema of both batches if check_metadata=True, with a result that it doesn't actually check the schema (eg field names) by default.

Python illustration:

In [3]: batch1 = pa.record_batch(pd.DataFrame({'a': [1, 2, 3]}))

In [4]: batch2 = pa.record_batch(pd.DataFrame({'b': [1, 2, 3]}))

In [5]: batch1.equals(batch2)
Out[5]: True

In [6]: batch1.equals(batch2, check_metadata=True)
Out[6]: False

My expectation is that RecordBatch equality always requires equal field names (as Table::Equals does). And the check_metadata keyword should only control whether the metadata of the schema is considered (as the documentation also says), not whether the schema is checked at all.

Reporter: Joris Van den Bossche / @jorisvandenbossche
Assignee: Joris Van den Bossche / @jorisvandenbossche

PRs and other links:

Note: This issue was originally created as ARROW-18087. Please see the migration documentation for further details.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions