paleolimbot commented on code in PR #578:
URL: https://github.com/apache/arrow-nanoarrow/pull/578#discussion_r1712066602


##########
src/nanoarrow/nanoarrow.h:
##########
@@ -1064,6 +1065,19 @@ ArrowErrorCode ArrowArrayViewValidate(struct 
ArrowArrayView* array_view,
                                       enum ArrowValidationLevel 
validation_level,
                                       struct ArrowError* error);
 
+/// \brief Compare two ArrowArrayView objects for equality
+///
+/// Given two ArrowArrayView instances, place either 0 (not equal) and
+/// 1 (equal) at the address pointed to by out. If the comparison determines
+/// that actual and expected are not equal, a reason will be communicated via
+/// error if error is non-NULL.
+///
+/// Returns NANOARROW_OK if the comparison completed successfully.
+ArrowErrorCode ArrowArrayViewCompare(const struct ArrowArrayView* actual,
+                                     const struct ArrowArrayView* expected,
+                                     enum ArrowCompareLevel level, int* out,
+                                     struct ArrowError* error);

Review Comment:
   I agree that it's slightly off kilter usage of the `ArrowError`, but 
inventing another type is also not great (e.g., forces users to make *another* 
utility to convert it to whatever they're using to represent a string, forces 
them to stack allocate *another* object when they probably already have an 
`ArrowError` around somewhere). We can also change this if it's too confusing 
or if a better alternative becomes available.
   
   Also, I updated this so that all string generation happens on the error 
return pathway (so no dynamic allocations happen at all, and all string 
generation uses the caller-allocated `ArrowError`, which can be `NULL` to avoid 
string generation at all).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to