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

[MATLAB] Add the Type object hierarchy to the MATLAB interface #36177

Closed
sgilmore10 opened this issue Jun 20, 2023 · 1 comment · Fixed by #36210
Closed

[MATLAB] Add the Type object hierarchy to the MATLAB interface #36177

sgilmore10 opened this issue Jun 20, 2023 · 1 comment · Fixed by #36210

Comments

@sgilmore10
Copy link
Member

sgilmore10 commented Jun 20, 2023

Describe the enhancement requested

We should add the Type object hierarchy to the MATLAB interface. Eventually, we should add a Type property to arrow.array.Array class.

Component(s)

MATLAB

@sgilmore10
Copy link
Member Author

take

@sgilmore10 sgilmore10 changed the title [MATLAB] Add the DataType object to the MATLAB interface [MATLAB] Add a Type object to the MATLAB interface Jun 21, 2023
@sgilmore10 sgilmore10 changed the title [MATLAB] Add a Type object to the MATLAB interface [MATLAB] Add the Type object hierarchy to the MATLAB interface Jun 21, 2023
kou pushed a commit that referenced this issue Jun 22, 2023
…ace (#36210)

### Rationale for this change

As we continue to build up the MATLAB Interface, we need to add the `Type` class hierarchy to the interface to support objects with schemas.

### What changes are included in this PR?

1. Added an enum class called `arrow.type.ID` with the following values:
```matlab
>> enumeration(arrow.type.ID.Boolean)

Enumeration members for class 'arrow.type.ID':

    Boolean
    UInt8
    Int8
    UInt16
    Int16
    UInt32
    Int32
    UInt64
    Int64
    Float32
    Float64
```

2. Added an abstract class representing a type called `arrow.type.Type`. It defines one property named `ID` that all concrete subclasses must define. `ID` must be an `arrow.type.ID`.

3. Defined an abstract class called `arrow.type.PrimitiveType` that inherits from `arrow.type.Type`. All primitive type classes inherit from this class.

4. Defined the following concrete type classes: 
    - `arrow.type.BooleanType`
    - `arrow.type.Float32Type`
    - `arrow.type.Float64Type`
    - `arrow.type.Int8Type`
    - `arrow.type.UInt8Type`
    - `arrow.type.Int16Type`
    - `arrow.type.UInt16Type`
    - `arrow.type.Int32Type`
    - `arrow.type.UInt32Type`
    - `arrow.type.Int64Type`
    - `arrow.type.UInt64Type`

### Are these changes tested?

Yes, added the following test classes: 
    - `tID.m`
    - `tBooleanType.m`
    - `tFloat32Type.m`
    - `tFloat64Type.m`
    - `tInt8Type.m`
    - `tUInt8Type.m`
    - `tInt16Type.m`
    - `tUInt16Type.m`
    - `tInt32Type.m`
    - `tUInt32Type.m`
    - `tInt64Type.m`
    - `tUInt64Type.m`

### Future Directions

1. Add a new property to `arrow.array.Array` called `Type`.
2. Add a `arrow.type.Field` class.
3. Add a `arrow.tabular.Schema` class.
4. As we add more array types, we will extend `arrow.type.ID` and add the appropriate type class. 

* Closes: #36177 

Authored-by: Sarah Gilmore <sgilmore@mathworks.com>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
@kou kou added this to the 13.0.0 milestone Jun 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants