js8544 commented on code in PR #36891:
URL: https://github.com/apache/arrow/pull/36891#discussion_r1308400955


##########
cpp/src/arrow/compute/kernels/scalar_nested.cc:
##########
@@ -819,6 +832,378 @@ const FunctionDoc map_lookup_doc{
     "MapLookupOptions",
     /*options_required=*/true};
 
+struct AdjoinAsListState : public KernelState {
+  explicit AdjoinAsListState(std::shared_ptr<DataType> list_type,
+                             std::shared_ptr<DataType> input_type)
+      : list_type(std::move(list_type)), input_type(std::move(input_type)) {}
+
+  static Result<std::unique_ptr<KernelState>> Init(KernelContext* ctx,
+                                                   const KernelInitArgs& args) 
{
+    auto options = static_cast<const AdjoinAsListOptions*>(args.options);
+    if (!options) {
+      return Status::Invalid(
+          "Attempted to initialize KernelState from null FunctionOptions");
+    }
+
+    // Make sure input args have the same type
+    if (args.inputs.empty()) {
+      return Status::Invalid("AdjoinAsList requires at least one input 
argument");
+    }
+
+    auto input_type = args.inputs[0];
+    if (std::any_of(args.inputs.begin() + 1, args.inputs.end(),
+                    [&input_type](const auto& arg) { return arg != input_type; 
})) {
+      return Status::Invalid(

Review Comment:
   Done



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