gavinchou commented on code in PR #52671:
URL: https://github.com/apache/doris/pull/52671#discussion_r2179914228


##########
cloud/src/meta-store/document_message.cpp:
##########
@@ -0,0 +1,369 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#include "meta-store/document_message.h"
+
+#include <gen_cpp/olap_file.pb.h>
+#include <glog/logging.h>
+
+#include <cstdint>
+#include <memory>
+
+#include "common/config.h"
+#include "common/util.h"
+#include "meta-store/codec.h"
+#include "meta-store/txn_kv.h"
+#include "meta-store/txn_kv_error.h"
+
+namespace doris::cloud {
+namespace details {
+
+static std::string lexical_next(std::string_view str) {
+    return std::string(str) + '\0';
+}
+
+static std::string lexical_end(std::string_view str) {
+    // Since '\xff' is not used in the key encoding, we can safely use it as a 
sentinel
+    // to indicate the end of a key range.
+    return std::string(str) + '\xff';
+}
+
+void document_delete_single(Transaction* txn, std::string_view key) {
+    txn->remove(key);
+}
+
+void document_delete_range(Transaction* txn, std::string_view prefix) {
+    txn->remove(prefix, lexical_end(prefix));
+}
+
+} // namespace details
+
+static bool is_splitable_field(const google::protobuf::FieldDescriptor* field) 
{

Review Comment:
   why do we have this restriction?  can we relax this check in the future to 
support splitting non-repeated fields 
   e.g. split a large single non-repeated field 
   ```
   message M1 {
     ...
     M2 non_repeated_large_field;
     ...
   }
   ```



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