forked from apache/arrow
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
apacheGH-37472: [MATLAB] Implement the
isequal()
method on `arrow.t…
…ype.Type` (apache#37474) ### Rationale for this change Currently, it's not possible to determine if two `arrow.type.Type` instances are equal because the `isequal()` method always returns `false` by default: ```matlab >> t = arrow.int32() t = Int32Type with properties: ID: Int32 % Compare a with itself >> tf = isequal(t, t) tf = logical 0 ``` ### What changes are included in this PR? 1. Implemented the `isequal` method on all concrete subclasses of `arrow.type.Type` 2. Added a new method called `isEqual()` on the `arrow::matlab::type::proxy::Type` class. **Example Usage** ```matlab >> t1 = arrow.timestamp(TimeUnit="Second"); >> t2 = arrow.timestamp(TimeUnit="Microsecond"); >> t3 = arrow.timestamp(TimeUnit="Second"); % Compare t1 and t2 >> tf1 = isequal(t1, t2) tf1 = logical 0 % Compare t1 and t3 >> tf2 = isequal(t1, t3) tf2 = logical 1 ``` ### Are these changes tested? Yes. Added test cases verifying `isequal` behaves as expected for all concrete subclasses of `arrow.type.Type`. ### Are there any user-facing changes? Yes. Users can now use the `isequal` method to compare `arrow.type.Type` instances for equality. ### Future Directions 1. Implement the `isequal` method for `arrow.type.Field` 2. Implement the `isequal` method for `arrow.tabular.Schema` * Closes: apache#37472 Authored-by: Sarah Gilmore <sgilmore@mathworks.com> Signed-off-by: Kevin Gurney <kgurney@mathworks.com>
- Loading branch information
1 parent
798132c
commit 602083b
Showing
19 changed files
with
686 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.