Skip to content

Handle different data types #8

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

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open

Conversation

Hind-M
Copy link
Member

@Hind-M Hind-M commented Jul 28, 2025

No description provided.

REQUIRE_NE(arrow_array_deserialized_ar, nullptr);
compare_arrow_arrays(*arrow_array_ar, *arrow_array_deserialized_ar);

// compare_values<T>(ar, deserialized_ar);
Copy link
Member Author

@Hind-M Hind-M Jul 30, 2025

Choose a reason for hiding this comment

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

This is failing on windows, as CHECK_EQ(ar, deserialized_ar);.
cf. error here.
We should either fix this upstream in sparrow (if indeed something is missing) or at least try and use comparison functions from sparrow (to be exposed if not already).

Note that it wasn't the case before this PR, i.e CHECK_EQ(ar, deserialized_ar); was not failing on windows when building (tests are commented out there for now), but maybe this was some latent issue that was exposed when adding more tests and changing the structure?...

Copy link
Member

Choose a reason for hiding this comment

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

This looks like a compiler issue, this operator is defined ins sparrow

Copy link
Member Author

Choose a reason for hiding this comment

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

NOTE:
We should test again - with this PR merged - using sparrow build from source (and then directly from conda-forge after releasing next version and confirming this fixes the issue).

@Hind-M Hind-M marked this pull request as ready for review July 30, 2025 12:23
// - Correctly populating the Flatbuffer-defined metadata for both messages.

// Create a mutable copy of the input array to allow moving its internal structures
sparrow::primitive_array<T> mutable_arr = arr;
Copy link
Member

Choose a reason for hiding this comment

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

Should we also provide a destructive version of serialize to avoid this copy? I.e. something like

template <typename T>
std::vector<uint8_t> serialize_primitive_array(sparrow::primitive_array<T>&& arr)

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually I decided to use extract_arrow_structures before handling the metadata (which we need to get using the primitive_array input argument through arr.metadata() and not through arrow_schema to get the right format).

If we add the overload you suggested, we would need to deep copy the metadata, and that's not ideal.
Instead I'm using now get_arrow_structures to avoid copying...
But I had to remove the const from the primitive_array input argument because of errors due to get_arrow_structures not taking a const.

=> Should we provide an overload for const in sparrow for get_arrow_structures knowing that it's calling get_arrow_proxy, and that can take either a const or a non-const ARRAY?

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