-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GH-38211: [MATLAB] Add support for creating an empty arrow.tabular.RecordBatch by calling arrow.recordBatch with no input arguments #38274
Conversation
Thanks for opening a pull request! If this is not a minor PR. Could you open an issue for this pull request on GitHub? https://github.com/apache/arrow/issues/new/choose Opening GitHub issues ahead of time contributes to the Openness of the Apache Arrow project. Then could you also rename the pull request title in the following format?
or
In the case of PARQUET issues on JIRA the title also supports:
See also: |
@Divyansh200102 - thanks very much for the pull request! Just a few small comments:
GH-38211: [MATLAB] Add support for creating an empty Please don't hesitate to let me know if you have any questions. Thank you! |
@@ -16,7 +16,7 @@ | |||
% permissions and limitations under the License. | |||
function rb = recordBatch(T) | |||
arguments | |||
T table | |||
T table= table.empty(0, 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Could you add
{istable}
here?
Example:
arrow/matlab/src/matlab/+arrow/table.m
Line 21 in cbf1bb5
matlabTable {istable} = table.empty(0, 0) |
This will ensure an error is thrown if non-table
inputs are provided to the arrow.recordBatch
function.
- For clarity (and consistency with the
arrow.table
function), perhaps we should renameT
tomatlabTable
?
hi, @kevingurney i am trying to setup the project locally using the docker-compose.yml file by using the command "docker compose up -d" but this is error is showing up (Error response from daemon: manifest for amd64/maven:3.5.4-eclipse-temurin-8 not found: manifest unknown: manifest unknown) i think this version of amd64/maven is not in the registry .i tried pulling manually as well but still nothing can you help me out to solve this?i checked docker hub as well but this version of amd64/maven is not there. |
@Divyansh200102 - generally speaking, adding code to the MATLAB interface shouldn't require using Looking through the eclipse-java:
# Usage:
# docker-compose build eclipse-java
# docker-compose run eclipse-java
# Parameters:
# MAVEN: 3.9.4
# JDK: 17, 21
image: ${ARCH}/maven:${MAVEN}-eclipse-temurin-${JDK}
shm_size: *shm-size
volumes: *java-volumes
command: *java-command It looks like the values of the Perhaps you could try modifying these values to You could also try overriding these variables directly on the command line, like:
Someone who contributes to the Docker / Java parts of the project like @danepitkin might be able to offer more guidance here. Maybe the default values in the |
@Divyansh200102 - do you need any further assistance with updating this pull request? |
Please check if it's fine now @kevingurney |
@@ -16,7 +16,7 @@ | |||
% permissions and limitations under the License. | |||
function rb = recordBatch(T) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you renamed the first input argument to matlabTable
in the arguments
block, you will also need to rename T
to matlabTable
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, the rest of the code in this function needs to be updated to use matlabTable
instead of T
. For example:
columnNames = string(T.Properties.VariableNames);
would become:
columnNames = string(matlabTable.Properties.VariableNames);
|
||
% Create an empty expected RecordBatch | ||
schema = arrow.schema(); | ||
expected = arrow.tabular.RecordBatch(schema, {}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The arrow.tabular.RecordBatch
constructor does not support any syntax that accepts an arrow.tabular.Schema
and an empty cell
array (i.e. {}
).
|
||
|
||
function testArrowRecordBatchNoArgs() | ||
% Call arrow.recordBatch with no arguments |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The indentation of the code in this test if off.
@@ -494,9 +494,23 @@ function TestIsEqualFalse(testCase) | |||
% Call isequal with more than two arguments | |||
testCase.verifyFalse(isequal(rb1, rb2, rb3, rb4)); | |||
end | |||
|
|||
|
|||
function testArrowRecordBatchNoArgs() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please use UpperCamelCase
for the test name to be consistent with the rest of the test cases in this file? i.e. TestArrowRecordBatchNoArgs
instead of testArrowRecordBatchNoArgs
.
expected = arrow.tabular.RecordBatch(schema, {}); | ||
|
||
% Use isequal to check if the actual and expected are equal | ||
if isequal(expected, actual) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should be able to just use testCase.verifyEqual(actual, expected)
here.
schema = arrow.schema(); | ||
expected = arrow.tabular.RecordBatch(schema, {}); | ||
|
||
% Use isequal to check if the actual and expected are equal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this comment could be removed.
@Divyansh200102 - I added some more code review feedback. Currently, the MATLAB CI workflow is failing. We need to ensure that all of the appropriate test cases are passing as expected. |
Hey, thanks for reporting the |
Can you tell me how do I do this? @kevingurney .I am a beginner.Any documents I need to refer to ? |
Hey @Divyansh200102, you can click on Then, look through the logs and expand the output to view the errors that are reported. You will need to make sure your code passes the test cases successfully. It looks like a reviewer has already left feedback that you should review as well. Maybe they pointed out some of the bugs in the code that are causing issues? |
Thank you @danepitkin for explaining how to investigate CI failures. @Divyansh200102 - as @danepitkin pointed out, I did provide code review feedback that may help provide guidance on how to address some of the CI failures. If you have specific questions about any of the comments, please let me know. |
Thanks for the response @kevingurney and @danepitkin .I will let you know @kevingurney if I need any help |
arrow.tabular.RecordBatch
by callingarrow.recordBatch
with no input arguments #38211