You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/04/02 02:34:25 UTC

[GitHub] [incubator-doris] cambyzju commented on a change in pull request #8765: [Feature] CSV import and export support header

cambyzju commented on a change in pull request #8765:
URL: https://github.com/apache/incubator-doris/pull/8765#discussion_r840996105



##########
File path: be/src/http/action/stream_load.cpp
##########
@@ -265,8 +266,14 @@ Status StreamLoadAction::_on_header(HttpRequest* http_req, StreamLoadContext* ct
     if (!http_req->header(HTTP_COMPRESS_TYPE).empty() && boost::iequals(http_req->header(HTTP_FORMAT_KEY), "JSON")) {
         return Status::InternalError("compress data of JSON format is not supported.");
     }
-    ctx->format =
-            parse_format(http_req->header(HTTP_FORMAT_KEY), http_req->header(HTTP_COMPRESS_TYPE));
+    std::string format_str = http_req->header(HTTP_FORMAT_KEY);
+    if (boost::iequals(format_str, BeConsts::CSV_WITH_NAMES) ||
+        boost::iequals(format_str, BeConsts::CSV_WITH_NAMES_AND_TYPES)) {
+        ctx->header_type = format_str;
+        //treat as CSV
+        format_str = "csv";

Review comment:
       "csv" also use an const define like CSV_WITH_NAMES?




-- 
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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org