JNSimba commented on code in PR #180:
URL: 
https://github.com/apache/doris-spark-connector/pull/180#discussion_r1458239797


##########
spark-doris-connector/src/main/java/org/apache/doris/spark/load/DorisStreamLoad.java:
##########
@@ -222,13 +226,34 @@ public long load(Iterator<InternalRow> rows, StructType 
schema)
             String loadUrlStr = String.format(loadUrlPattern, getBackend(), 
db, tbl);
             this.loadUrlStr = loadUrlStr;
             HttpPut httpPut = getHttpPut(label, loadUrlStr, enable2PC, schema);
-            RecordBatchInputStream recodeBatchInputStream = new 
RecordBatchInputStream(RecordBatch.newBuilder(rows)
-                    .format(dataFormat)
-                    .sep(FIELD_DELIMITER)
-                    .delim(LINE_DELIMITER)
-                    .schema(schema)
-                    .addDoubleQuotes(addDoubleQuotes).build(), 
streamingPassthrough);
-            httpPut.setEntity(new InputStreamEntity(recodeBatchInputStream));
+
+            if(StringUtils.isNotEmpty(compressType)){
+                if("gz".equals(compressType.toLowerCase())){
+                    if(dataFormat.equals(DataFormat.CSV)){

Review Comment:
   Is it possible to judge directly this way?  
`if("gz".equals(compressType.toLowerCase()) && 
dataFormat.equals(DataFormat.CSV) )`



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