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


##########
be/src/olap/single_replica_compaction.cpp:
##########
@@ -404,20 +404,7 @@ Status SingleReplicaCompaction::_download_files(DataDir* 
data_dir,
         return Status::InternalError("single compaction init curl failed");
     }
     for (auto& file_name : file_name_list) {
-        // The file name of the variant column with the inverted index 
contains %
-        // such as: 
020000000000003f624c4c322c568271060f9b5b274a4a95_0_10133@properties%2Emessage.idx
-        //  
{rowset_id}_{seg_num}_{index_id}_{variant_column_name}{%2E}{extracted_column_name}.idx
-        // We need to handle %, otherwise it will cause an HTTP 404 error.
-        // Because the percent ("%") character serves as the indicator for 
percent-encoded octets,
-        // it must be percent-encoded as "%25" for that octet to be used as 
data within a URI.
-        // https://datatracker.ietf.org/doc/html/rfc3986
-        auto output = std::unique_ptr<char, decltype(&curl_free)>(
-                curl_easy_escape(curl.get(), file_name.c_str(), 
file_name.length()), &curl_free);
-        if (!output) {
-            return Status::InternalError("escape file name failed, file 
name={}", file_name);
-        }
-        std::string encoded_filename(output.get());
-        auto remote_file_url = remote_url_prefix + encoded_filename;
+        auto remote_file_url = remote_url_prefix + file_name;

Review Comment:
   Do you mean do not escape here and do escape in HttpClient uniformly?



##########
be/src/http/http_client.cpp:
##########
@@ -290,4 +293,59 @@ Status HttpClient::execute_with_retry(int retry_times, int 
sleep_time,
     return status;
 }
 
+// http://example.com/page?param1=value1&param2=value+with+spaces#section
+Status HttpClient::_escape_url(const std::string& url, std::string* 
escaped_url) {

Review Comment:
   can you find a library function to do escape instead of manual code which is 
error prune.



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