Skip to content
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

GH-37569: [MATLAB] Implement isequal for the arrow.type.Field MATLAB class #37617

Merged
merged 9 commits into from
Sep 7, 2023

Conversation

sgilmore10
Copy link
Member

@sgilmore10 sgilmore10 commented Sep 7, 2023

Rationale for this change

Following on to #37474, #37446, and #37525, we should implement isequal for the arrow.type.Field MATLAB class.

What changes are included in this PR?

  1. Implemented the isequal method for arrow.type.Field

Are these changes tested?

Yes. Add new unit tests to tField.m

Are there any user-facing changes?

Yes. Users can now call isequal on arrow.type.Fields to determine if two fields are equal.

Example

>> f1 = arrow.field("A", arrow.time32(TimeUnit="Second"));
>> f2 = arrow.field("B", arrow.time32(TimeUnit="Second"));
>> f3 = arrow.field("A", arrow.time32(TimeUnit="Millisecond"));

>> isequal(f1, f1)

ans =

  logical

   1

% Name properties differ
>> isequal(f1, f2)

ans =

  logical

   0

% Type properties differ
>> isequal(f1, f3)

ans =

  logical

   0

Future Directions

  1. [MATLAB] Implement isequal for the arrow.tabular.Schema MATLAB class #37568
  2. [MATLAB] Implement isequal for the arrow.tabular.RecordBatch MATLAB class #37570

Copy link
Member

@kevingurney kevingurney left a comment

Choose a reason for hiding this comment

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

This looks good overall! Just added a few very minor comments.

matlab/src/matlab/+arrow/+type/Field.m Outdated Show resolved Hide resolved
matlab/test/arrow/type/tField.m Outdated Show resolved Hide resolved
matlab/test/arrow/type/tField.m Outdated Show resolved Hide resolved
@github-actions github-actions bot added awaiting changes Awaiting changes and removed awaiting review Awaiting review labels Sep 7, 2023
@github-actions github-actions bot added awaiting change review Awaiting change review and removed awaiting changes Awaiting changes labels Sep 7, 2023
@kevingurney
Copy link
Member

+1

@github-actions github-actions bot added awaiting merge Awaiting merge and removed awaiting change review Awaiting change review labels Sep 7, 2023
@kevingurney kevingurney merged commit 3aa7e24 into apache:main Sep 7, 2023
9 checks passed
@kevingurney kevingurney deleted the GH-37569 branch September 7, 2023 20:39
@kevingurney kevingurney removed the awaiting merge Awaiting merge label Sep 7, 2023
@conbench-apache-arrow
Copy link

After merging your PR, Conbench analyzed the 5 benchmarking runs that have been run so far on merge-commit 3aa7e24.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details.

loicalleyne pushed a commit to loicalleyne/arrow that referenced this pull request Nov 13, 2023
…d` MATLAB class (apache#37617)

### Rationale for this change

Following on to apache#37474, apache#37446, and apache#37525, we should implement `isequal` for the `arrow.type.Field` MATLAB class.

### What changes are included in this PR?

1. Implemented the `isequal` method for `arrow.type.Field`

### Are these changes tested?

Yes. Add new unit tests to `tField.m`

### Are there any user-facing changes?

Yes. Users can now call `isequal` on `arrow.type.Field`s to determine if two fields are equal.

**Example**
```matlab
>> f1 = arrow.field("A", arrow.time32(TimeUnit="Second"));
>> f2 = arrow.field("B", arrow.time32(TimeUnit="Second"));
>> f3 = arrow.field("A", arrow.time32(TimeUnit="Millisecond"));

>> isequal(f1, f1)

ans =

  logical

   1

% Name properties differ
>> isequal(f1, f2)

ans =

  logical

   0

% Type properties differ
>> isequal(f1, f3)

ans =

  logical

   0
```

### Future Directions

1. apache#37568
2. apache#37570

* Closes: apache#37569

Authored-by: Sarah Gilmore <sgilmore@mathworks.com>
Signed-off-by: Kevin Gurney <kgurney@mathworks.com>
dgreiss pushed a commit to dgreiss/arrow that referenced this pull request Feb 19, 2024
…d` MATLAB class (apache#37617)

### Rationale for this change

Following on to apache#37474, apache#37446, and apache#37525, we should implement `isequal` for the `arrow.type.Field` MATLAB class.

### What changes are included in this PR?

1. Implemented the `isequal` method for `arrow.type.Field`

### Are these changes tested?

Yes. Add new unit tests to `tField.m`

### Are there any user-facing changes?

Yes. Users can now call `isequal` on `arrow.type.Field`s to determine if two fields are equal.

**Example**
```matlab
>> f1 = arrow.field("A", arrow.time32(TimeUnit="Second"));
>> f2 = arrow.field("B", arrow.time32(TimeUnit="Second"));
>> f3 = arrow.field("A", arrow.time32(TimeUnit="Millisecond"));

>> isequal(f1, f1)

ans =

  logical

   1

% Name properties differ
>> isequal(f1, f2)

ans =

  logical

   0

% Type properties differ
>> isequal(f1, f3)

ans =

  logical

   0
```

### Future Directions

1. apache#37568
2. apache#37570

* Closes: apache#37569

Authored-by: Sarah Gilmore <sgilmore@mathworks.com>
Signed-off-by: Kevin Gurney <kgurney@mathworks.com>
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.

[MATLAB] Implement isequal for the arrow.type.Field MATLAB class
2 participants