HappenLee commented on code in PR #34289:
URL: https://github.com/apache/doris/pull/34289#discussion_r1595249412


##########
be/src/vec/functions/function_jsonb.cpp:
##########
@@ -432,6 +431,151 @@ class FunctionJsonbExtract : public IFunction {
     }
 };
 
+class FunctionJsonbExtractPath : public IFunction {
+public:
+    static constexpr auto name = "json_exists_path";
+    static constexpr auto alias = "jsonb_exists_path";
+    using ColumnType = ColumnVector<uint8_t>;
+    using Container = typename ColumnType::Container;
+    static FunctionPtr create() { return 
std::make_shared<FunctionJsonbExtractPath>(); }
+    String get_name() const override { return name; }
+    bool is_variadic() const override { return true; }
+    size_t get_number_of_arguments() const override { return 2; }
+    DataTypePtr get_return_type_impl(const DataTypes& arguments) const 
override {
+        // it only needs to indicate existence and does not need to return 
nullable values.
+        return std::make_shared<DataTypeUInt8>();
+    }
+
+    Status execute_impl(FunctionContext* context, Block& block, const 
ColumnNumbers& arguments,
+                        size_t result, size_t input_rows_count) const override 
{
+        DCHECK_EQ(arguments.size(), 2);

Review Comment:
   remove the linecode, if function `is_variadic() ` false will do the chcek 
before exec



-- 
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: commits-unsubscr...@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to