You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by ke...@apache.org on 2023/07/17 18:51:13 UTC
[arrow] branch main updated: GH-36652: [MATLAB] Initialize the `Type` property of `arrow.array.Array` subclasses from existing proxy ids (#36731)
This is an automated email from the ASF dual-hosted git repository.
kevingurney pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/main by this push:
new 752552c7c4 GH-36652: [MATLAB] Initialize the `Type` property of `arrow.array.Array` subclasses from existing proxy ids (#36731)
752552c7c4 is described below
commit 752552c7c460596ef24dd6ea85a71c8b5071d379
Author: sgilmore10 <74...@users.noreply.github.com>
AuthorDate: Mon Jul 17 14:51:05 2023 -0400
GH-36652: [MATLAB] Initialize the `Type` property of `arrow.array.Array` subclasses from existing proxy ids (#36731)
### Rationale for this change
Now that the issue #36363 is closed via PR #36419, we can initialize the `Type` property of `arrow.array.Array` subclasses from existing proxy ids. Currently, we create a new proxy `Type` object whose underlying `arrow::DataType` are semantically equal to - but not the same as - the `arrow::DataType` owned by the Array proxy. It would be preferable if the `Type` and `Array` proxy classes refer to the same `arrow::DataType` object (i.e. the same object on the heap).
### What changes are included in this PR?
1. Upgraded `libmexclass` to commit [d04f88d](https://github.com/mathworks/libmexclass/commit/d04f88d2a6f6dcf65d595183eda03c4b66b2961f). In this commit, we added a static "make-like" function to `Proxy` called `create`.
2. Modified the constructors of all `Type` objects to expect a single `Proxy` object as input. This is a breaking change and means clients are no longer expected to build `Type` objects via their constructors. Instead, we introduced standalone functions that clients can use to construct `Type` objects, i.e. `arrow.type.int8`, `arrow.type.string`, `arrow.type.timestamp`, etc. These functions deal with creating the `Proxy` objects to pass to the `Type` constructors. Below is an examp [...]
```matlab
>> timestampType = arrow.type.timestamp(TimeUnit="second", TimeZone="America/New_York")
timestampType =
TimestampType with properties:
ID: Timestamp
```
NOTE: We plan on enhancing the display to show the `TimeUnit` and `TimeZone` properties.
3. Made `Type` a [dependent](https://www.mathworks.com/help/matlab/matlab_oop/access-methods-for-dependent-properties.html) property on `arrow.array.Array`. The `get.Type` method constructs a `Type` object on demand by making a proxy that wraps the same `arrow::DataType` object stored within the `arrow::Array`.
### Are these changes tested?
Yes, updated existing tests.
### Are there any user-facing changes?
Yes, we added new standalone functions for creating `Type` objects. Below is a table mapping standalone functions to the `Type` object they output:
| Standalone Function | Output Type Object |
|----------------------|---------------------|
|`arrow.type.boolean`| `arrow.type.BooleanType`|
|`arrow.type.int8`| `arrow.type.Int8Type`|
|`arrow.type.int16`| `arrow.type.Int16Type`|
|`arrow.type.int32`| `arrow.type.Int32Type`|
|`arrow.type.int64`| `arrow.type.Int64Type`|
|`arrow.type.uint8`| `arrow.type.UInt8Type`|
|`arrow.type.uint16`| `arrow.type.UInt16Type`|
|`arrow.type.uint32`| `arrow.type.UInt32Type`|
|`arrow.type.uint64`| `arrow.type.UInt64Type`|
|`arrow.type.string`| `arrow.type.StringType`|
|`arrow.type.timestamp`| `arrow.type.TimestampType`|
### Notes
Thanks @ kevingurney for the advice!
* Closes: #36652
Authored-by: Sarah Gilmore <sg...@mathworks.com>
Signed-off-by: Kevin Gurney <kg...@mathworks.com>
---
matlab/src/cpp/arrow/matlab/array/proxy/array.cc | 21 +++++++++++++-
matlab/src/cpp/arrow/matlab/array/proxy/array.h | 5 ++++
.../cpp/arrow/matlab/array/proxy/boolean_array.cc | 7 +++++
.../cpp/arrow/matlab/array/proxy/boolean_array.h | 2 ++
.../cpp/arrow/matlab/array/proxy/numeric_array.h | 9 ++++++
.../cpp/arrow/matlab/array/proxy/string_array.cc | 8 ++++++
.../cpp/arrow/matlab/array/proxy/string_array.h | 3 ++
.../arrow/matlab/array/proxy/timestamp_array.cc | 8 ++++++
.../cpp/arrow/matlab/array/proxy/timestamp_array.h | 3 ++
matlab/src/matlab/+arrow/+array/Array.m | 9 +++++-
matlab/src/matlab/+arrow/+array/BooleanArray.m | 4 ---
matlab/src/matlab/+arrow/+array/Float32Array.m | 4 ---
matlab/src/matlab/+arrow/+array/Float64Array.m | 4 ---
matlab/src/matlab/+arrow/+array/Int16Array.m | 4 ---
matlab/src/matlab/+arrow/+array/Int32Array.m | 4 ---
matlab/src/matlab/+arrow/+array/Int64Array.m | 4 ---
matlab/src/matlab/+arrow/+array/Int8Array.m | 4 ---
matlab/src/matlab/+arrow/+array/StringArray.m | 4 ---
matlab/src/matlab/+arrow/+array/TimestampArray.m | 5 ----
matlab/src/matlab/+arrow/+array/UInt16Array.m | 4 ---
matlab/src/matlab/+arrow/+array/UInt32Array.m | 4 ---
matlab/src/matlab/+arrow/+array/UInt64Array.m | 4 ---
matlab/src/matlab/+arrow/+array/UInt8Array.m | 4 ---
.../matlab/+arrow/+internal/+proxy/create.m} | 15 +++++-----
.../Int16Type.m => +internal/+proxy/validate.m} | 20 +++++++------
matlab/src/matlab/+arrow/+type/BooleanType.m | 8 ++++--
matlab/src/matlab/+arrow/+type/FixedWidthType.m | 7 +++--
matlab/src/matlab/+arrow/+type/Float32Type.m | 8 ++++--
matlab/src/matlab/+arrow/+type/Float64Type.m | 8 ++++--
matlab/src/matlab/+arrow/+type/Int16Type.m | 8 ++++--
matlab/src/matlab/+arrow/+type/Int32Type.m | 8 ++++--
matlab/src/matlab/+arrow/+type/Int64Type.m | 8 ++++--
matlab/src/matlab/+arrow/+type/Int8Type.m | 8 ++++--
matlab/src/matlab/+arrow/+type/StringType.m | 8 ++++--
matlab/src/matlab/+arrow/+type/TimestampType.m | 13 ++++-----
matlab/src/matlab/+arrow/+type/Type.m | 7 +++--
matlab/src/matlab/+arrow/+type/UInt16Type.m | 8 ++++--
matlab/src/matlab/+arrow/+type/UInt32Type.m | 8 ++++--
matlab/src/matlab/+arrow/+type/UInt64Type.m | 8 ++++--
matlab/src/matlab/+arrow/+type/UInt8Type.m | 8 ++++--
.../matlab/+arrow/+type/boolean.m} | 14 ++++-----
.../matlab/+arrow/+type/float32.m} | 12 +++-----
.../matlab/+arrow/+type/float64.m} | 14 ++++-----
.../matlab/+arrow/+type/int16.m} | 14 ++++-----
.../matlab/+arrow/+type/int32.m} | 12 +++-----
.../matlab/+arrow/+type/int64.m} | 13 ++++-----
.../tInt8Type.m => src/matlab/+arrow/+type/int8.m} | 14 ++++-----
.../matlab/+arrow/+type/string.m} | 13 ++++-----
.../+arrow/+type/{BooleanType.m => timestamp.m} | 15 +++++-----
.../matlab/+arrow/+type/uint16.m} | 13 ++++-----
.../matlab/+arrow/+type/uint32.m} | 13 ++++-----
.../matlab/+arrow/+type/uint64.m} | 14 ++++-----
.../matlab/+arrow/+type/uint8.m} | 13 ++++-----
matlab/test/arrow/array/tBooleanArray.m | 2 +-
matlab/test/arrow/array/tFloat32Array.m | 2 +-
matlab/test/arrow/array/tFloat64Array.m | 2 +-
matlab/test/arrow/array/tInt16Array.m | 2 +-
matlab/test/arrow/array/tInt32Array.m | 2 +-
matlab/test/arrow/array/tInt64Array.m | 2 +-
matlab/test/arrow/array/tInt8Array.m | 2 +-
matlab/test/arrow/array/tStringArray.m | 2 +-
matlab/test/arrow/array/tUInt16Array.m | 2 +-
matlab/test/arrow/array/tUInt32Array.m | 2 +-
matlab/test/arrow/array/tUInt64Array.m | 2 +-
matlab/test/arrow/array/tUInt8Array.m | 2 +-
matlab/test/arrow/type/hFixedWidthType.m | 7 +++++
matlab/test/arrow/type/tBooleanType.m | 5 ++--
matlab/test/arrow/type/tFloat32Type.m | 5 ++--
matlab/test/arrow/type/tFloat64Type.m | 6 ++--
matlab/test/arrow/type/tInt16Type.m | 5 ++--
matlab/test/arrow/type/tInt32Type.m | 5 ++--
matlab/test/arrow/type/tInt64Type.m | 5 ++--
matlab/test/arrow/type/tInt8Type.m | 5 ++--
matlab/test/arrow/type/tStringType.m | 4 +--
matlab/test/arrow/type/tTimestampType.m | 33 +++++++++++++---------
matlab/test/arrow/type/tUInt16Type.m | 5 ++--
matlab/test/arrow/type/tUInt32Type.m | 5 ++--
matlab/test/arrow/type/tUInt64Type.m | 5 ++--
matlab/test/arrow/type/tUInt8Type.m | 5 ++--
matlab/tools/cmake/BuildMatlabArrowInterface.cmake | 2 +-
80 files changed, 322 insertions(+), 264 deletions(-)
diff --git a/matlab/src/cpp/arrow/matlab/array/proxy/array.cc b/matlab/src/cpp/arrow/matlab/array/proxy/array.cc
index 7f4d789c10..c2d0330b5f 100644
--- a/matlab/src/cpp/arrow/matlab/array/proxy/array.cc
+++ b/matlab/src/cpp/arrow/matlab/array/proxy/array.cc
@@ -20,6 +20,10 @@
#include "arrow/matlab/array/proxy/array.h"
#include "arrow/matlab/bit/unpack.h"
#include "arrow/matlab/error/error.h"
+#include "arrow/type_traits.h"
+#include "arrow/visit_array_inline.h"
+
+#include "libmexclass/proxy/ProxyManager.h"
namespace arrow::matlab::array::proxy {
@@ -30,6 +34,7 @@ namespace arrow::matlab::array::proxy {
REGISTER_METHOD(Array, toMATLAB);
REGISTER_METHOD(Array, length);
REGISTER_METHOD(Array, valid);
+ REGISTER_METHOD(Array, type);
}
std::shared_ptr<arrow::Array> Array::getArray() {
@@ -69,4 +74,18 @@ namespace arrow::matlab::array::proxy {
auto valid_elements_mda = bit::unpack(validity_bitmap, array_length);
context.outputs[0] = valid_elements_mda;
}
-}
+
+ void Array::type(libmexclass::proxy::method::Context& context) {
+ namespace mda = ::matlab::data;
+
+ mda::ArrayFactory factory;
+
+ auto type_proxy = typeProxy();
+ auto type_id = type_proxy->unwrap()->id();
+ auto proxy_id = libmexclass::proxy::ProxyManager::manageProxy(type_proxy);
+
+ context.outputs[0] = factory.createScalar(proxy_id);
+ context.outputs[1] = factory.createScalar(static_cast<int64_t>(type_id));
+
+ }
+}
\ No newline at end of file
diff --git a/matlab/src/cpp/arrow/matlab/array/proxy/array.h b/matlab/src/cpp/arrow/matlab/array/proxy/array.h
index c36f190071..55d48c26ef 100644
--- a/matlab/src/cpp/arrow/matlab/array/proxy/array.h
+++ b/matlab/src/cpp/arrow/matlab/array/proxy/array.h
@@ -18,6 +18,7 @@
#pragma once
#include "arrow/array.h"
+#include "arrow/matlab/type/proxy/type.h"
#include "libmexclass/proxy/Proxy.h"
@@ -39,8 +40,12 @@ class Array : public libmexclass::proxy::Proxy {
void valid(libmexclass::proxy::method::Context& context);
+ void type(libmexclass::proxy::method::Context& context);
+
virtual void toMATLAB(libmexclass::proxy::method::Context& context) = 0;
+ virtual std::shared_ptr<type::proxy::Type> typeProxy() = 0;
+
std::shared_ptr<arrow::Array> array;
};
diff --git a/matlab/src/cpp/arrow/matlab/array/proxy/boolean_array.cc b/matlab/src/cpp/arrow/matlab/array/proxy/boolean_array.cc
index bcbe49f04b..281a0f732d 100644
--- a/matlab/src/cpp/arrow/matlab/array/proxy/boolean_array.cc
+++ b/matlab/src/cpp/arrow/matlab/array/proxy/boolean_array.cc
@@ -16,6 +16,7 @@
// under the License.
#include "arrow/matlab/array/proxy/boolean_array.h"
+#include "arrow/matlab/type/proxy/primitive_ctype.h"
#include "arrow/matlab/error/error.h"
#include "arrow/matlab/bit/pack.h"
@@ -54,4 +55,10 @@ namespace arrow::matlab::array::proxy {
context.outputs[0] = logical_array_mda;
}
+ std::shared_ptr<type::proxy::Type> BooleanArray::typeProxy() {
+ using BooleanTypeProxy = type::proxy::PrimitiveCType<bool>;
+
+ auto type = std::static_pointer_cast<arrow::BooleanType>(array->type());
+ return std::make_shared<BooleanTypeProxy>(std::move(type));
+ }
}
diff --git a/matlab/src/cpp/arrow/matlab/array/proxy/boolean_array.h b/matlab/src/cpp/arrow/matlab/array/proxy/boolean_array.h
index b3117d852a..5e6e51f0bc 100644
--- a/matlab/src/cpp/arrow/matlab/array/proxy/boolean_array.h
+++ b/matlab/src/cpp/arrow/matlab/array/proxy/boolean_array.h
@@ -33,6 +33,8 @@ namespace arrow::matlab::array::proxy {
protected:
void toMATLAB(libmexclass::proxy::method::Context& context) override;
+ std::shared_ptr<type::proxy::Type> typeProxy() override;
+
};
}
diff --git a/matlab/src/cpp/arrow/matlab/array/proxy/numeric_array.h b/matlab/src/cpp/arrow/matlab/array/proxy/numeric_array.h
index d3930c77ca..c66c1d044f 100644
--- a/matlab/src/cpp/arrow/matlab/array/proxy/numeric_array.h
+++ b/matlab/src/cpp/arrow/matlab/array/proxy/numeric_array.h
@@ -24,6 +24,8 @@
#include "arrow/type_traits.h"
#include "arrow/matlab/array/proxy/array.h"
+#include "arrow/matlab/type/proxy/primitive_ctype.h"
+
#include "arrow/matlab/error/error.h"
#include "arrow/matlab/bit/pack.h"
#include "arrow/matlab/bit/unpack.h"
@@ -79,6 +81,13 @@ class NumericArray : public arrow::matlab::array::proxy::Array {
::matlab::data::TypedArray<CType> result = factory.createArray({num_elements, 1}, data_begin, data_end);
context.outputs[0] = result;
}
+
+ std::shared_ptr<type::proxy::Type> typeProxy() override {
+ using ArrowTypeProxy = type::proxy::PrimitiveCType<CType>;
+ auto type = std::static_pointer_cast<ArrowType>(array->type());
+ return std::make_shared<ArrowTypeProxy>(std::move(type));
+ }
+
};
}
diff --git a/matlab/src/cpp/arrow/matlab/array/proxy/string_array.cc b/matlab/src/cpp/arrow/matlab/array/proxy/string_array.cc
index 2a11323a21..16331f6195 100644
--- a/matlab/src/cpp/arrow/matlab/array/proxy/string_array.cc
+++ b/matlab/src/cpp/arrow/matlab/array/proxy/string_array.cc
@@ -16,6 +16,7 @@
// under the License.
#include "arrow/matlab/array/proxy/string_array.h"
+#include "arrow/matlab/type/proxy/string_type.h"
#include "arrow/array/builder_binary.h"
@@ -81,4 +82,11 @@ namespace arrow::matlab::array::proxy {
context.outputs[0] = array_mda;
}
+ std::shared_ptr<type::proxy::Type> StringArray::typeProxy() {
+ using StringTypeProxy = type::proxy::StringType;
+
+ auto type = std::static_pointer_cast<arrow::StringType>(array->type());
+ return std::make_shared<StringTypeProxy>(std::move(type));
+ }
+
}
diff --git a/matlab/src/cpp/arrow/matlab/array/proxy/string_array.h b/matlab/src/cpp/arrow/matlab/array/proxy/string_array.h
index bdcfedd7cd..abb2322edb 100644
--- a/matlab/src/cpp/arrow/matlab/array/proxy/string_array.h
+++ b/matlab/src/cpp/arrow/matlab/array/proxy/string_array.h
@@ -33,6 +33,9 @@ namespace arrow::matlab::array::proxy {
protected:
void toMATLAB(libmexclass::proxy::method::Context& context) override;
+
+ std::shared_ptr<type::proxy::Type> typeProxy() override;
+
};
}
diff --git a/matlab/src/cpp/arrow/matlab/array/proxy/timestamp_array.cc b/matlab/src/cpp/arrow/matlab/array/proxy/timestamp_array.cc
index 17a86e848a..b9bbf3d7e7 100644
--- a/matlab/src/cpp/arrow/matlab/array/proxy/timestamp_array.cc
+++ b/matlab/src/cpp/arrow/matlab/array/proxy/timestamp_array.cc
@@ -16,6 +16,7 @@
// under the License.
#include "arrow/matlab/array/proxy/timestamp_array.h"
+#include "arrow/matlab/type/proxy/timestamp_type.h"
#include "arrow/matlab/error/error.h"
#include "arrow/matlab/bit/pack.h"
@@ -88,4 +89,11 @@ namespace arrow::matlab::array::proxy {
mda::TypedArray<int64_t> result = factory.createArray({num_elements, 1}, data_begin, data_end);
context.outputs[0] = result;
}
+
+ std::shared_ptr<type::proxy::Type> TimestampArray::typeProxy() {
+ using TimestampProxyType = type::proxy::TimestampType;
+ auto type = std::static_pointer_cast<arrow::TimestampType>(array->type());
+ return std::make_shared<TimestampProxyType>(std::move(type));
+
+ }
}
diff --git a/matlab/src/cpp/arrow/matlab/array/proxy/timestamp_array.h b/matlab/src/cpp/arrow/matlab/array/proxy/timestamp_array.h
index 8f28d6165e..a312a129a2 100644
--- a/matlab/src/cpp/arrow/matlab/array/proxy/timestamp_array.h
+++ b/matlab/src/cpp/arrow/matlab/array/proxy/timestamp_array.h
@@ -35,6 +35,9 @@ class TimestampArray : public arrow::matlab::array::proxy::Array {
protected:
void toMATLAB(libmexclass::proxy::method::Context& context) override;
+
+ std::shared_ptr<type::proxy::Type> typeProxy() override;
+
};
}
diff --git a/matlab/src/matlab/+arrow/+array/Array.m b/matlab/src/matlab/+arrow/+array/Array.m
index 9b8796c33b..7426052764 100644
--- a/matlab/src/matlab/+arrow/+array/Array.m
+++ b/matlab/src/matlab/+arrow/+array/Array.m
@@ -26,7 +26,7 @@ classdef (Abstract) Array < matlab.mixin.CustomDisplay & ...
Valid % Validity bitmap
end
- properties(Abstract, SetAccess=private, GetAccess=public)
+ properties(Dependent, SetAccess=private, GetAccess=public)
Type(1, 1) arrow.type.Type
end
@@ -46,6 +46,13 @@ classdef (Abstract) Array < matlab.mixin.CustomDisplay & ...
function matlabArray = toMATLAB(obj)
matlabArray = obj.Proxy.toMATLAB();
end
+
+ function type = get.Type(obj)
+ [proxyID, typeID] = obj.Proxy.type();
+ traits = arrow.type.traits.traits(arrow.type.ID(typeID));
+ proxy = libmexclass.proxy.Proxy(Name=traits.TypeProxyClassName, ID=proxyID);
+ type = traits.TypeConstructor(proxy);
+ end
end
methods (Access = private)
diff --git a/matlab/src/matlab/+arrow/+array/BooleanArray.m b/matlab/src/matlab/+arrow/+array/BooleanArray.m
index e5c4cc527e..f4d341efce 100644
--- a/matlab/src/matlab/+arrow/+array/BooleanArray.m
+++ b/matlab/src/matlab/+arrow/+array/BooleanArray.m
@@ -20,10 +20,6 @@ classdef BooleanArray < arrow.array.Array
NullSubstitionValue = false;
end
- properties(SetAccess=private, GetAccess=public)
- Type = arrow.type.BooleanType
- end
-
methods
function obj = BooleanArray(data, opts)
arguments
diff --git a/matlab/src/matlab/+arrow/+array/Float32Array.m b/matlab/src/matlab/+arrow/+array/Float32Array.m
index 29f23393a4..c6be563d86 100644
--- a/matlab/src/matlab/+arrow/+array/Float32Array.m
+++ b/matlab/src/matlab/+arrow/+array/Float32Array.m
@@ -20,10 +20,6 @@ classdef Float32Array < arrow.array.NumericArray
NullSubstitutionValue = single(NaN);
end
- properties(SetAccess=private, GetAccess=public)
- Type = arrow.type.Float32Type
- end
-
methods
function obj = Float32Array(data, varargin)
obj@arrow.array.NumericArray(data, "single", ...
diff --git a/matlab/src/matlab/+arrow/+array/Float64Array.m b/matlab/src/matlab/+arrow/+array/Float64Array.m
index ab92715864..ff43ebc053 100644
--- a/matlab/src/matlab/+arrow/+array/Float64Array.m
+++ b/matlab/src/matlab/+arrow/+array/Float64Array.m
@@ -20,10 +20,6 @@ classdef Float64Array < arrow.array.NumericArray
NullSubstitutionValue = NaN;
end
- properties(SetAccess=private, GetAccess=public)
- Type = arrow.type.Float64Type
- end
-
methods
function obj = Float64Array(data, varargin)
obj@arrow.array.NumericArray(data, "double", ...
diff --git a/matlab/src/matlab/+arrow/+array/Int16Array.m b/matlab/src/matlab/+arrow/+array/Int16Array.m
index 23716d5f59..533f0c9ef5 100644
--- a/matlab/src/matlab/+arrow/+array/Int16Array.m
+++ b/matlab/src/matlab/+arrow/+array/Int16Array.m
@@ -20,10 +20,6 @@ classdef Int16Array < arrow.array.NumericArray
NullSubstitutionValue = int16(0)
end
- properties(SetAccess=private, GetAccess=public)
- Type = arrow.type.Int16Type
- end
-
methods
function obj = Int16Array(data, varargin)
obj@arrow.array.NumericArray(data, "int16", ...
diff --git a/matlab/src/matlab/+arrow/+array/Int32Array.m b/matlab/src/matlab/+arrow/+array/Int32Array.m
index 8844576ae1..0f977fb90f 100644
--- a/matlab/src/matlab/+arrow/+array/Int32Array.m
+++ b/matlab/src/matlab/+arrow/+array/Int32Array.m
@@ -20,10 +20,6 @@ classdef Int32Array < arrow.array.NumericArray
NullSubstitutionValue = int32(0)
end
- properties(SetAccess=private, GetAccess=public)
- Type = arrow.type.Int32Type
- end
-
methods
function obj = Int32Array(data, varargin)
obj@arrow.array.NumericArray(data, "int32", ...
diff --git a/matlab/src/matlab/+arrow/+array/Int64Array.m b/matlab/src/matlab/+arrow/+array/Int64Array.m
index 9f72c5f2a6..94cad56519 100644
--- a/matlab/src/matlab/+arrow/+array/Int64Array.m
+++ b/matlab/src/matlab/+arrow/+array/Int64Array.m
@@ -20,10 +20,6 @@ classdef Int64Array < arrow.array.NumericArray
NullSubstitutionValue = int64(0);
end
- properties(SetAccess=private, GetAccess=public)
- Type = arrow.type.Int64Type
- end
-
methods
function obj = Int64Array(data, varargin)
obj@arrow.array.NumericArray(data, "int64", ...
diff --git a/matlab/src/matlab/+arrow/+array/Int8Array.m b/matlab/src/matlab/+arrow/+array/Int8Array.m
index f9774f6527..83a14caa27 100644
--- a/matlab/src/matlab/+arrow/+array/Int8Array.m
+++ b/matlab/src/matlab/+arrow/+array/Int8Array.m
@@ -20,10 +20,6 @@ classdef Int8Array < arrow.array.NumericArray
NullSubstitutionValue = int8(0);
end
- properties(SetAccess=private, GetAccess=public)
- Type = arrow.type.Int8Type
- end
-
methods
function obj = Int8Array(data, varargin)
obj@arrow.array.NumericArray(data, "int8", ...
diff --git a/matlab/src/matlab/+arrow/+array/StringArray.m b/matlab/src/matlab/+arrow/+array/StringArray.m
index 9ef3f02525..ec2d53b371 100644
--- a/matlab/src/matlab/+arrow/+array/StringArray.m
+++ b/matlab/src/matlab/+arrow/+array/StringArray.m
@@ -20,10 +20,6 @@ classdef StringArray < arrow.array.Array
NullSubstitionValue = string(missing);
end
- properties(SetAccess=private, GetAccess=public)
- Type = arrow.type.StringType
- end
-
methods
function obj = StringArray(data, opts)
arguments
diff --git a/matlab/src/matlab/+arrow/+array/TimestampArray.m b/matlab/src/matlab/+arrow/+array/TimestampArray.m
index fb4b2fa1bf..0f0da4e821 100644
--- a/matlab/src/matlab/+arrow/+array/TimestampArray.m
+++ b/matlab/src/matlab/+arrow/+array/TimestampArray.m
@@ -20,10 +20,6 @@ classdef TimestampArray < arrow.array.Array
NullSubstitutionValue = NaT;
end
- properties(SetAccess=private, GetAccess=public)
- Type = arrow.type.TimestampType % temporarily default value
- end
-
methods
function obj = TimestampArray(data, opts)
arguments
@@ -39,7 +35,6 @@ classdef TimestampArray < arrow.array.Array
args = struct(MatlabArray=ptime, Valid=validElements, TimeZone=timezone, TimeUnit=string(opts.TimeUnit));
obj@arrow.array.Array("Name", "arrow.array.proxy.TimestampArray", "ConstructorArguments", {args});
- obj.Type = arrow.type.TimestampType(TimeUnit=opts.TimeUnit, TimeZone=timezone);
end
function dates = toMATLAB(obj)
diff --git a/matlab/src/matlab/+arrow/+array/UInt16Array.m b/matlab/src/matlab/+arrow/+array/UInt16Array.m
index 3732df3c76..4862ca20b9 100644
--- a/matlab/src/matlab/+arrow/+array/UInt16Array.m
+++ b/matlab/src/matlab/+arrow/+array/UInt16Array.m
@@ -20,10 +20,6 @@ classdef UInt16Array < arrow.array.NumericArray
NullSubstitutionValue = uint16(0)
end
- properties(SetAccess=private, GetAccess=public)
- Type = arrow.type.UInt16Type
- end
-
methods
function obj = UInt16Array(data, varargin)
obj@arrow.array.NumericArray(data, "uint16", ...
diff --git a/matlab/src/matlab/+arrow/+array/UInt32Array.m b/matlab/src/matlab/+arrow/+array/UInt32Array.m
index 183d4df082..782b001099 100644
--- a/matlab/src/matlab/+arrow/+array/UInt32Array.m
+++ b/matlab/src/matlab/+arrow/+array/UInt32Array.m
@@ -20,10 +20,6 @@ classdef UInt32Array < arrow.array.NumericArray
NullSubstitutionValue = uint32(0)
end
- properties(SetAccess=private, GetAccess=public)
- Type = arrow.type.UInt32Type
- end
-
methods
function obj = UInt32Array(data, varargin)
obj@arrow.array.NumericArray(data, "uint32", ...
diff --git a/matlab/src/matlab/+arrow/+array/UInt64Array.m b/matlab/src/matlab/+arrow/+array/UInt64Array.m
index af828978ce..9e25ce4987 100644
--- a/matlab/src/matlab/+arrow/+array/UInt64Array.m
+++ b/matlab/src/matlab/+arrow/+array/UInt64Array.m
@@ -20,10 +20,6 @@ classdef UInt64Array < arrow.array.NumericArray
NullSubstitutionValue = uint64(0)
end
- properties(SetAccess=private, GetAccess=public)
- Type = arrow.type.UInt64Type
- end
-
methods
function obj = UInt64Array(data, varargin)
obj@arrow.array.NumericArray(data, "uint64", ...
diff --git a/matlab/src/matlab/+arrow/+array/UInt8Array.m b/matlab/src/matlab/+arrow/+array/UInt8Array.m
index b5dc664ea1..8bad2401bd 100644
--- a/matlab/src/matlab/+arrow/+array/UInt8Array.m
+++ b/matlab/src/matlab/+arrow/+array/UInt8Array.m
@@ -20,10 +20,6 @@ classdef UInt8Array < arrow.array.NumericArray
NullSubstitutionValue = uint8(0)
end
- properties(SetAccess=private, GetAccess=public)
- Type = arrow.type.UInt8Type
- end
-
methods
function obj = UInt8Array(data, varargin)
obj@arrow.array.NumericArray(data, "uint8", ...
diff --git a/matlab/test/arrow/type/tFloat64Type.m b/matlab/src/matlab/+arrow/+internal/+proxy/create.m
similarity index 77%
copy from matlab/test/arrow/type/tFloat64Type.m
copy to matlab/src/matlab/+arrow/+internal/+proxy/create.m
index d5ccd8ef25..0ed1476058 100644
--- a/matlab/test/arrow/type/tFloat64Type.m
+++ b/matlab/src/matlab/+arrow/+internal/+proxy/create.m
@@ -13,12 +13,13 @@
% implied. See the License for the specific language governing
% permissions and limitations under the License.
-classdef tFloat64Type < hFixedWidthType
-% Test class for arrow.type.Float64Type
-
- properties
- ArrowType = arrow.type.Float64Type
- TypeID = arrow.type.ID.Float64
- BitWidth = int32(64);
+function proxy = create(name, args)
+%CREATE Creates a proxy object.
+ arguments
+ name(1, 1) string {mustBeNonmissing}
+ end
+ arguments(Repeating)
+ args
end
+ proxy = libmexclass.proxy.Proxy.create(name, args{:});
end
\ No newline at end of file
diff --git a/matlab/src/matlab/+arrow/+type/Int16Type.m b/matlab/src/matlab/+arrow/+internal/+proxy/validate.m
similarity index 64%
copy from matlab/src/matlab/+arrow/+type/Int16Type.m
copy to matlab/src/matlab/+arrow/+internal/+proxy/validate.m
index ce9c61d447..1b2b3649e4 100644
--- a/matlab/src/matlab/+arrow/+type/Int16Type.m
+++ b/matlab/src/matlab/+arrow/+internal/+proxy/validate.m
@@ -13,13 +13,17 @@
% implied. See the License for the specific language governing
% permissions and limitations under the License.
-classdef Int16Type < arrow.type.FixedWidthType
-%INT16TYPE Type class for int8 data.
-
- methods
- function obj = Int16Type()
- obj@arrow.type.FixedWidthType("Name", "arrow.type.proxy.Int16Type", "ConstructorArguments", {})
- end
+function validate(proxy, expectedName)
+%VALIDATE Throws an arrow:matlab:ProxyNameMismatch error if
+% proxy.Name and expectedName are not equal.
+ arguments
+ proxy(1, 1) libmexclass.proxy.Proxy
+ expectedName(1, 1) string
end
-end
+ if proxy.Name ~= expectedName
+ errid = "arrow:proxy:ProxyNameMismatch";
+ msg = "Proxy class name is " + proxyName + ", but expected " + expectedProxyName;
+ error(errid, msg);
+ end
+end
diff --git a/matlab/src/matlab/+arrow/+type/BooleanType.m b/matlab/src/matlab/+arrow/+type/BooleanType.m
index 202d177dee..6afa00e925 100644
--- a/matlab/src/matlab/+arrow/+type/BooleanType.m
+++ b/matlab/src/matlab/+arrow/+type/BooleanType.m
@@ -17,8 +17,12 @@ classdef BooleanType < arrow.type.FixedWidthType
%BOOLEANTYPE Type class for boolean data.
methods
- function obj = BooleanType()
- obj@arrow.type.FixedWidthType("Name", "arrow.type.proxy.BooleanType", "ConstructorArguments", {})
+ function obj = BooleanType(proxy)
+ arguments
+ proxy(1, 1) libmexclass.proxy.Proxy {validate(proxy, "arrow.type.proxy.BooleanType")}
+ end
+ import arrow.internal.proxy.validate
+ obj@arrow.type.FixedWidthType(proxy);
end
end
end
\ No newline at end of file
diff --git a/matlab/src/matlab/+arrow/+type/FixedWidthType.m b/matlab/src/matlab/+arrow/+type/FixedWidthType.m
index dcbb3e69e7..8c9c5b2608 100644
--- a/matlab/src/matlab/+arrow/+type/FixedWidthType.m
+++ b/matlab/src/matlab/+arrow/+type/FixedWidthType.m
@@ -21,8 +21,11 @@ classdef (Abstract) FixedWidthType < arrow.type.Type
end
methods
- function obj = FixedWidthType(varargin)
- obj@arrow.type.Type(varargin{:});
+ function obj = FixedWidthType(proxy)
+ arguments
+ proxy(1, 1) libmexclass.proxy.Proxy
+ end
+ obj@arrow.type.Type(proxy);
end
function width = get.BitWidth(obj)
diff --git a/matlab/src/matlab/+arrow/+type/Float32Type.m b/matlab/src/matlab/+arrow/+type/Float32Type.m
index aec21fe1ce..df5fa1ce84 100644
--- a/matlab/src/matlab/+arrow/+type/Float32Type.m
+++ b/matlab/src/matlab/+arrow/+type/Float32Type.m
@@ -17,8 +17,12 @@ classdef Float32Type < arrow.type.FixedWidthType
%FLOAT32TYPE Type class for float32 data.
methods
- function obj = Float32Type()
- obj@arrow.type.FixedWidthType("Name", "arrow.type.proxy.Float32Type", "ConstructorArguments", {})
+ function obj = Float32Type(proxy)
+ arguments
+ proxy(1, 1) libmexclass.proxy.Proxy {validate(proxy, "arrow.type.proxy.Float32Type")}
+ end
+ import arrow.internal.proxy.validate
+ obj@arrow.type.FixedWidthType(proxy);
end
end
end
\ No newline at end of file
diff --git a/matlab/src/matlab/+arrow/+type/Float64Type.m b/matlab/src/matlab/+arrow/+type/Float64Type.m
index 25c9ff41b6..ba93265ebc 100644
--- a/matlab/src/matlab/+arrow/+type/Float64Type.m
+++ b/matlab/src/matlab/+arrow/+type/Float64Type.m
@@ -17,8 +17,12 @@ classdef Float64Type < arrow.type.FixedWidthType
%FLOAT64Type Type class for float64 data.
methods
- function obj = Float64Type()
- obj@arrow.type.FixedWidthType("Name", "arrow.type.proxy.Float64Type", "ConstructorArguments", {})
+ function obj = Float64Type(proxy)
+ arguments
+ proxy(1, 1) libmexclass.proxy.Proxy {validate(proxy, "arrow.type.proxy.Float64Type")}
+ end
+ import arrow.internal.proxy.validate
+ obj@arrow.type.FixedWidthType(proxy);
end
end
end
\ No newline at end of file
diff --git a/matlab/src/matlab/+arrow/+type/Int16Type.m b/matlab/src/matlab/+arrow/+type/Int16Type.m
index ce9c61d447..c16d3fd5ca 100644
--- a/matlab/src/matlab/+arrow/+type/Int16Type.m
+++ b/matlab/src/matlab/+arrow/+type/Int16Type.m
@@ -17,8 +17,12 @@ classdef Int16Type < arrow.type.FixedWidthType
%INT16TYPE Type class for int8 data.
methods
- function obj = Int16Type()
- obj@arrow.type.FixedWidthType("Name", "arrow.type.proxy.Int16Type", "ConstructorArguments", {})
+ function obj = Int16Type(proxy)
+ arguments
+ proxy(1, 1) libmexclass.proxy.Proxy {validate(proxy, "arrow.type.proxy.Int16Type")}
+ end
+ import arrow.internal.proxy.validate
+ obj@arrow.type.FixedWidthType(proxy);
end
end
end
diff --git a/matlab/src/matlab/+arrow/+type/Int32Type.m b/matlab/src/matlab/+arrow/+type/Int32Type.m
index 260a9d7a37..786697bf11 100644
--- a/matlab/src/matlab/+arrow/+type/Int32Type.m
+++ b/matlab/src/matlab/+arrow/+type/Int32Type.m
@@ -17,8 +17,12 @@ classdef Int32Type < arrow.type.FixedWidthType
%INT32TYPE Type class for int32 data.
methods
- function obj = Int32Type()
- obj@arrow.type.FixedWidthType("Name", "arrow.type.proxy.Int32Type", "ConstructorArguments", {})
+ function obj = Int32Type(proxy)
+ arguments
+ proxy(1, 1) libmexclass.proxy.Proxy {validate(proxy, "arrow.type.proxy.Int32Type")}
+ end
+ import arrow.internal.proxy.validate
+ obj@arrow.type.FixedWidthType(proxy);
end
end
end
diff --git a/matlab/src/matlab/+arrow/+type/Int64Type.m b/matlab/src/matlab/+arrow/+type/Int64Type.m
index 857a84e74c..bf6c71d622 100644
--- a/matlab/src/matlab/+arrow/+type/Int64Type.m
+++ b/matlab/src/matlab/+arrow/+type/Int64Type.m
@@ -17,8 +17,12 @@ classdef Int64Type < arrow.type.FixedWidthType
%INT64TYPE Type class for int64 data.
methods
- function obj = Int64Type()
- obj@arrow.type.FixedWidthType("Name", "arrow.type.proxy.Int64Type", "ConstructorArguments", {})
+ function obj = Int64Type(proxy)
+ arguments
+ proxy(1, 1) libmexclass.proxy.Proxy {validate(proxy, "arrow.type.proxy.Int64Type")}
+ end
+ import arrow.internal.proxy.validate
+ obj@arrow.type.FixedWidthType(proxy);
end
end
end
\ No newline at end of file
diff --git a/matlab/src/matlab/+arrow/+type/Int8Type.m b/matlab/src/matlab/+arrow/+type/Int8Type.m
index 1d066b4b8b..b28785f876 100644
--- a/matlab/src/matlab/+arrow/+type/Int8Type.m
+++ b/matlab/src/matlab/+arrow/+type/Int8Type.m
@@ -17,8 +17,12 @@ classdef Int8Type < arrow.type.FixedWidthType
%INT8TYPE Type class for int8 data.
methods
- function obj = Int8Type()
- obj@arrow.type.FixedWidthType("Name", "arrow.type.proxy.Int8Type", "ConstructorArguments", {})
+ function obj = Int8Type(proxy)
+ arguments
+ proxy(1, 1) libmexclass.proxy.Proxy {validate(proxy, "arrow.type.proxy.Int8Type")}
+ end
+ import arrow.internal.proxy.validate
+ obj@arrow.type.FixedWidthType(proxy);
end
end
end
diff --git a/matlab/src/matlab/+arrow/+type/StringType.m b/matlab/src/matlab/+arrow/+type/StringType.m
index 337c5a9bd6..c269bfa6db 100644
--- a/matlab/src/matlab/+arrow/+type/StringType.m
+++ b/matlab/src/matlab/+arrow/+type/StringType.m
@@ -17,8 +17,12 @@ classdef StringType < arrow.type.Type
%STRINGTYPE Type class for string data.
methods
- function obj = StringType()
- obj@arrow.type.Type("Name", "arrow.type.proxy.StringType", "ConstructorArguments", {});
+ function obj = StringType(proxy)
+ arguments
+ proxy(1, 1) libmexclass.proxy.Proxy {validate(proxy, "arrow.type.proxy.StringType")}
+ end
+ import arrow.internal.proxy.validate
+ obj@arrow.type.Type(proxy);
end
end
end
diff --git a/matlab/src/matlab/+arrow/+type/TimestampType.m b/matlab/src/matlab/+arrow/+type/TimestampType.m
index c7a576968e..a5a376f8bc 100644
--- a/matlab/src/matlab/+arrow/+type/TimestampType.m
+++ b/matlab/src/matlab/+arrow/+type/TimestampType.m
@@ -22,14 +22,12 @@ classdef TimestampType < arrow.type.FixedWidthType
end
methods
- function obj = TimestampType(opts)
- %TIMESTAMPTYPE Construct an instance of this class
+ function obj = TimestampType(proxy)
arguments
- opts.TimeUnit(1, 1) arrow.type.TimeUnit = arrow.type.TimeUnit.Microsecond
- opts.TimeZone(1, 1) string {mustBeNonmissing} = ""
+ proxy(1, 1) libmexclass.proxy.Proxy {validate(proxy, "arrow.type.proxy.TimestampType")}
end
- args = struct(TimeUnit=string(opts.TimeUnit), TimeZone=opts.TimeZone);
- obj@arrow.type.FixedWidthType("Name", "arrow.type.proxy.TimestampType", "ConstructorArguments", {args});
+ import arrow.internal.proxy.validate
+ obj@arrow.type.FixedWidthType(proxy);
end
function unit = get.TimeUnit(obj)
@@ -41,5 +39,4 @@ classdef TimestampType < arrow.type.FixedWidthType
tz = obj.Proxy.timeZone();
end
end
-end
-
+end
\ No newline at end of file
diff --git a/matlab/src/matlab/+arrow/+type/Type.m b/matlab/src/matlab/+arrow/+type/Type.m
index 466f393c7d..c2ae3dbc58 100644
--- a/matlab/src/matlab/+arrow/+type/Type.m
+++ b/matlab/src/matlab/+arrow/+type/Type.m
@@ -26,8 +26,11 @@ classdef (Abstract) Type < matlab.mixin.CustomDisplay
end
methods
- function obj = Type(varargin)
- obj.Proxy = libmexclass.proxy.Proxy(varargin{:});
+ function obj = Type(proxy)
+ arguments
+ proxy(1, 1) libmexclass.proxy.Proxy
+ end
+ obj.Proxy = proxy;
end
function numFields = get.NumFields(obj)
diff --git a/matlab/src/matlab/+arrow/+type/UInt16Type.m b/matlab/src/matlab/+arrow/+type/UInt16Type.m
index 40def5f927..3198b78671 100644
--- a/matlab/src/matlab/+arrow/+type/UInt16Type.m
+++ b/matlab/src/matlab/+arrow/+type/UInt16Type.m
@@ -17,8 +17,12 @@ classdef UInt16Type < arrow.type.FixedWidthType
%UINT16TYPE Type class for uint16 data.
methods
- function obj = UInt16Type()
- obj@arrow.type.FixedWidthType("Name", "arrow.type.proxy.UInt16Type", "ConstructorArguments", {})
+ function obj = UInt16Type(proxy)
+ arguments
+ proxy(1, 1) libmexclass.proxy.Proxy {validate(proxy, "arrow.type.proxy.UInt16Type")}
+ end
+ import arrow.internal.proxy.validate
+ obj@arrow.type.FixedWidthType(proxy);
end
end
end
\ No newline at end of file
diff --git a/matlab/src/matlab/+arrow/+type/UInt32Type.m b/matlab/src/matlab/+arrow/+type/UInt32Type.m
index 5b030884fe..53e60e4e34 100644
--- a/matlab/src/matlab/+arrow/+type/UInt32Type.m
+++ b/matlab/src/matlab/+arrow/+type/UInt32Type.m
@@ -17,8 +17,12 @@ classdef UInt32Type < arrow.type.FixedWidthType
%UINT32TYPE Type class for uint32 data.
methods
- function obj = UInt32Type()
- obj@arrow.type.FixedWidthType("Name", "arrow.type.proxy.UInt32Type", "ConstructorArguments", {})
+ function obj = UInt32Type(proxy)
+ arguments
+ proxy(1, 1) libmexclass.proxy.Proxy {validate(proxy, "arrow.type.proxy.UInt32Type")}
+ end
+ import arrow.internal.proxy.validate
+ obj@arrow.type.FixedWidthType(proxy);
end
end
end
\ No newline at end of file
diff --git a/matlab/src/matlab/+arrow/+type/UInt64Type.m b/matlab/src/matlab/+arrow/+type/UInt64Type.m
index 60f7173bfe..f8512ec594 100644
--- a/matlab/src/matlab/+arrow/+type/UInt64Type.m
+++ b/matlab/src/matlab/+arrow/+type/UInt64Type.m
@@ -17,8 +17,12 @@ classdef UInt64Type < arrow.type.FixedWidthType
%UINT64TYPE Type class for uint64 data.
methods
- function obj = UInt64Type()
- obj@arrow.type.FixedWidthType("Name", "arrow.type.proxy.UInt64Type", "ConstructorArguments", {})
+ function obj = UInt64Type(proxy)
+ arguments
+ proxy(1, 1) libmexclass.proxy.Proxy {validate(proxy, "arrow.type.proxy.UInt64Type")}
+ end
+ import arrow.internal.proxy.validate
+ obj@arrow.type.FixedWidthType(proxy);
end
end
end
\ No newline at end of file
diff --git a/matlab/src/matlab/+arrow/+type/UInt8Type.m b/matlab/src/matlab/+arrow/+type/UInt8Type.m
index e09c7ed711..898426e3a4 100644
--- a/matlab/src/matlab/+arrow/+type/UInt8Type.m
+++ b/matlab/src/matlab/+arrow/+type/UInt8Type.m
@@ -17,8 +17,12 @@ classdef UInt8Type < arrow.type.FixedWidthType
%UINT8TYPE Type class for uint8 data.
methods
- function obj = UInt8Type()
- obj@arrow.type.FixedWidthType("Name", "arrow.type.proxy.UInt8Type", "ConstructorArguments", {})
+ function obj = UInt8Type(proxy)
+ arguments
+ proxy(1, 1) libmexclass.proxy.Proxy {validate(proxy, "arrow.type.proxy.UInt8Type")}
+ end
+ import arrow.internal.proxy.validate
+ obj@arrow.type.FixedWidthType(proxy);
end
end
end
\ No newline at end of file
diff --git a/matlab/test/arrow/type/tInt8Type.m b/matlab/src/matlab/+arrow/+type/boolean.m
similarity index 79%
copy from matlab/test/arrow/type/tInt8Type.m
copy to matlab/src/matlab/+arrow/+type/boolean.m
index 57adf7bd2f..f5331d790e 100644
--- a/matlab/test/arrow/type/tInt8Type.m
+++ b/matlab/src/matlab/+arrow/+type/boolean.m
@@ -12,13 +12,9 @@
% 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.
+function type = boolean()
+%BOOLEAN Creates an arrow.type.BooleanType object
+ proxy = arrow.internal.proxy.create("arrow.type.proxy.BooleanType");
+ type = arrow.type.BooleanType(proxy);
+end
-classdef tInt8Type < hFixedWidthType
-% Test class for arrow.type.Int8Type
-
- properties
- ArrowType = arrow.type.Int8Type
- TypeID = arrow.type.ID.Int8
- BitWidth = int32(8);
- end
-end
\ No newline at end of file
diff --git a/matlab/test/arrow/type/tInt8Type.m b/matlab/src/matlab/+arrow/+type/float32.m
similarity index 79%
copy from matlab/test/arrow/type/tInt8Type.m
copy to matlab/src/matlab/+arrow/+type/float32.m
index 57adf7bd2f..d8c44dfc7f 100644
--- a/matlab/test/arrow/type/tInt8Type.m
+++ b/matlab/src/matlab/+arrow/+type/float32.m
@@ -13,12 +13,8 @@
% implied. See the License for the specific language governing
% permissions and limitations under the License.
-classdef tInt8Type < hFixedWidthType
-% Test class for arrow.type.Int8Type
-
- properties
- ArrowType = arrow.type.Int8Type
- TypeID = arrow.type.ID.Int8
- BitWidth = int32(8);
- end
+function type = float32()
+%FLOAT64 Creates an arrow.type.Float32Type object
+ proxy = arrow.internal.proxy.create("arrow.type.proxy.Float32Type");
+ type = arrow.type.Float32Type(proxy);
end
\ No newline at end of file
diff --git a/matlab/test/arrow/type/tInt8Type.m b/matlab/src/matlab/+arrow/+type/float64.m
similarity index 79%
copy from matlab/test/arrow/type/tInt8Type.m
copy to matlab/src/matlab/+arrow/+type/float64.m
index 57adf7bd2f..ae2fdc44c2 100644
--- a/matlab/test/arrow/type/tInt8Type.m
+++ b/matlab/src/matlab/+arrow/+type/float64.m
@@ -13,12 +13,8 @@
% implied. See the License for the specific language governing
% permissions and limitations under the License.
-classdef tInt8Type < hFixedWidthType
-% Test class for arrow.type.Int8Type
-
- properties
- ArrowType = arrow.type.Int8Type
- TypeID = arrow.type.ID.Int8
- BitWidth = int32(8);
- end
-end
\ No newline at end of file
+function type = float64()
+%FLOAT64 Creates an arrow.type.Float64Type object
+ proxy = arrow.internal.proxy.create("arrow.type.proxy.Float64Type");
+ type = arrow.type.Float64Type(proxy);
+end
diff --git a/matlab/test/arrow/type/tInt8Type.m b/matlab/src/matlab/+arrow/+type/int16.m
similarity index 79%
copy from matlab/test/arrow/type/tInt8Type.m
copy to matlab/src/matlab/+arrow/+type/int16.m
index 57adf7bd2f..49f3bfdaa3 100644
--- a/matlab/test/arrow/type/tInt8Type.m
+++ b/matlab/src/matlab/+arrow/+type/int16.m
@@ -13,12 +13,8 @@
% implied. See the License for the specific language governing
% permissions and limitations under the License.
-classdef tInt8Type < hFixedWidthType
-% Test class for arrow.type.Int8Type
-
- properties
- ArrowType = arrow.type.Int8Type
- TypeID = arrow.type.ID.Int8
- BitWidth = int32(8);
- end
-end
\ No newline at end of file
+function type = int16()
+%INT16 Creates an arrow.type.Int16Type object
+ proxy = arrow.internal.proxy.create("arrow.type.proxy.Int16Type");
+ type = arrow.type.Int16Type(proxy);
+end
diff --git a/matlab/test/arrow/type/tInt8Type.m b/matlab/src/matlab/+arrow/+type/int32.m
similarity index 79%
copy from matlab/test/arrow/type/tInt8Type.m
copy to matlab/src/matlab/+arrow/+type/int32.m
index 57adf7bd2f..80673a6bb5 100644
--- a/matlab/test/arrow/type/tInt8Type.m
+++ b/matlab/src/matlab/+arrow/+type/int32.m
@@ -13,12 +13,8 @@
% implied. See the License for the specific language governing
% permissions and limitations under the License.
-classdef tInt8Type < hFixedWidthType
-% Test class for arrow.type.Int8Type
-
- properties
- ArrowType = arrow.type.Int8Type
- TypeID = arrow.type.ID.Int8
- BitWidth = int32(8);
- end
+function type = int32()
+%INT32 Creates an arrow.type.Int32Type object
+ proxy = arrow.internal.proxy.create("arrow.type.proxy.Int32Type");
+ type = arrow.type.Int32Type(proxy);
end
\ No newline at end of file
diff --git a/matlab/test/arrow/type/tInt8Type.m b/matlab/src/matlab/+arrow/+type/int64.m
similarity index 79%
copy from matlab/test/arrow/type/tInt8Type.m
copy to matlab/src/matlab/+arrow/+type/int64.m
index 57adf7bd2f..7e28fdc48e 100644
--- a/matlab/test/arrow/type/tInt8Type.m
+++ b/matlab/src/matlab/+arrow/+type/int64.m
@@ -13,12 +13,9 @@
% implied. See the License for the specific language governing
% permissions and limitations under the License.
-classdef tInt8Type < hFixedWidthType
-% Test class for arrow.type.Int8Type
+function type = int64()
+%INT64 Creates an arrow.type.Int64Type object
+ proxy = arrow.internal.proxy.create("arrow.type.proxy.Int64Type");
+ type = arrow.type.Int64Type(proxy);
+end
- properties
- ArrowType = arrow.type.Int8Type
- TypeID = arrow.type.ID.Int8
- BitWidth = int32(8);
- end
-end
\ No newline at end of file
diff --git a/matlab/test/arrow/type/tInt8Type.m b/matlab/src/matlab/+arrow/+type/int8.m
similarity index 79%
copy from matlab/test/arrow/type/tInt8Type.m
copy to matlab/src/matlab/+arrow/+type/int8.m
index 57adf7bd2f..d59281cfb3 100644
--- a/matlab/test/arrow/type/tInt8Type.m
+++ b/matlab/src/matlab/+arrow/+type/int8.m
@@ -13,12 +13,8 @@
% implied. See the License for the specific language governing
% permissions and limitations under the License.
-classdef tInt8Type < hFixedWidthType
-% Test class for arrow.type.Int8Type
-
- properties
- ArrowType = arrow.type.Int8Type
- TypeID = arrow.type.ID.Int8
- BitWidth = int32(8);
- end
-end
\ No newline at end of file
+function type = int8()
+%INT8 Creates an arrow.type.Int8Type object
+ proxy = arrow.internal.proxy.create("arrow.type.proxy.Int8Type");
+ type = arrow.type.Int8Type(proxy);
+end
diff --git a/matlab/test/arrow/type/tInt8Type.m b/matlab/src/matlab/+arrow/+type/string.m
similarity index 79%
copy from matlab/test/arrow/type/tInt8Type.m
copy to matlab/src/matlab/+arrow/+type/string.m
index 57adf7bd2f..71329adc7c 100644
--- a/matlab/test/arrow/type/tInt8Type.m
+++ b/matlab/src/matlab/+arrow/+type/string.m
@@ -13,12 +13,9 @@
% implied. See the License for the specific language governing
% permissions and limitations under the License.
-classdef tInt8Type < hFixedWidthType
-% Test class for arrow.type.Int8Type
+function type = string()
+%STRING Creates an arrow.type.StringType object
+ proxy = arrow.internal.proxy.create("arrow.type.proxy.StringType");
+ type = arrow.type.StringType(proxy);
+end
- properties
- ArrowType = arrow.type.Int8Type
- TypeID = arrow.type.ID.Int8
- BitWidth = int32(8);
- end
-end
\ No newline at end of file
diff --git a/matlab/src/matlab/+arrow/+type/BooleanType.m b/matlab/src/matlab/+arrow/+type/timestamp.m
similarity index 63%
copy from matlab/src/matlab/+arrow/+type/BooleanType.m
copy to matlab/src/matlab/+arrow/+type/timestamp.m
index 202d177dee..6ad47eae27 100644
--- a/matlab/src/matlab/+arrow/+type/BooleanType.m
+++ b/matlab/src/matlab/+arrow/+type/timestamp.m
@@ -13,12 +13,13 @@
% implied. See the License for the specific language governing
% permissions and limitations under the License.
-classdef BooleanType < arrow.type.FixedWidthType
-%BOOLEANTYPE Type class for boolean data.
-
- methods
- function obj = BooleanType()
- obj@arrow.type.FixedWidthType("Name", "arrow.type.proxy.BooleanType", "ConstructorArguments", {})
- end
+function type = timestamp(opts)
+%TIMESTAMP Creates an arrow.type.TimestampType object
+ arguments
+ opts.TimeUnit(1, 1) arrow.type.TimeUnit = arrow.type.TimeUnit.Microsecond
+ opts.TimeZone(1, 1) string {mustBeNonmissing} = ""
end
+ args = struct(TimeUnit=string(opts.TimeUnit), TimeZone=opts.TimeZone);
+ proxy = arrow.internal.proxy.create("arrow.type.proxy.TimestampType", args);
+ type = arrow.type.TimestampType(proxy);
end
\ No newline at end of file
diff --git a/matlab/test/arrow/type/tInt8Type.m b/matlab/src/matlab/+arrow/+type/uint16.m
similarity index 79%
copy from matlab/test/arrow/type/tInt8Type.m
copy to matlab/src/matlab/+arrow/+type/uint16.m
index 57adf7bd2f..75032a0253 100644
--- a/matlab/test/arrow/type/tInt8Type.m
+++ b/matlab/src/matlab/+arrow/+type/uint16.m
@@ -13,12 +13,9 @@
% implied. See the License for the specific language governing
% permissions and limitations under the License.
-classdef tInt8Type < hFixedWidthType
-% Test class for arrow.type.Int8Type
+function type = uint16()
+%UINT16 Creates an arrow.type.Int16Type object
+ proxy = arrow.internal.proxy.create("arrow.type.proxy.UInt16Type");
+ type = arrow.type.UInt16Type(proxy);
+end
- properties
- ArrowType = arrow.type.Int8Type
- TypeID = arrow.type.ID.Int8
- BitWidth = int32(8);
- end
-end
\ No newline at end of file
diff --git a/matlab/test/arrow/type/tInt8Type.m b/matlab/src/matlab/+arrow/+type/uint32.m
similarity index 79%
copy from matlab/test/arrow/type/tInt8Type.m
copy to matlab/src/matlab/+arrow/+type/uint32.m
index 57adf7bd2f..79b821605d 100644
--- a/matlab/test/arrow/type/tInt8Type.m
+++ b/matlab/src/matlab/+arrow/+type/uint32.m
@@ -13,12 +13,9 @@
% implied. See the License for the specific language governing
% permissions and limitations under the License.
-classdef tInt8Type < hFixedWidthType
-% Test class for arrow.type.Int8Type
+function type = uint32()
+%UINT32 Creates an arrow.type.UInt32Type object
+ proxy = arrow.internal.proxy.create("arrow.type.proxy.UInt32Type");
+ type = arrow.type.UInt32Type(proxy);
+end
- properties
- ArrowType = arrow.type.Int8Type
- TypeID = arrow.type.ID.Int8
- BitWidth = int32(8);
- end
-end
\ No newline at end of file
diff --git a/matlab/test/arrow/type/tInt8Type.m b/matlab/src/matlab/+arrow/+type/uint64.m
similarity index 79%
copy from matlab/test/arrow/type/tInt8Type.m
copy to matlab/src/matlab/+arrow/+type/uint64.m
index 57adf7bd2f..c0965fc9bd 100644
--- a/matlab/test/arrow/type/tInt8Type.m
+++ b/matlab/src/matlab/+arrow/+type/uint64.m
@@ -13,12 +13,8 @@
% implied. See the License for the specific language governing
% permissions and limitations under the License.
-classdef tInt8Type < hFixedWidthType
-% Test class for arrow.type.Int8Type
-
- properties
- ArrowType = arrow.type.Int8Type
- TypeID = arrow.type.ID.Int8
- BitWidth = int32(8);
- end
-end
\ No newline at end of file
+function type = uint64()
+%UINT64 Creates an arrow.type.UInt64Type object
+ proxy = arrow.internal.proxy.create("arrow.type.proxy.UInt64Type");
+ type = arrow.type.UInt64Type(proxy);
+end
diff --git a/matlab/test/arrow/type/tInt8Type.m b/matlab/src/matlab/+arrow/+type/uint8.m
similarity index 79%
copy from matlab/test/arrow/type/tInt8Type.m
copy to matlab/src/matlab/+arrow/+type/uint8.m
index 57adf7bd2f..b199a3c766 100644
--- a/matlab/test/arrow/type/tInt8Type.m
+++ b/matlab/src/matlab/+arrow/+type/uint8.m
@@ -13,12 +13,9 @@
% implied. See the License for the specific language governing
% permissions and limitations under the License.
-classdef tInt8Type < hFixedWidthType
-% Test class for arrow.type.Int8Type
+function type = uint8()
+%UINT8 Creates an arrow.type.UInt8Type object
+ proxy = arrow.internal.proxy.create("arrow.type.proxy.UInt8Type");
+ type = arrow.type.UInt8Type(proxy);
+end
- properties
- ArrowType = arrow.type.Int8Type
- TypeID = arrow.type.ID.Int8
- BitWidth = int32(8);
- end
-end
\ No newline at end of file
diff --git a/matlab/test/arrow/array/tBooleanArray.m b/matlab/test/arrow/array/tBooleanArray.m
index 00eef2c910..ad6126b77f 100644
--- a/matlab/test/arrow/array/tBooleanArray.m
+++ b/matlab/test/arrow/array/tBooleanArray.m
@@ -22,7 +22,7 @@ classdef tBooleanArray < matlab.unittest.TestCase
MatlabArrayFcn = @logical
MatlabConversionFcn = @logical
NullSubstitutionValue = false
- ArrowType = arrow.type.BooleanType
+ ArrowType = arrow.type.boolean
end
methods(TestClassSetup)
diff --git a/matlab/test/arrow/array/tFloat32Array.m b/matlab/test/arrow/array/tFloat32Array.m
index de7b312d84..e8655c7781 100644
--- a/matlab/test/arrow/array/tFloat32Array.m
+++ b/matlab/test/arrow/array/tFloat32Array.m
@@ -24,7 +24,7 @@ classdef tFloat32Array < hNumericArray
MaxValue = realmax("single")
MinValue = realmin("single")
NullSubstitutionValue = single(NaN)
- ArrowType = arrow.type.Float32Type
+ ArrowType = arrow.type.float32
end
methods(Test)
diff --git a/matlab/test/arrow/array/tFloat64Array.m b/matlab/test/arrow/array/tFloat64Array.m
index b4fb9ec7a0..a01eef7388 100755
--- a/matlab/test/arrow/array/tFloat64Array.m
+++ b/matlab/test/arrow/array/tFloat64Array.m
@@ -24,7 +24,7 @@ classdef tFloat64Array < hNumericArray
MaxValue = realmax("double")
MinValue = realmin("double")
NullSubstitutionValue = NaN
- ArrowType = arrow.type.Float64Type
+ ArrowType = arrow.type.float64
end
methods(Test)
diff --git a/matlab/test/arrow/array/tInt16Array.m b/matlab/test/arrow/array/tInt16Array.m
index 58193e076c..466dfaf9c4 100644
--- a/matlab/test/arrow/array/tInt16Array.m
+++ b/matlab/test/arrow/array/tInt16Array.m
@@ -24,7 +24,7 @@ classdef tInt16Array < hNumericArray
MaxValue = intmax("int16")
MinValue = intmin("int16")
NullSubstitutionValue = int16(0)
- ArrowType = arrow.type.Int16Type
+ ArrowType = arrow.type.int16
end
end
diff --git a/matlab/test/arrow/array/tInt32Array.m b/matlab/test/arrow/array/tInt32Array.m
index 59255c1272..b8334e97cc 100644
--- a/matlab/test/arrow/array/tInt32Array.m
+++ b/matlab/test/arrow/array/tInt32Array.m
@@ -24,6 +24,6 @@ classdef tInt32Array < hNumericArray
MaxValue = intmax("int32")
MinValue = intmin("int32")
NullSubstitutionValue = int32(0)
- ArrowType = arrow.type.Int32Type
+ ArrowType = arrow.type.int32
end
end
diff --git a/matlab/test/arrow/array/tInt64Array.m b/matlab/test/arrow/array/tInt64Array.m
index 289b4fcf3e..a877cb2564 100644
--- a/matlab/test/arrow/array/tInt64Array.m
+++ b/matlab/test/arrow/array/tInt64Array.m
@@ -24,6 +24,6 @@ classdef tInt64Array < hNumericArray
MaxValue = intmax("int64")
MinValue = intmin("int64")
NullSubstitutionValue = int64(0)
- ArrowType = arrow.type.Int64Type
+ ArrowType = arrow.type.int64
end
end
diff --git a/matlab/test/arrow/array/tInt8Array.m b/matlab/test/arrow/array/tInt8Array.m
index 9ae1eb8cc4..dbd6e74ea7 100644
--- a/matlab/test/arrow/array/tInt8Array.m
+++ b/matlab/test/arrow/array/tInt8Array.m
@@ -24,7 +24,7 @@ classdef tInt8Array < hNumericArray
MaxValue = intmax("int8")
MinValue = intmin("int8")
NullSubstitutionValue = int8(0)
- ArrowType = arrow.type.Int8Type
+ ArrowType = arrow.type.int8
end
end
diff --git a/matlab/test/arrow/array/tStringArray.m b/matlab/test/arrow/array/tStringArray.m
index b076c636b1..792d759981 100644
--- a/matlab/test/arrow/array/tStringArray.m
+++ b/matlab/test/arrow/array/tStringArray.m
@@ -22,7 +22,7 @@ classdef tStringArray < matlab.unittest.TestCase
MatlabArrayFcn = @string
MatlabConversionFcn = @string
NullSubstitutionValue = string(missing)
- ArrowType = arrow.type.StringType
+ ArrowType = arrow.type.string
end
methods(TestClassSetup)
diff --git a/matlab/test/arrow/array/tUInt16Array.m b/matlab/test/arrow/array/tUInt16Array.m
index b79a753694..eed53c7882 100644
--- a/matlab/test/arrow/array/tUInt16Array.m
+++ b/matlab/test/arrow/array/tUInt16Array.m
@@ -24,6 +24,6 @@ classdef tUInt16Array < hNumericArray
MaxValue = intmax("uint16")
MinValue = intmin("uint16")
NullSubstitutionValue = uint16(0)
- ArrowType = arrow.type.UInt16Type
+ ArrowType = arrow.type.uint16
end
end
diff --git a/matlab/test/arrow/array/tUInt32Array.m b/matlab/test/arrow/array/tUInt32Array.m
index 157cad9417..b5e1970cbc 100644
--- a/matlab/test/arrow/array/tUInt32Array.m
+++ b/matlab/test/arrow/array/tUInt32Array.m
@@ -24,6 +24,6 @@ classdef tUInt32Array < hNumericArray
MaxValue = intmax("uint32")
MinValue = intmin("uint32")
NullSubstitutionValue = uint32(0)
- ArrowType = arrow.type.UInt32Type
+ ArrowType = arrow.type.uint32
end
end
diff --git a/matlab/test/arrow/array/tUInt64Array.m b/matlab/test/arrow/array/tUInt64Array.m
index 41e479e816..6cd2c9cba6 100644
--- a/matlab/test/arrow/array/tUInt64Array.m
+++ b/matlab/test/arrow/array/tUInt64Array.m
@@ -24,6 +24,6 @@ classdef tUInt64Array < hNumericArray
MaxValue = intmax("uint64")
MinValue = intmin("uint64")
NullSubstitutionValue = uint64(0)
- ArrowType = arrow.type.UInt64Type
+ ArrowType = arrow.type.uint64
end
end
diff --git a/matlab/test/arrow/array/tUInt8Array.m b/matlab/test/arrow/array/tUInt8Array.m
index 4aca2cced1..68365958bc 100644
--- a/matlab/test/arrow/array/tUInt8Array.m
+++ b/matlab/test/arrow/array/tUInt8Array.m
@@ -24,6 +24,6 @@ classdef tUInt8Array < hNumericArray
MaxValue = intmax("uint8")
MinValue = intmin("uint8")
NullSubstitutionValue = uint8(0)
- ArrowType = arrow.type.UInt8Type
+ ArrowType = arrow.type.uint8
end
end
diff --git a/matlab/test/arrow/type/hFixedWidthType.m b/matlab/test/arrow/type/hFixedWidthType.m
index 1f2a5e413d..308ac46011 100644
--- a/matlab/test/arrow/type/hFixedWidthType.m
+++ b/matlab/test/arrow/type/hFixedWidthType.m
@@ -21,9 +21,16 @@ classdef hFixedWidthType < matlab.unittest.TestCase
ArrowType
TypeID
BitWidth
+ ClassName
end
methods(Test)
+ function TestClass(testCase)
+ % Verify ArrowType is an object of the expected class type.
+ name = string(class(testCase.ArrowType));
+ testCase.verifyEqual(name, testCase.ClassName);
+ end
+
function TestTypeID(testCase)
% Verify ID is set to the appropriate arrow.type.ID value.
arrowType = testCase.ArrowType;
diff --git a/matlab/test/arrow/type/tBooleanType.m b/matlab/test/arrow/type/tBooleanType.m
index 900ff3d9b3..94de09a3e5 100644
--- a/matlab/test/arrow/type/tBooleanType.m
+++ b/matlab/test/arrow/type/tBooleanType.m
@@ -17,8 +17,9 @@ classdef tBooleanType < hFixedWidthType
% Test class for arrow.type.BooleanType
properties
- ArrowType = arrow.type.BooleanType
+ ArrowType = arrow.type.boolean
TypeID = arrow.type.ID.Boolean
- BitWidth = int32(1);
+ BitWidth = int32(1)
+ ClassName = "arrow.type.BooleanType"
end
end
\ No newline at end of file
diff --git a/matlab/test/arrow/type/tFloat32Type.m b/matlab/test/arrow/type/tFloat32Type.m
index af407559ee..c54fcfd328 100644
--- a/matlab/test/arrow/type/tFloat32Type.m
+++ b/matlab/test/arrow/type/tFloat32Type.m
@@ -17,8 +17,9 @@ classdef tFloat32Type < hFixedWidthType
% Test class for arrow.type.Float32Type
properties
- ArrowType = arrow.type.Float32Type
+ ArrowType = arrow.type.float32
TypeID = arrow.type.ID.Float32
- BitWidth = int32(32);
+ BitWidth = int32(32)
+ ClassName = "arrow.type.Float32Type"
end
end
\ No newline at end of file
diff --git a/matlab/test/arrow/type/tFloat64Type.m b/matlab/test/arrow/type/tFloat64Type.m
index d5ccd8ef25..6b5648dfc1 100644
--- a/matlab/test/arrow/type/tFloat64Type.m
+++ b/matlab/test/arrow/type/tFloat64Type.m
@@ -17,8 +17,10 @@ classdef tFloat64Type < hFixedWidthType
% Test class for arrow.type.Float64Type
properties
- ArrowType = arrow.type.Float64Type
+ ArrowType = arrow.type.float64
TypeID = arrow.type.ID.Float64
- BitWidth = int32(64);
+ BitWidth = int32(64)
+ ClassName = "arrow.type.Float64Type"
+
end
end
\ No newline at end of file
diff --git a/matlab/test/arrow/type/tInt16Type.m b/matlab/test/arrow/type/tInt16Type.m
index 32e9ff5cb2..a929ba688b 100644
--- a/matlab/test/arrow/type/tInt16Type.m
+++ b/matlab/test/arrow/type/tInt16Type.m
@@ -17,8 +17,9 @@ classdef tInt16Type < hFixedWidthType
% Test class for arrow.type.Int16Type
properties
- ArrowType = arrow.type.Int16Type
+ ArrowType = arrow.type.int16
TypeID = arrow.type.ID.Int16
- BitWidth = int32(16);
+ BitWidth = int32(16)
+ ClassName = "arrow.type.Int16Type"
end
end
\ No newline at end of file
diff --git a/matlab/test/arrow/type/tInt32Type.m b/matlab/test/arrow/type/tInt32Type.m
index 1076ef8026..6d59b5454e 100644
--- a/matlab/test/arrow/type/tInt32Type.m
+++ b/matlab/test/arrow/type/tInt32Type.m
@@ -17,8 +17,9 @@ classdef tInt32Type < hFixedWidthType
% Test class for arrow.type.Int32Type
properties
- ArrowType = arrow.type.Int32Type
+ ArrowType = arrow.type.int32
TypeID = arrow.type.ID.Int32
- BitWidth = int32(32);
+ BitWidth = int32(32)
+ ClassName = "arrow.type.Int32Type"
end
end
\ No newline at end of file
diff --git a/matlab/test/arrow/type/tInt64Type.m b/matlab/test/arrow/type/tInt64Type.m
index 24b94c4c04..6ff0d2b07c 100644
--- a/matlab/test/arrow/type/tInt64Type.m
+++ b/matlab/test/arrow/type/tInt64Type.m
@@ -17,8 +17,9 @@ classdef tInt64Type < hFixedWidthType
% Test class for arrow.type.Int64Type
properties
- ArrowType = arrow.type.Int64Type
+ ArrowType = arrow.type.int64
TypeID = arrow.type.ID.Int64
- BitWidth = int32(64);
+ BitWidth = int32(64)
+ ClassName = "arrow.type.Int64Type"
end
end
\ No newline at end of file
diff --git a/matlab/test/arrow/type/tInt8Type.m b/matlab/test/arrow/type/tInt8Type.m
index 57adf7bd2f..396be3a3f7 100644
--- a/matlab/test/arrow/type/tInt8Type.m
+++ b/matlab/test/arrow/type/tInt8Type.m
@@ -17,8 +17,9 @@ classdef tInt8Type < hFixedWidthType
% Test class for arrow.type.Int8Type
properties
- ArrowType = arrow.type.Int8Type
+ ArrowType = arrow.type.int8
TypeID = arrow.type.ID.Int8
- BitWidth = int32(8);
+ BitWidth = int32(8)
+ ClassName = "arrow.type.Int8Type"
end
end
\ No newline at end of file
diff --git a/matlab/test/arrow/type/tStringType.m b/matlab/test/arrow/type/tStringType.m
index a4a0309218..057ffd5426 100644
--- a/matlab/test/arrow/type/tStringType.m
+++ b/matlab/test/arrow/type/tStringType.m
@@ -19,14 +19,14 @@ classdef tStringType < matlab.unittest.TestCase
methods (Test)
function Basic(tc)
- type = arrow.type.StringType;
+ type = arrow.type.string;
className = string(class(type));
tc.verifyEqual(className, "arrow.type.StringType");
tc.verifyEqual(type.ID, arrow.type.ID.String);
end
function NumFields(tc)
- type = arrow.type.StringType;
+ type = arrow.type.string;
tc.verifyEqual(type.NumFields, int32(0));
end
diff --git a/matlab/test/arrow/type/tTimestampType.m b/matlab/test/arrow/type/tTimestampType.m
index 95b06d7b56..fa893d2d93 100644
--- a/matlab/test/arrow/type/tTimestampType.m
+++ b/matlab/test/arrow/type/tTimestampType.m
@@ -17,15 +17,22 @@ classdef tTimestampType < hFixedWidthType
% Test class for arrow.type.TimestampType
properties
- ArrowType = arrow.type.TimestampType
+ ArrowType = arrow.type.timestamp
TypeID = arrow.type.ID.Timestamp
- BitWidth = int32(64);
+ BitWidth = int32(64)
+ ClassName = "arrow.type.TimestampType"
end
methods(Test)
+ function TestClass(testCase)
+ % Verify ArrowType is an object of the expected class type.
+ name = string(class(testCase.ArrowType));
+ testCase.verifyEqual(name, testCase.ClassName);
+ end
+
function DefaultTimeUnit(testCase)
% Verify the default TimeUnit is Microsecond
- type = arrow.type.TimestampType;
+ type = arrow.type.timestamp;
actualUnit = type.TimeUnit;
expectedUnit = arrow.type.TimeUnit.Microsecond;
testCase.verifyEqual(actualUnit, expectedUnit);
@@ -33,7 +40,7 @@ classdef tTimestampType < hFixedWidthType
function DefaultTimeZone(testCase)
% Verify the default TimeZone is ""
- type = arrow.type.TimestampType;
+ type = arrow.type.timestamp;
actualTimezone = type.TimeZone;
expectedTimezone = "";
testCase.verifyEqual(actualTimezone, expectedTimezone);
@@ -46,7 +53,7 @@ classdef tTimestampType < hFixedWidthType
TimeUnit.Microsecond, TimeUnit.Nanosecond];
for unit = expectedUnit
- type = TimestampType(TimeUnit=unit);
+ type = timestamp(TimeUnit=unit);
testCase.verifyEqual(type.TimeUnit, unit);
end
end
@@ -60,42 +67,42 @@ classdef tTimestampType < hFixedWidthType
TimeUnit.Microsecond, TimeUnit.Nanosecond];
for ii = 1:numel(unitString)
- type = TimestampType(TimeUnit=unitString(ii));
+ type = timestamp(TimeUnit=unitString(ii));
testCase.verifyEqual(type.TimeUnit, expectedUnit(ii));
end
end
function SupplyTimeZone(testCase)
% Supply the TimeZone.
- type = arrow.type.TimestampType(TimeZone="America/New_York");
+ type = arrow.type.timestamp(TimeZone="America/New_York");
testCase.verifyEqual(type.TimeZone, "America/New_York");
end
function ErrorIfMissingStringTimeZone(testCase)
- fcn = @() arrow.type.TimestampType(TimeZone=string(missing));
+ fcn = @() arrow.type.timestamp(TimeZone=string(missing));
testCase.verifyError(fcn, "MATLAB:validators:mustBeNonmissing");
end
function ErrorIfTimeZoneIsNonScalar(testCase)
- fcn = @() arrow.type.TimestampType(TimeZone=["a", "b"]);
+ fcn = @() arrow.type.timestamp(TimeZone=["a", "b"]);
testCase.verifyError(fcn, "MATLAB:validation:IncompatibleSize");
- fcn = @() arrow.type.TimestampType(TimeZone=strings(0, 0));
+ fcn = @() arrow.type.timestamp(TimeZone=strings(0, 0));
testCase.verifyError(fcn, "MATLAB:validation:IncompatibleSize");
end
function ErrorIfAmbiguousTimeUnit(testCase)
- fcn = @() arrow.type.TimestampType(TimeUnit="mi");
+ fcn = @() arrow.type.timestamp(TimeUnit="mi");
testCase.verifyError(fcn, "MATLAB:validation:UnableToConvert");
end
function ErrorIfTimeUnitIsNonScalar(testCase)
units = [arrow.type.TimeUnit.Second; arrow.type.TimeUnit.Millisecond];
- fcn = @() arrow.type.TimestampType(TimeZone=units);
+ fcn = @() arrow.type.timestamp(TimeZone=units);
testCase.verifyError(fcn, "MATLAB:validation:IncompatibleSize");
units = ["second" "millisecond"];
- fcn = @() arrow.type.TimestampType(TimeZone=units);
+ fcn = @() arrow.type.timestamp(TimeZone=units);
testCase.verifyError(fcn, "MATLAB:validation:IncompatibleSize");
end
end
diff --git a/matlab/test/arrow/type/tUInt16Type.m b/matlab/test/arrow/type/tUInt16Type.m
index c0823b4f69..ede66f6324 100644
--- a/matlab/test/arrow/type/tUInt16Type.m
+++ b/matlab/test/arrow/type/tUInt16Type.m
@@ -17,8 +17,9 @@ classdef tUInt16Type < hFixedWidthType
% Test class for arrow.type.UInt16Type
properties
- ArrowType = arrow.type.UInt16Type
+ ArrowType = arrow.type.uint16
TypeID = arrow.type.ID.UInt16
- BitWidth = int32(16);
+ BitWidth = int32(16)
+ ClassName = "arrow.type.UInt16Type"
end
end
\ No newline at end of file
diff --git a/matlab/test/arrow/type/tUInt32Type.m b/matlab/test/arrow/type/tUInt32Type.m
index 15fe93106e..def24c76ce 100644
--- a/matlab/test/arrow/type/tUInt32Type.m
+++ b/matlab/test/arrow/type/tUInt32Type.m
@@ -17,8 +17,9 @@ classdef tUInt32Type < hFixedWidthType
% Test class for arrow.type.UInt32Type
properties
- ArrowType = arrow.type.UInt32Type
+ ArrowType = arrow.type.uint32
TypeID = arrow.type.ID.UInt32
- BitWidth = int32(32);
+ BitWidth = int32(32)
+ ClassName = "arrow.type.UInt32Type"
end
end
\ No newline at end of file
diff --git a/matlab/test/arrow/type/tUInt64Type.m b/matlab/test/arrow/type/tUInt64Type.m
index 4646c91455..9228e1cc50 100644
--- a/matlab/test/arrow/type/tUInt64Type.m
+++ b/matlab/test/arrow/type/tUInt64Type.m
@@ -17,8 +17,9 @@ classdef tUInt64Type < hFixedWidthType
% Test class for arrow.type.UInt64Type
properties
- ArrowType = arrow.type.UInt64Type
+ ArrowType = arrow.type.uint64
TypeID = arrow.type.ID.UInt64
- BitWidth = int32(64);
+ BitWidth = int32(64)
+ ClassName = "arrow.type.UInt64Type"
end
end
\ No newline at end of file
diff --git a/matlab/test/arrow/type/tUInt8Type.m b/matlab/test/arrow/type/tUInt8Type.m
index ebd6b04b0e..eec3aa5fde 100644
--- a/matlab/test/arrow/type/tUInt8Type.m
+++ b/matlab/test/arrow/type/tUInt8Type.m
@@ -17,8 +17,9 @@ classdef tUInt8Type < hFixedWidthType
% Test class for arrow.type.UInt64Type
properties
- ArrowType = arrow.type.UInt8Type
+ ArrowType = arrow.type.uint8
TypeID = arrow.type.ID.UInt8
- BitWidth = int32(8);
+ BitWidth = int32(8)
+ ClassName = "arrow.type.UInt8Type"
end
end
\ No newline at end of file
diff --git a/matlab/tools/cmake/BuildMatlabArrowInterface.cmake b/matlab/tools/cmake/BuildMatlabArrowInterface.cmake
index 41d2ee4a70..253632d221 100644
--- a/matlab/tools/cmake/BuildMatlabArrowInterface.cmake
+++ b/matlab/tools/cmake/BuildMatlabArrowInterface.cmake
@@ -24,7 +24,7 @@ set(MATLAB_ARROW_LIBMEXCLASS_CLIENT_FETCH_CONTENT_NAME libmexclass)
# libmexclass is accessible for CI without permission issues.
set(MATLAB_ARROW_LIBMEXCLASS_CLIENT_FETCH_CONTENT_GIT_REPOSITORY "https://github.com/mathworks/libmexclass.git")
# Use a specific Git commit hash to avoid libmexclass version changing unexpectedly.
-set(MATLAB_ARROW_LIBMEXCLASS_CLIENT_FETCH_CONTENT_GIT_TAG "3465900")
+set(MATLAB_ARROW_LIBMEXCLASS_CLIENT_FETCH_CONTENT_GIT_TAG "d04f88d")
set(MATLAB_ARROW_LIBMEXCLASS_CLIENT_FETCH_CONTENT_SOURCE_SUBDIR "libmexclass/cpp")