You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "sgilmore10 (via GitHub)" <gi...@apache.org> on 2023/06/21 18:38:54 UTC

[GitHub] [arrow] sgilmore10 opened a new pull request, #36210: GH-36177: [MATLAB] Add the Type object hierarchy to the MATLAB interface

sgilmore10 opened a new pull request, #36210:
URL: https://github.com/apache/arrow/pull/36210

   <!--
   Thanks for opening a pull request!
   If this is your first pull request you can find detailed information on how 
   to contribute here:
     * [New Contributor's Guide](https://arrow.apache.org/docs/dev/developers/guide/step_by_step/pr_lifecycle.html#reviews-and-merge-of-the-pull-request)
     * [Contributing Overview](https://arrow.apache.org/docs/dev/developers/overview.html)
   
   
   If this is not a [minor PR](https://github.com/apache/arrow/blob/main/CONTRIBUTING.md#Minor-Fixes). Could you open an issue for this pull request on GitHub? https://github.com/apache/arrow/issues/new/choose
   
   Opening GitHub issues ahead of time contributes to the [Openness](http://theapacheway.com/open/#:~:text=Openness%20allows%20new%20users%20the,must%20happen%20in%20the%20open.) of the Apache Arrow project.
   
   Then could you also rename the pull request title in the following format?
   
       GH-${GITHUB_ISSUE_ID}: [${COMPONENT}] ${SUMMARY}
   
   or
   
       MINOR: [${COMPONENT}] ${SUMMARY}
   
   In the case of PARQUET issues on JIRA the title also supports:
   
       PARQUET-${JIRA_ISSUE_ID}: [${COMPONENT}] ${SUMMARY}
   
   -->
   
   ### 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. 
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] kou merged pull request #36210: GH-36177: [MATLAB] Add the Type object hierarchy to the MATLAB interface

Posted by "kou (via GitHub)" <gi...@apache.org>.
kou merged PR #36210:
URL: https://github.com/apache/arrow/pull/36210


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] sgilmore10 commented on a diff in pull request #36210: GH-36177: [MATLAB] Add the Type object hierarchy to the MATLAB interface

Posted by "sgilmore10 (via GitHub)" <gi...@apache.org>.
sgilmore10 commented on code in PR #36210:
URL: https://github.com/apache/arrow/pull/36210#discussion_r1238529065


##########
matlab/src/matlab/+arrow/+type/ID.m:
##########
@@ -0,0 +1,52 @@
+% Licensed to the Apache Software Foundation (ASF) under one or more
+% contributor license agreements.  See the NOTICE file distributed with
+% this work for additional information regarding copyright ownership.
+% The ASF licenses this file to you under the Apache License, Version
+% 2.0 (the "License"); you may not use this file except in compliance
+% with the License.  You may obtain a copy of the License at
+%
+%   http://www.apache.org/licenses/LICENSE-2.0
+%
+% Unless required by applicable law or agreed to in writing, software
+% distributed under the License is distributed on an "AS IS" BASIS,
+% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+% implied.  See the License for the specific language governing
+% permissions and limitations under the License.
+
+classdef ID < uint64
+%ID Data type enumeration
+    enumeration
+        Boolean (1)
+        UInt8   (2)
+        Int8    (3)
+        UInt16  (4)
+        Int16   (5)
+        UInt32  (6)
+        Int32   (7)
+        UInt64  (8)
+        Int64   (9)
+        % Float16 (10) not yet supported
+        Float32 (11)
+        Float64 (12)
+    end
+
+    methods
+        function bitWidth = bitWidth(obj)

Review Comment:
   Hi @kou,
   
   We debated creating proxy `type` objects versus mirroring them in MATLAB. We decided against creating proxy objects for now, but can always revisit this decision later. From the user's perspective, there would be no difference.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] kou commented on a diff in pull request #36210: GH-36177: [MATLAB] Add the Type object hierarchy to the MATLAB interface

Posted by "kou (via GitHub)" <gi...@apache.org>.
kou commented on code in PR #36210:
URL: https://github.com/apache/arrow/pull/36210#discussion_r1237936824


##########
matlab/src/matlab/+arrow/+type/ID.m:
##########
@@ -0,0 +1,52 @@
+% Licensed to the Apache Software Foundation (ASF) under one or more
+% contributor license agreements.  See the NOTICE file distributed with
+% this work for additional information regarding copyright ownership.
+% The ASF licenses this file to you under the Apache License, Version
+% 2.0 (the "License"); you may not use this file except in compliance
+% with the License.  You may obtain a copy of the License at
+%
+%   http://www.apache.org/licenses/LICENSE-2.0
+%
+% Unless required by applicable law or agreed to in writing, software
+% distributed under the License is distributed on an "AS IS" BASIS,
+% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+% implied.  See the License for the specific language governing
+% permissions and limitations under the License.
+
+classdef ID < uint64
+%ID Data type enumeration
+    enumeration
+        Boolean (1)
+        UInt8   (2)
+        Int8    (3)
+        UInt16  (4)
+        Int16   (5)
+        UInt32  (6)
+        Int32   (7)
+        UInt64  (8)
+        Int64   (9)
+        % Float16 (10) not yet supported
+        Float32 (11)
+        Float64 (12)
+    end
+
+    methods
+        function bitWidth = bitWidth(obj)

Review Comment:
   FYI: Type classes in Apache Arrow C++ also provide bit width by `bit_width()` method.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] conbench-apache-arrow[bot] commented on pull request #36210: GH-36177: [MATLAB] Add the Type object hierarchy to the MATLAB interface

Posted by "conbench-apache-arrow[bot] (via GitHub)" <gi...@apache.org>.
conbench-apache-arrow[bot] commented on PR #36210:
URL: https://github.com/apache/arrow/pull/36210#issuecomment-1605820495

   Conbench analyzed the 6 benchmark runs on commit `cd6b2b5d`.
   
   There was 1 benchmark result indicating a performance regression:
   
   - Commit Run on `arm64-m6g-linux-compute` at [2023-06-23 04:19:32Z](http://conbench.ursa.dev/compare/runs/4a2926abc3564541a2d1db33b123c5b1...2122580d77b440bba7b3844c04eef75f/)
     - [params=<SMALL_VECTOR(int)>, source=cpp-micro, suite=arrow-small-vector-benchmark](http://conbench.ursa.dev/compare/benchmarks/06494f8f78e47c0080007666ed73743c...064951d94e2d7eb18000a1c3bdb72723)
   
   The [full Conbench report](https://github.com/apache/arrow/runs/14528880053) has more details.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] kou commented on a diff in pull request #36210: GH-36177: [MATLAB] Add the Type object hierarchy to the MATLAB interface

Posted by "kou (via GitHub)" <gi...@apache.org>.
kou commented on code in PR #36210:
URL: https://github.com/apache/arrow/pull/36210#discussion_r1237936824


##########
matlab/src/matlab/+arrow/+type/ID.m:
##########
@@ -0,0 +1,52 @@
+% Licensed to the Apache Software Foundation (ASF) under one or more
+% contributor license agreements.  See the NOTICE file distributed with
+% this work for additional information regarding copyright ownership.
+% The ASF licenses this file to you under the Apache License, Version
+% 2.0 (the "License"); you may not use this file except in compliance
+% with the License.  You may obtain a copy of the License at
+%
+%   http://www.apache.org/licenses/LICENSE-2.0
+%
+% Unless required by applicable law or agreed to in writing, software
+% distributed under the License is distributed on an "AS IS" BASIS,
+% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+% implied.  See the License for the specific language governing
+% permissions and limitations under the License.
+
+classdef ID < uint64
+%ID Data type enumeration
+    enumeration
+        Boolean (1)
+        UInt8   (2)
+        Int8    (3)
+        UInt16  (4)
+        Int16   (5)
+        UInt32  (6)
+        Int32   (7)
+        UInt64  (8)
+        Int64   (9)
+        % Float16 (10) not yet supported
+        Float32 (11)
+        Float64 (12)
+    end
+
+    methods
+        function bitWidth = bitWidth(obj)

Review Comment:
   FYI: Type classes in Apache Arrow C++ also bit width by `bit_width()` method.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org