Skip to content

Commit 273ed77

Browse files
committed
Add RecordBatchImporter MATLAB Class
1 parent 08b24b0 commit 273ed77

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
%RECORDBATCHIMPORTER Imports Arrow RecordBatch using the C Data Interface
2+
% Format.
3+
4+
% Licensed to the Apache Software Foundation (ASF) under one or more
5+
% contributor license agreements. See the NOTICE file distributed with
6+
% this work for additional information regarding copyright ownership.
7+
% The ASF licenses this file to you under the Apache License, Version
8+
% 2.0 (the "License"); you may not use this file except in compliance
9+
% with the License. You may obtain a copy of the License at
10+
%
11+
% http://www.apache.org/licenses/LICENSE-2.0
12+
%
13+
% Unless required by applicable law or agreed to in writing, software
14+
% distributed under the License is distributed on an "AS IS" BASIS,
15+
% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
16+
% implied. See the License for the specific language governing
17+
% permissions and limitations under the License.
18+
19+
classdef RecordBatchImporter
20+
21+
properties (Hidden, SetAccess=private, GetAccess=public)
22+
Proxy
23+
end
24+
25+
methods
26+
27+
function obj = RecordBatchImporter()
28+
proxyName = "arrow.c.proxy.RecordBatchImporter";
29+
proxy = arrow.internal.proxy.create(proxyName, struct());
30+
obj.Proxy = proxy;
31+
end
32+
33+
function recordBatch = import(obj, cArray, cSchema)
34+
arguments
35+
obj(1, 1) arrow.c.internal.RecordBatchImporter
36+
cArray(1, 1) arrow.c.Array
37+
cSchema(1, 1) arrow.c.Schema
38+
end
39+
args = struct(...
40+
ArrowArrayAddress=cArray.Address,...
41+
ArrowSchemaAddress=cSchema.Address...
42+
);
43+
proxyID = obj.Proxy.import(args);
44+
proxyName = "arrow.tabular.proxy.RecordBatch";
45+
proxy = libmexclass.proxy.Proxy(Name=proxyName, ID=proxyID);
46+
recordBatch = arrow.tabular.RecordBatch(proxy);
47+
end
48+
49+
end
50+
51+
end
52+

0 commit comments

Comments
 (0)