This is an automated email from the ASF dual-hosted git repository.
kou 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 0c49503f0a GH-48755: [MATLAB] Rename getArrayProxyIDs to getProxyIDs
(#48756)
0c49503f0a is described below
commit 0c49503f0a0bfc71ddd13d81f753b1b422ef7ab6
Author: Hyukjin Kwon <[email protected]>
AuthorDate: Fri Jan 9 10:07:48 2026 +0900
GH-48755: [MATLAB] Rename getArrayProxyIDs to getProxyIDs (#48756)
### Rationale for this change
The internal helper function `getArrayProxyIDs` was misleadingly named
since it works with both Arrays and RecordBatches, not just arrays.
### What changes are included in this PR?
- Renamed `getArrayProxyIDs.m` to `getProxyIDs.m`
- Updated all call sites
- Removed TODO comment requesting this change
### Are these changes tested?
Existing tests cover functionality.
### Are there any user-facing changes?
No, dev-only.
* GitHub Issue: #48755
Authored-by: Hyukjin Kwon <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
---
.../+internal/{getArrayProxyIDs.m => getProxyIDs.m} | 18 +++++++++---------
matlab/src/matlab/+arrow/+array/ChunkedArray.m | 2 +-
matlab/src/matlab/+arrow/+array/StructArray.m | 8 ++++----
matlab/src/matlab/+arrow/+tabular/RecordBatch.m | 4 ++--
matlab/src/matlab/+arrow/+tabular/Table.m | 7 +++----
matlab/src/matlab/+arrow/recordBatch.m | 2 +-
6 files changed, 20 insertions(+), 21 deletions(-)
diff --git a/matlab/src/matlab/+arrow/+array/+internal/getArrayProxyIDs.m
b/matlab/src/matlab/+arrow/+array/+internal/getProxyIDs.m
similarity index 68%
rename from matlab/src/matlab/+arrow/+array/+internal/getArrayProxyIDs.m
rename to matlab/src/matlab/+arrow/+array/+internal/getProxyIDs.m
index 8a1f881589..332b1290e7 100644
--- a/matlab/src/matlab/+arrow/+array/+internal/getArrayProxyIDs.m
+++ b/matlab/src/matlab/+arrow/+array/+internal/getProxyIDs.m
@@ -1,5 +1,5 @@
-%GETARRAYPROXYIDS Extract the Proxy IDs underlying a cell array of
-% arrow.array.Array instances.
+%GETPROXYIDS Extract the Proxy IDs underlying a cell array of
+% arrow.array.Array or arrow.tabular.RecordBatch instances.
% Licensed to the Apache Software Foundation (ASF) under one or more
% contributor license agreements. See the NOTICE file distributed with
@@ -15,12 +15,12 @@
% 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 proxyIDs = getArrayProxyIDs(arrowArrays)
- proxyIDs = zeros(1, numel(arrowArrays), "uint64");
+function proxyIDs = getProxyIDs(objects)
+ proxyIDs = zeros(1, numel(objects), "uint64");
- % Convert each MATLAB array into a corresponding
- % arrow.array.Array.
- for ii = 1:numel(arrowArrays)
- proxyIDs(ii) = arrowArrays{ii}.Proxy.ID;
+ % Extract the Proxy.ID from each object
+ for ii = 1:numel(objects)
+ proxyIDs(ii) = objects{ii}.Proxy.ID;
end
-end
\ No newline at end of file
+end
+
diff --git a/matlab/src/matlab/+arrow/+array/ChunkedArray.m
b/matlab/src/matlab/+arrow/+array/ChunkedArray.m
index b1d07d76bb..e51b1a9245 100644
--- a/matlab/src/matlab/+arrow/+array/ChunkedArray.m
+++ b/matlab/src/matlab/+arrow/+array/ChunkedArray.m
@@ -121,7 +121,7 @@ classdef ChunkedArray < matlab.mixin.CustomDisplay & ...
type = arrays{1}.Type;
end
- proxyIDs = arrow.array.internal.getArrayProxyIDs(arrays);
+ proxyIDs = arrow.array.internal.getProxyIDs(arrays);
args = struct(ArrayProxyIDs=proxyIDs, TypeProxyID=type.Proxy.ID);
proxyName = "arrow.array.proxy.ChunkedArray";
proxy = arrow.internal.proxy.create(proxyName, args);
diff --git a/matlab/src/matlab/+arrow/+array/StructArray.m
b/matlab/src/matlab/+arrow/+array/StructArray.m
index 70b2c16a96..7a79c11f04 100644
--- a/matlab/src/matlab/+arrow/+array/StructArray.m
+++ b/matlab/src/matlab/+arrow/+array/StructArray.m
@@ -123,7 +123,7 @@ classdef StructArray < arrow.array.Array
import arrow.tabular.internal.validateArrayLengths
import arrow.tabular.internal.validateColumnNames
- import arrow.array.internal.getArrayProxyIDs
+ import arrow.array.internal.getProxyIDs
import arrow.internal.validate.parseValid
if numel(arrowArrays) == 0
@@ -135,7 +135,7 @@ classdef StructArray < arrow.array.Array
validateColumnNames(opts.FieldNames, numel(arrowArrays));
validElements = parseValid(opts, arrowArrays{1}.NumElements);
- arrayProxyIDs = getArrayProxyIDs(arrowArrays);
+ arrayProxyIDs = getProxyIDs(arrowArrays);
args = struct(ArrayProxyIDs=arrayProxyIDs, ...
FieldNames=opts.FieldNames, Valid=validElements);
proxyName = "arrow.array.proxy.StructArray";
@@ -152,7 +152,7 @@ classdef StructArray < arrow.array.Array
import arrow.tabular.internal.decompose
import arrow.tabular.internal.validateColumnNames
- import arrow.array.internal.getArrayProxyIDs
+ import arrow.array.internal.getProxyIDs
import arrow.internal.validate.parseValid
if width(T) == 0
@@ -166,7 +166,7 @@ classdef StructArray < arrow.array.Array
validateColumnNames(opts.FieldNames, width(T));
arrowArrays = decompose(T);
- arrayProxyIDs = getArrayProxyIDs(arrowArrays);
+ arrayProxyIDs = getProxyIDs(arrowArrays);
validElements = parseValid(opts, height(T));
args = struct(ArrayProxyIDs=arrayProxyIDs, ...
diff --git a/matlab/src/matlab/+arrow/+tabular/RecordBatch.m
b/matlab/src/matlab/+arrow/+tabular/RecordBatch.m
index 6210a48f90..c263aa9ac0 100644
--- a/matlab/src/matlab/+arrow/+tabular/RecordBatch.m
+++ b/matlab/src/matlab/+arrow/+tabular/RecordBatch.m
@@ -65,13 +65,13 @@ classdef RecordBatch < arrow.tabular.Tabular
import arrow.tabular.internal.validateArrayLengths
import arrow.tabular.internal.validateColumnNames
- import arrow.array.internal.getArrayProxyIDs
+ import arrow.array.internal.getProxyIDs
numColumns = numel(arrowArrays);
validateArrayLengths(arrowArrays);
validateColumnNames(opts.ColumnNames, numColumns);
- arrayProxyIDs = getArrayProxyIDs(arrowArrays);
+ arrayProxyIDs = getProxyIDs(arrowArrays);
args = struct(ArrayProxyIDs=arrayProxyIDs,
ColumnNames=opts.ColumnNames);
proxyName = "arrow.tabular.proxy.RecordBatch";
proxy = arrow.internal.proxy.create(proxyName, args);
diff --git a/matlab/src/matlab/+arrow/+tabular/Table.m
b/matlab/src/matlab/+arrow/+tabular/Table.m
index f574c8c3af..c2d4bbd265 100644
--- a/matlab/src/matlab/+arrow/+tabular/Table.m
+++ b/matlab/src/matlab/+arrow/+tabular/Table.m
@@ -47,13 +47,13 @@ classdef Table < arrow.tabular.Tabular
import arrow.tabular.internal.validateArrayLengths
import arrow.tabular.internal.validateColumnNames
- import arrow.array.internal.getArrayProxyIDs
+ import arrow.array.internal.getProxyIDs
numColumns = numel(arrowArrays);
validateArrayLengths(arrowArrays);
validateColumnNames(opts.ColumnNames, numColumns);
- arrayProxyIDs = getArrayProxyIDs(arrowArrays);
+ arrayProxyIDs = getProxyIDs(arrowArrays);
args = struct(Method="from_arrays", ArrayProxyIDs=arrayProxyIDs,
ColumnNames=opts.ColumnNames);
proxyName = "arrow.tabular.proxy.Table";
proxy = arrow.internal.proxy.create(proxyName, args);
@@ -83,8 +83,7 @@ classdef Table < arrow.tabular.Tabular
end
end
- % TODO: Rename getArrayProxyIDs to getProxyIDs
- proxyIDs = arrow.array.internal.getArrayProxyIDs(batches);
+ proxyIDs = arrow.array.internal.getProxyIDs(batches);
args = struct(Method="from_record_batches",
RecordBatchProxyIDs=proxyIDs);
proxyName = "arrow.tabular.proxy.Table";
proxy = arrow.internal.proxy.create(proxyName, args);
diff --git a/matlab/src/matlab/+arrow/recordBatch.m
b/matlab/src/matlab/+arrow/recordBatch.m
index c86c5b79e1..0cf53b856a 100644
--- a/matlab/src/matlab/+arrow/recordBatch.m
+++ b/matlab/src/matlab/+arrow/recordBatch.m
@@ -20,7 +20,7 @@ function rb = recordBatch(T)
end
arrowArrays = arrow.tabular.internal.decompose(T);
- arrayProxyIDs = arrow.array.internal.getArrayProxyIDs(arrowArrays);
+ arrayProxyIDs = arrow.array.internal.getProxyIDs(arrowArrays);
columnNames = string(T.Properties.VariableNames);
args = struct(ArrayProxyIDs=arrayProxyIDs, ColumnNames=columnNames);