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


##########
be/src/runtime/jsonb_value.h:
##########
@@ -51,75 +70,30 @@ struct JsonBinaryValue {
 
     size_t size() const { return len; }
 
-    void replace(const char* ptr, int len) {
-        this->ptr = ptr;
-        this->len = len;
-    }
-
-    bool operator==(const JsonBinaryValue& other) const {
-        throw Exception(Status::FatalError("comparing between JsonBinaryValue 
is not supported"));
-    }
-    // !=
-    bool ne(const JsonBinaryValue& other) const {
-        throw Exception(Status::FatalError("comparing between JsonBinaryValue 
is not supported"));
-    }
-    // <=
-    bool le(const JsonBinaryValue& other) const {
-        throw Exception(Status::FatalError("comparing between JsonBinaryValue 
is not supported"));
-    }
-    // >=
-    bool ge(const JsonBinaryValue& other) const {
-        throw Exception(Status::FatalError("comparing between JsonBinaryValue 
is not supported"));
-    }
-    // <
-    bool lt(const JsonBinaryValue& other) const {
-        throw Exception(Status::FatalError("comparing between JsonBinaryValue 
is not supported"));
-    }
-    // >
-    bool gt(const JsonBinaryValue& other) const {
-        throw Exception(Status::FatalError("comparing between JsonBinaryValue 
is not supported"));
-    }
-
-    bool operator!=(const JsonBinaryValue& other) const {
-        throw Exception(Status::FatalError("comparing between JsonBinaryValue 
is not supported"));
-    }
-
-    bool operator<=(const JsonBinaryValue& other) const {
-        throw Exception(Status::FatalError("comparing between JsonBinaryValue 
is not supported"));
-    }
-
-    bool operator>=(const JsonBinaryValue& other) const {
-        throw Exception(Status::FatalError("comparing between JsonBinaryValue 
is not supported"));
-    }
-
-    bool operator<(const JsonBinaryValue& other) const {
-        throw Exception(Status::FatalError("comparing between JsonBinaryValue 
is not supported"));
-    }
-
-    bool operator>(const JsonBinaryValue& other) const {
-        throw Exception(Status::FatalError("comparing between JsonBinaryValue 
is not supported"));
+    Status from_json_string(const char* s, size_t length) {
+        // reset all fields
+        ptr = nullptr;
+        len = 0;
+        writer.reset();

Review Comment:
   if `JsonbParser::parse` return error status, seems we lose the origin ptr 
and len. it's right thing? seems we do not need to reset, use lint 79-80 to do 
set is ok?



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