This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch branch-4.0
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-4.0 by this push:
     new b74370a94b0 branch-4.0: [fix] remove parse_id #57240 (#57330)
b74370a94b0 is described below

commit b74370a94b0cef5a8739fe3e08288534a8379edb
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Mon Oct 27 09:25:26 2025 +0800

    branch-4.0: [fix] remove parse_id #57240 (#57330)
    
    Cherry-picked from #57240
    
    Co-authored-by: admiring_xm <[email protected]>
---
 be/src/service/arrow_flight/flight_sql_service.cpp |  8 +++++++-
 be/src/util/uid_util.cpp                           | 23 ----------------------
 be/src/util/uid_util.h                             |  5 -----
 3 files changed, 7 insertions(+), 29 deletions(-)

diff --git a/be/src/service/arrow_flight/flight_sql_service.cpp 
b/be/src/service/arrow_flight/flight_sql_service.cpp
index f9f6cbf56ff..1c83b7b9954 100644
--- a/be/src/service/arrow_flight/flight_sql_service.cpp
+++ b/be/src/service/arrow_flight/flight_sql_service.cpp
@@ -49,8 +49,14 @@ private:
             return arrow::Status::Invalid(fmt::format("Malformed ticket, size: 
{}", fields.size()));
         }
 
+        std::vector<std::string> str = absl::StrSplit(fields[0], "-");
+        if (str.size() != 2) {
+            return arrow::Status::Invalid("Malformed ticket, missing query id: 
{}", fields[0]);
+        }
+
         TUniqueId queryid;
-        parse_id(fields[0], &queryid);
+        from_hex(&queryid.hi, str[0]);
+        from_hex(&queryid.lo, str[1]);
         TNetworkAddress result_addr;
         result_addr.hostname = fields[1];
         result_addr.port = std::stoi(fields[2]);
diff --git a/be/src/util/uid_util.cpp b/be/src/util/uid_util.cpp
index 4c947e017b8..17a621f35ac 100644
--- a/be/src/util/uid_util.cpp
+++ b/be/src/util/uid_util.cpp
@@ -59,29 +59,6 @@ std::string print_id(const PUniqueId& id) {
                        static_cast<uint64_t>(id.lo()));
 }
 
-bool parse_id(const std::string& s, TUniqueId* id) {
-    DCHECK(id != nullptr);
-
-    const char* hi_part = s.c_str();
-    char* colon = const_cast<char*>(strchr(hi_part, '-'));
-
-    if (colon == nullptr) {
-        return false;
-    }
-
-    const char* lo_part = colon + 1;
-    *colon = '\0';
-
-    char* error_hi = nullptr;
-    char* error_lo = nullptr;
-    id->hi = strtoul(hi_part, &error_hi, 16);
-    id->lo = strtoul(lo_part, &error_lo, 16);
-
-    bool valid = *error_hi == '\0' && *error_lo == '\0';
-    *colon = ':';
-    return valid;
-}
-
 bool TUniqueId::operator<(const TUniqueId& rhs) const {
     if (hi < rhs.hi) {
         return true;
diff --git a/be/src/util/uid_util.h b/be/src/util/uid_util.h
index 7f300c561b0..5da4b6a9db9 100644
--- a/be/src/util/uid_util.h
+++ b/be/src/util/uid_util.h
@@ -172,11 +172,6 @@ std::string print_id(const UniqueId& id);
 std::string print_id(const TUniqueId& id);
 std::string print_id(const PUniqueId& id);
 
-// Parse 's' into a TUniqueId object.  The format of s needs to be the output 
format
-// from PrintId.  (<hi_part>:<low_part>)
-// Returns true if parse succeeded.
-bool parse_id(const std::string& s, TUniqueId* id);
-
 } // namespace doris
 
 template <>


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

Reply via email to