Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
end

2 changes: 1 addition & 1 deletion matlab/src/matlab/+arrow/+array/ChunkedArray.m
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
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);
Expand Down
8 changes: 4 additions & 4 deletions matlab/src/matlab/+arrow/+array/StructArray.m
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@

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
Expand All @@ -135,7 +135,7 @@
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";
Expand All @@ -152,7 +152,7 @@

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
Expand All @@ -166,7 +166,7 @@
validateColumnNames(opts.FieldNames, width(T));

arrowArrays = decompose(T);
arrayProxyIDs = getArrayProxyIDs(arrowArrays);
arrayProxyIDs = getProxyIDs(arrowArrays);
validElements = parseValid(opts, height(T));

args = struct(ArrayProxyIDs=arrayProxyIDs, ...
Expand Down
4 changes: 2 additions & 2 deletions matlab/src/matlab/+arrow/+tabular/RecordBatch.m
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ function export(obj, cArrowArrayAddress, cArrowSchemaAddress)

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);
Expand Down
7 changes: 3 additions & 4 deletions matlab/src/matlab/+arrow/+tabular/Table.m
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@

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);
Expand Down Expand Up @@ -83,8 +83,7 @@
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);
Expand Down
2 changes: 1 addition & 1 deletion matlab/src/matlab/+arrow/recordBatch.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
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);
Expand Down
Loading