1 function [variables, metadata] = createVariablesAndMetadataStructs()
2 % CREATEVARIABLESANDMETADATASTRUCTS Helper function for creating
3 % Feather MEX variables and metadata structs.
5 % Licensed to the Apache Software Foundation (ASF) under one or more
6 % contributor license agreements. See the NOTICE file distributed with
7 % this work for additional information regarding copyright ownership.
8 % The ASF licenses this file to you under the Apache License, Version
9 % 2.0 (the "License"); you may not use this file except in compliance
10 % with the License. You may obtain a copy of the License at
12 % http://www.apache.org/licenses/LICENSE-2.0
14 % Unless required by applicable law or agreed to in writing, software
15 % distributed under the License is distributed on an "AS IS" BASIS,
16 % WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
17 % implied. See the License for the specific language governing
18 % permissions and limitations under the License.
20 import mlarrow.util.*;
23 data = uint8([1; 2; 3]);
24 valid = logical([0; 1; 0]);
26 uint8Variable = createVariableStruct(type, data, valid, name);
29 data = uint16([1; 2; 3]);
30 valid = logical([0; 1; 0]);
32 uint16Variable = createVariableStruct(type, data, valid, name);
35 data = uint32([1; 2; 3]);
36 valid = logical([0; 1; 0]);
38 uint32Variable = createVariableStruct(type, data, valid, name);
41 data = uint64([1; 2; 3]);
42 valid = logical([0; 1; 0]);
44 uint64Variable = createVariableStruct(type, data, valid, name);
47 data = int8([1; 2; 3]);
48 valid = logical([0; 1; 0]);
50 int8Variable = createVariableStruct(type, data, valid, name);
53 data = int16([1; 2; 3]);
54 valid = logical([0; 1; 0]);
56 int16Variable = createVariableStruct(type, data, valid, name);
59 data = int32([1; 2; 3]);
60 valid = logical([0; 1; 0]);
62 int32Variable = createVariableStruct(type, data, valid, name);
65 data = int64([1; 2; 3]);
66 valid = logical([0; 1; 0]);
68 int64Variable = createVariableStruct(type, data, valid, name);
71 data = single([1; 2; 3]);
72 valid = logical([0; 1; 0]);
74 singleVariable = createVariableStruct(type, data, valid, name);
77 data = double([1; 2; 3]);
78 valid = logical([0; 1; 0]);
80 doubleVariable = createVariableStruct(type, data, valid, name);
82 variables = [uint8Variable, ...
94 numVariables = length(variables);
96 metadata = createMetadataStruct(numRows, numVariables);