You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "pitrou (via GitHub)" <gi...@apache.org> on 2023/08/16 14:52:51 UTC

[GitHub] [arrow] pitrou commented on a diff in pull request #37174: GH-37173: [C++][Format] C-export/import Run-End Encoded Arrays

pitrou commented on code in PR #37174:
URL: https://github.com/apache/arrow/pull/37174#discussion_r1296026622


##########
cpp/src/arrow/c/bridge_test.cc:
##########
@@ -31,6 +31,7 @@
 #include "arrow/c/bridge.h"
 #include "arrow/c/helpers.h"
 #include "arrow/c/util_internal.h"
+#include "arrow/compute/api_vector.h"

Review Comment:
   I don't think we depend on ARROW_COMPUTE currently for these tests. We should at least guard against it (use a `#ifdef ARROW_COMPUTE` and skip the test otherwise).



##########
cpp/src/arrow/c/bridge_test.cc:
##########
@@ -1872,6 +1942,13 @@ TEST_F(TestSchemaImport, Map) {
   CheckImport(expected);
 }
 
+TEST_F(TestSchemaImport, RunEndEncoded) {
+  FillPrimitive(AddChild(), "s", "run_ends");
+  FillPrimitive(AddChild(), "I", "values");
+  FillRunEndEncoded("+r");
+  CheckImport(run_end_encoded(int16(), uint32()));

Review Comment:
   What happens if the first child is not one of the allowed run ends types? Can you add a test for it?
   (see e.g. the `DictionaryError` test below)



##########
cpp/src/arrow/c/bridge_test.cc:
##########
@@ -31,6 +31,7 @@
 #include "arrow/c/bridge.h"
 #include "arrow/c/helpers.h"
 #include "arrow/c/util_internal.h"
+#include "arrow/compute/api_vector.h"

Review Comment:
   Or instead we could have a `REEArrayFromJSON` helper in https://github.com/apache/arrow/blob/main/cpp/src/arrow/ipc/json_simple.h that, just like `DictArrayFromJSON`, would take separate strings for run ends and values.



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org