You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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
…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>
Describe the enhancement requested
We should add the
Type
object hierarchy to the MATLAB interface. Eventually, we should add aType
property toarrow.array.Array
class.Component(s)
MATLAB
The text was updated successfully, but these errors were encountered: