Skip to content

[MATLAB] Support creating arrow.tabular.RecordBatch instances from a list of arrow.array.Array values #37175

Closed
@sgilmore10

Description

@sgilmore10

Describe the enhancement requested

Right now, the only way to construct an arrow.tabular.RecordBatch is from a MATLAB table:

>> t = table([1; 2; 3], ["A"; "B"; "C"], VariableNames=["Numbers", "Letters"]);

t =

  3×2 table

    Numbers    Letters
    _______    _______

       1         "A"  
       2         "B"  
       3         "C"  

>> rb = arrow.recordbatch(t)

rb = 

Numbers:   [
    1,
    2,
    3
  ]
Letters:   [
    "A",
    "B",
    "C"
  ]

The interface should also support creating arrow.tabular.RecordBatch instances from lists of arrow.array.Array values. To do this, we should add a static function called fromArrays to arrow.tabular.RecordBatch:

>> a1 = arrow.array([1; 2; 3]);
>> a2 =  arrow.array(["A"; "B"; "C"]);
>> rb = arrow.tabular.RecordBatch.fromArrays(a2, a2, ColumnNames=["Numbers", "Letters"])

rb = 

Numbers:   [
    "A",
    "B",
    "C"
  ]
Letters:   [
    "A",
    "B",
    "C"
  ]

Component(s)

MATLAB

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions