Skip to content

GH-35557 [MATLAB] Add unsigned integer array MATLAB classes (i.e. UInt8Array, UInt16Array, UInt32Array, UInt64Array) #35562

Merged
kou merged 1 commit into
apache:mainfrom
mathworks:GH-35557
May 19, 2023
Merged

GH-35557 [MATLAB] Add unsigned integer array MATLAB classes (i.e. UInt8Array, UInt16Array, UInt32Array, UInt64Array) #35562
kou merged 1 commit into
apache:mainfrom
mathworks:GH-35557

Conversation

@sgilmore10

@sgilmore10 sgilmore10 commented May 11, 2023

Copy link
Copy Markdown
Member

Rationale for this change

Followup to #35495 in which we added the MATLAB class Float32Array.

This pull request adds support for round tripping signed integer between arrow.array.<Type>Array classes and associated MATLAB types (e.g. uint8, uint16, uint32, uint64).

Arrow Array Type MATLAB Type
UInt8Array uint8
UInt16Array uint16
UInt32Array uint32
UInt64Array uint64

Example of round-tripping uint8 data:

>> uint8MATLABArray = uint8([1 2 3]')

uint8MATLABArray =

  3×1 uint8 column vector

   1
   2
   3

>> uint8ArrowArray = arrow.array.UInt8Array(uint8MATLABArray)

uint8ArrowArray = 

[
  1,
  2,
  3
]

>> uint8MATLABArrayRoundTripped = toMATLAB(uint8ArrowArray)

uint8MATLABArrayRoundTripped =

  3×1 uint8 column vector

   1
   2
   3

>> all(uint8MATLABArray == uint8MATLABArrayRoundTripped)

ans =

  logical

   1

What changes are included in this PR?

Added four new unsigned integer type arrow.array.<Array> concrete subclasses.

  1. arrow.array.UInt8Array
  2. arrow.array.UInt16Array
  3. arrow.array.UInt32Array
  4. arrow.array.UInt64Array

Are these changes tested?

Yes, we added the following four test classes:

  1. tUInt8Array.m
  2. tUInt16Array.m
  3. tUInt32Array.m
  4. tUInt64Array.m

Are there any user-facing changes?

Yes. This change introduces 4 new publicly documented classes:

  1. arrow.array.UInt8Array
  2. arrow.array.UInt16Array
  3. arrow.array.UInt32Array
  4. arrow.array.UInt64Array

Future Directions

  1. Add support for null values (i.e. validity bitmap) for the unsigned integer array types.

NOTES

  1. Thank you to @kevingurney for his help with this PR!

@github-actions

Copy link
Copy Markdown

Co-authored-by: Kevin Gurney <kgurney@mathworks.com>
@sgilmore10 sgilmore10 marked this pull request as ready for review May 19, 2023 13:47
@sgilmore10 sgilmore10 requested a review from assignUser as a code owner May 19, 2023 13:47
@sgilmore10

Copy link
Copy Markdown
Member Author

Just an fyi, this pull request and #35561 are related - they both edit matlab/src/cpp/arrow/matlab/proxy/factory.cc. We may need to rebase one of them after the first one is merged. We can handle the rebase if it's needed.

@kou kou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

+1

@kou kou merged commit 4129fe1 into apache:main May 19, 2023
@github-actions github-actions Bot added awaiting merge Awaiting merge and removed awaiting review Awaiting review labels May 19, 2023
@ursabot

ursabot commented May 22, 2023

Copy link
Copy Markdown

Benchmark runs are scheduled for baseline = 00e6996 and contender = 4129fe1. 4129fe1 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Finished ⬇️0.0% ⬆️0.0%] ec2-t3-xlarge-us-east-2
[Finished ⬇️0.66% ⬆️0.15%] test-mac-arm
[Finished ⬇️3.27% ⬆️0.33%] ursa-i9-9960x
[Finished ⬇️0.42% ⬆️0.06%] ursa-thinkcentre-m75q
Buildkite builds:
[Finished] 4129fe1a ec2-t3-xlarge-us-east-2
[Finished] 4129fe1a test-mac-arm
[Finished] 4129fe1a ursa-i9-9960x
[Finished] 4129fe1a ursa-thinkcentre-m75q
[Finished] 00e6996d ec2-t3-xlarge-us-east-2
[Finished] 00e6996d test-mac-arm
[Finished] 00e6996d ursa-i9-9960x
[Finished] 00e6996d ursa-thinkcentre-m75q
Supported benchmarks:
ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
test-mac-arm: Supported benchmark langs: C++, Python, R
ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java

@ursabot

ursabot commented May 22, 2023

Copy link
Copy Markdown

['Python', 'R'] benchmarks have high level of regressions.
ursa-i9-9960x

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] Add unsigned integer array MATLAB classes (i.e. UInt8Array, UInt16Array, UInt32Array, UInt64Array)

3 participants