Add notes in java stream load sample to avoid wrong use of stream load (#2802)

This commit is contained in:
caiconghui
2020-01-19 23:22:17 +08:00
committed by ZHAO Chun
parent 634928e4d0
commit 47a7df17ec

View File

@ -96,6 +96,8 @@ import java.nio.charset.StandardCharsets;
* "LoadBytes": 0,
* "LoadTimeMs": 0
* }
* 3 when the response statusCode is 200, that doesn't mean your stream load is ok, there may be still
* some stream problem unless you see the output with 'ok' message
*/
public class DorisStreamLoad {
private final static String DORIS_HOST = "xxx.com";
@ -137,6 +139,8 @@ public class DorisStreamLoad {
loadResult = EntityUtils.toString(response.getEntity());
}
final int statusCode = response.getStatusLine().getStatusCode();
// statusCode 200 just indicates that doris be service is ok, not stream load
// you should see the output content to find whether stream load is success
if (statusCode != 200) {
throw new IOException(
String.format("Stream load failed, statusCode=%s load result=%s", statusCode, loadResult));