xiaokang commented on code in PR #24938:
URL: https://github.com/apache/doris/pull/24938#discussion_r1566595978


##########
be/src/vec/functions/function_jsonb.cpp:
##########
@@ -1287,6 +1289,157 @@ struct JsonbContainsAndPathImpl {
     }
 };
 
+template <typename Impl>
+class FunctionJsonbContainsPath : public IFunction {
+public:
+    static constexpr auto name = "json_contains_path";
+    String get_name() const override { return name; }
+    static FunctionPtr create() { return 
std::make_shared<FunctionJsonbContainsPath<Impl>>(); }
+
+    DataTypePtr get_return_type_impl(const DataTypes& arguments) const 
override {
+        return make_nullable(std::make_shared<DataTypeUInt8>());
+    }
+
+    bool is_variadic() const override { return true; }
+
+    DataTypes get_variadic_argument_types_impl() const override {
+        if constexpr (vectorized::HasGetVariadicArgumentTypesImpl<Impl>) {
+            return Impl::get_variadic_argument_types_impl();
+        } else {
+            return {};
+        }
+    }
+    size_t get_number_of_arguments() const override {
+        return 0; // variadic
+    }
+
+    bool use_default_implementation_for_nulls() const override { return false; 
}
+
+    bool use_default_implementation_for_constants() const override { return 
false; }
+
+    Status execute_impl(FunctionContext* context, Block& block, const 
ColumnNumbers& arguments,
+                        size_t result, size_t input_rows_count) const override 
{
+        return Impl::execute_impl(context, block, arguments, result, 
input_rows_count);
+    }
+};
+
+struct JsonbContainsPathUtil {
+    static Status jsonb_contains_path_execute(FunctionContext* context, Block& 
block,

Review Comment:
   JsonbContainsPathUtil::jsonb_contains_path_execute is only used by 
JsonbContainsPathImpl, why add a new class JsonbContainsPathUtil?



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to