You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/01/16 14:27:33 UTC

[GitHub] [arrow] dhruv9vats commented on a change in pull request #12162: ARROW-15089: [C++][Compute] Implement kernel to lookup a MapArray item for a given key

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



##########
File path: cpp/src/arrow/compute/api_scalar.h
##########
@@ -470,6 +470,30 @@ class ARROW_EXPORT RandomOptions : public FunctionOptions {
   uint64_t seed;
 };
 
+/// Options for map_array_lookup function
+class ARROW_EXPORT MapArrayLookupOptions : public FunctionOptions {
+ public:
+  enum Occurence {
+    /// Return the first matching value
+    First,
+    /// Return the last matching value
+    Last,
+    /// Return all matching values
+    All
+  };
+
+  MapArrayLookupOptions(std::shared_ptr<Scalar> query_key, Occurence occurence = All);
+  MapArrayLookupOptions();
+
+  constexpr static char const kTypeName[] = "MapArrayLookupOptions";
+
+  /// The key to lookup in the map
+  std::shared_ptr<Scalar> query_key;

Review comment:
       If `query_key` should be a comparable type, what should be its `DataType/Shape` here?




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