qidaye commented on code in PR #37180:
URL: https://github.com/apache/doris/pull/37180#discussion_r1667905593


##########
be/src/exec/es/es_scan_reader.cpp:
##########
@@ -155,7 +183,9 @@ Status ESScanReader::get_next(bool* scan_eos, 
std::unique_ptr<ScrollParser>& scr
         if (_exactly_once) {
             return Status::OK();
         }
-        RETURN_IF_ERROR(_network_client.init(_next_scroll_url));
+        // we do not enable set_fail_on_error for ES http request to get more 
detail error messages
+        bool set_fail_on_error = false;
+        RETURN_IF_ERROR(_network_client.init(_next_scroll_url, 
set_fail_on_error));

Review Comment:
   When the http response of ES is not ok, it will provide a specific error 
hint detail in response body.
   That will help us pinpoint where the problem is.
   For example:
   ```
   curl localhost:29200/test2/_search?pretty -H'Content-Type:application/json' 
-d '{"match:}'
   {
     "error" : {
       "root_cause" : [
         {
           "type" : "json_e_o_f_exception",
           "reason" : "Unexpected end-of-input in field name\n at [Source: 
(org.elasticsearch.common.io.stream.ByteBufferStreamInput); line: 1, column: 
10]"
         }
       ],
       "type" : "json_e_o_f_exception",
       "reason" : "Unexpected end-of-input in field name\n at [Source: 
(org.elasticsearch.common.io.stream.ByteBufferStreamInput); line: 1, column: 
10]"
     },
     "status" : 400
   }
   ```
   We disable `set_fail_on_error` try to log the response body.



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