diff --git a/matlab/README.md b/matlab/README.md index a070984a9e38f..e0acb8b748b6d 100644 --- a/matlab/README.md +++ b/matlab/README.md @@ -225,7 +225,7 @@ matlabTable = "B" 2 false "C" 3 true ->> arrowRecordBatch = arrow.recordbatch(matlabTable) +>> arrowRecordBatch = arrow.recordBatch(matlabTable) arrowRecordBatch = @@ -557,7 +557,7 @@ matlabTable = "B" 2 "C" 3 ->> arrowRecordBatch = arrow.recordbatch(matlabTable) +>> arrowRecordBatch = arrow.recordBatch(matlabTable) arrowRecordBatch = diff --git a/matlab/src/matlab/+arrow/recordbatch.m b/matlab/src/matlab/+arrow/recordBatch.m similarity index 97% rename from matlab/src/matlab/+arrow/recordbatch.m rename to matlab/src/matlab/+arrow/recordBatch.m index 1fb25347f1a7d..662db9cca940c 100644 --- a/matlab/src/matlab/+arrow/recordbatch.m +++ b/matlab/src/matlab/+arrow/recordBatch.m @@ -14,7 +14,7 @@ % 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 rb = recordbatch(T) +function rb = recordBatch(T) arguments T table end diff --git a/matlab/src/matlab/featherwrite.m b/matlab/src/matlab/featherwrite.m index 879edd8afc68e..27fa5dfbb3898 100644 --- a/matlab/src/matlab/featherwrite.m +++ b/matlab/src/matlab/featherwrite.m @@ -28,7 +28,7 @@ function featherwrite(filename, t) t table end - recordBatch = arrow.recordbatch(t); + recordBatch = arrow.recordBatch(t); writer = arrow.internal.io.feather.Writer(filename); writer.write(recordBatch); end diff --git a/matlab/test/arrow/io/feather/tRoundTrip.m b/matlab/test/arrow/io/feather/tRoundTrip.m index d33111fb931b2..6fa88d155d9e8 100644 --- a/matlab/test/arrow/io/feather/tRoundTrip.m +++ b/matlab/test/arrow/io/feather/tRoundTrip.m @@ -28,7 +28,7 @@ function Basic(testCase) SingleVar = single([10; 15; 20; 25]); tableWrite = table(DoubleVar, SingleVar); - recordBatchWrite = arrow.recordbatch(tableWrite); + recordBatchWrite = arrow.recordBatch(tableWrite); writer = Writer(filename); writer.write(recordBatchWrite); diff --git a/matlab/test/arrow/tabular/tRecordBatch.m b/matlab/test/arrow/tabular/tRecordBatch.m index 66461b29c1dd6..027195d3d8250 100644 --- a/matlab/test/arrow/tabular/tRecordBatch.m +++ b/matlab/test/arrow/tabular/tRecordBatch.m @@ -20,7 +20,7 @@ function Basic(tc) T = table([1, 2, 3]'); - arrowRecordBatch = arrow.recordbatch(T); + arrowRecordBatch = arrow.recordBatch(T); className = string(class(arrowRecordBatch)); tc.verifyEqual(className, "arrow.tabular.RecordBatch"); end @@ -30,21 +30,21 @@ function SupportedTypes(tc) import arrow.internal.test.tabular.createTableWithSupportedTypes TOriginal = createTableWithSupportedTypes(); - arrowRecordBatch = arrow.recordbatch(TOriginal); + arrowRecordBatch = arrow.recordBatch(TOriginal); expectedColumnNames = string(TOriginal.Properties.VariableNames); tc.verifyRecordBatch(arrowRecordBatch, expectedColumnNames, TOriginal); end function ToMATLAB(tc) TOriginal = table([1, 2, 3]'); - arrowRecordBatch = arrow.recordbatch(TOriginal); + arrowRecordBatch = arrow.recordBatch(TOriginal); TConverted = arrowRecordBatch.toMATLAB(); tc.verifyEqual(TOriginal, TConverted); end function Table(tc) TOriginal = table([1, 2, 3]'); - arrowRecordBatch = arrow.recordbatch(TOriginal); + arrowRecordBatch = arrow.recordBatch(TOriginal); TConverted = table(arrowRecordBatch); tc.verifyEqual(TOriginal, TConverted); end @@ -52,7 +52,7 @@ function Table(tc) function ColumnNames(tc) columnNames = ["A", "B", "C"]; TOriginal = table(1, 2, 3, VariableNames=columnNames); - arrowRecordBatch = arrow.recordbatch(TOriginal); + arrowRecordBatch = arrow.recordBatch(TOriginal); tc.verifyEqual(arrowRecordBatch.ColumnNames, columnNames); end @@ -61,7 +61,7 @@ function NumColumns(tc) for nc = numColumns T = array2table(ones(1, nc)); - arrowRecordBatch = arrow.recordbatch(T); + arrowRecordBatch = arrow.recordBatch(T); tc.verifyEqual(arrowRecordBatch.NumColumns, nc); end end @@ -72,7 +72,7 @@ function UnicodeColumnNames(tc) mango = "🥭"; columnNames = [smiley, tree, mango]; TOriginal = table(1, 2, 3, VariableNames=columnNames); - arrowRecordBatch = arrow.recordbatch(TOriginal); + arrowRecordBatch = arrow.recordBatch(TOriginal); tc.verifyEqual(arrowRecordBatch.ColumnNames, columnNames); TConverted = arrowRecordBatch.toMATLAB(); tc.verifyEqual(TOriginal, TConverted); @@ -80,42 +80,42 @@ function UnicodeColumnNames(tc) function EmptyTable(tc) TOriginal = table(); - arrowRecordBatch = arrow.recordbatch(TOriginal); + arrowRecordBatch = arrow.recordBatch(TOriginal); TConverted = arrowRecordBatch.toMATLAB(); tc.verifyEqual(TOriginal, TConverted); end function EmptyRecordBatchColumnIndexError(tc) TOriginal = table(); - arrowRecordBatch = arrow.recordbatch(TOriginal); + arrowRecordBatch = arrow.recordBatch(TOriginal); fcn = @() arrowRecordBatch.column(1); tc.verifyError(fcn, "arrow:tabular:recordbatch:NumericIndexWithEmptyRecordBatch"); end function InvalidNumericIndexError(tc) TOriginal = table(1, 2, 3); - arrowRecordBatch = arrow.recordbatch(TOriginal); + arrowRecordBatch = arrow.recordBatch(TOriginal); fcn = @() arrowRecordBatch.column(4); tc.verifyError(fcn, "arrow:tabular:recordbatch:InvalidNumericColumnIndex"); end function UnsupportedColumnIndexType(tc) TOriginal = table(1, 2, 3); - arrowRecordBatch = arrow.recordbatch(TOriginal); + arrowRecordBatch = arrow.recordBatch(TOriginal); fcn = @() arrowRecordBatch.column(datetime(2022, 1, 3)); tc.verifyError(fcn, "arrow:badsubscript:NonNumeric"); end function ErrorIfIndexIsNonScalar(tc) TOriginal = table(1, 2, 3); - arrowRecordBatch = arrow.recordbatch(TOriginal); + arrowRecordBatch = arrow.recordBatch(TOriginal); fcn = @() arrowRecordBatch.column([1 2]); tc.verifyError(fcn, "MATLAB:expectedScalar"); end function ErrorIfIndexIsNonPositive(tc) TOriginal = table(1, 2, 3); - arrowRecordBatch = arrow.recordbatch(TOriginal); + arrowRecordBatch = arrow.recordBatch(TOriginal); fcn = @() arrowRecordBatch.column(-1); tc.verifyError(fcn, "arrow:badsubscript:NonPositive"); end @@ -203,7 +203,7 @@ function Schema(tc) [1; 2; 3], ... [true; false; true], ... VariableNames=["A", "B", "C"]); - recordBatch = arrow.recordbatch(t); + recordBatch = arrow.recordBatch(t); schema = recordBatch.Schema; tc.verifyEqual(schema.NumFields, int32(3)); tc.verifyEqual(schema.field(1).Type.ID, arrow.type.ID.String); @@ -218,7 +218,7 @@ function SchemaNoSetter(tc) % Verify that trying to set the value of the public Schema property % results in an error of type "MATLAB:class:SetProhibited". t = table([1; 2; 3]); - recordBatch = arrow.recordbatch(t); + recordBatch = arrow.recordBatch(t); tc.verifyError(@() setfield(recordBatch, "Schema", "Value"), ... "MATLAB:class:SetProhibited"); end