lidavidm commented on a change in pull request #12162:
URL: https://github.com/apache/arrow/pull/12162#discussion_r786084635



##########
File path: cpp/src/arrow/compute/kernels/scalar_nested_test.cc
##########
@@ -225,6 +225,30 @@ TEST(TestScalarNested, StructField) {
   }
 }
 
+TEST(TestScalarNested, MapArrayLookup) {
+  MapArrayLookupOptions foo_all(MakeScalar("foo"), MapArrayLookupOptions::All);
+  MapArrayLookupOptions foo_first(MakeScalar("foo"), 
MapArrayLookupOptions::First);
+  auto type = map(utf8(), int32());
+
+  auto keys = ArrayFromJSON(utf8(), R"([
+    "foo", "bar", "hello", "foo", "lesgo", "whatnow",
+    "nothing", "hat", "foo", "sorry", "dip", "foo"
+  ])");
+  auto items = ArrayFromJSON(int16(), R"([
+    99,    1,    2,  3,  5,    8,
+    null, null, 101,  1,  null, 22
+  ])");
+  auto offsets = ArrayFromJSON(int32(), "[0, 6, 6, 12, 
12]")->data()->buffers[1];
+  auto null_bitmap = ArrayFromJSON(boolean(), "[1, 0, 1, 
1]")->data()->buffers[1];
+
+  MapArray map_array(type, 4, offsets, keys, items, null_bitmap, 1, 0);
+
+  CheckScalarNonRecursive("map_array_lookup", {map_array},

Review comment:
       CheckScalar requires that you implement the Scalar case as well but 
let's just get this to work first.




-- 
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