Skip to content
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

fix: IPC streams did not include RecordBatch headers #582

Merged
merged 1 commit into from
Aug 12, 2024

Conversation

bkietz
Copy link
Member

@bkietz bkietz commented Aug 12, 2024

@bkietz bkietz force-pushed the finalize-record-batch-headers branch from 914a2cc to 7f32b76 Compare August 12, 2024 18:27
Copy link
Member

@paleolimbot paleolimbot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

I am not sure that this is actually running the nanoarrow read tests against your encoder (although after this PR your encoder is getting checked via Arrow C++). It may be worth checking docker compose run --rm coverage (a quick check on main suggests that most of writer.c is never run during tests, although this may be the coverage setup).

Comment on lines 264 to 287
ASSERT_EQ(ReadArrowArrayStreamIPC(dir_prefix, roundtripped_schema.get(),
&roundtripped_arrays, &error),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this line refer to the buffer roundtripped? (i.e., maybe the previous test was just reading from the file and not the roundtripped data?)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you're right. FWIW after reading from roundtripped instead of the file the tests still pass.

src/nanoarrow/ipc/encoder.c Outdated Show resolved Hide resolved
int32_t header[] = {-1, ArrowIpcSystemEndianness() == NANOARROW_IPC_ENDIANNESS_BIG
? (int32_t)bswap32((uint32_t)size)
: (int32_t)size};
return ArrowBufferAppend(out, &header, sizeof(header));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be header or &header?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

header works because it's an array and arrays are convertible to pointer. I prefer &header because that would be correct even if header were not an array

@paleolimbot
Copy link
Member

although this may be the coverage setup

(files_test is not included in the coverage setup, which might have been intentional since those are closer to integration tests than unit tests)

@bkietz bkietz force-pushed the finalize-record-batch-headers branch from 7f32b76 to 962cfbd Compare August 12, 2024 19:29
@bkietz bkietz merged commit 16f4306 into apache:main Aug 12, 2024
34 checks passed
@bkietz bkietz deleted the finalize-record-batch-headers branch August 12, 2024 21:12
@paleolimbot paleolimbot added this to the nanoarrow 0.6.0 milestone Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants