Skip to content

Commit 33a3c96

Browse files
committed
1 parent 532ddee commit 33a3c96

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

src/main/java/com/treasuredata/client/TDClient.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -748,10 +748,18 @@ public TDJob jobInfo(String jobId)
748748
@Override
749749
public <Result> Result jobResult(String jobId, TDResultFormat format, Function<InputStream, Result> resultStreamHandler)
750750
throws TDClientException
751+
{
752+
return jobResult(jobId, format, false, resultStreamHandler);
753+
}
754+
755+
@Override
756+
public <Result> Result jobResult(String jobId, TDResultFormat format, boolean includeHeader, Function<InputStream, Result> resultStreamHandler)
757+
throws TDClientException
751758
{
752759
TDApiRequest request = TDApiRequest.Builder
753760
.GET(buildUrl("/v3/job/result", jobId))
754761
.addQueryParam("format", format.getName())
762+
.addQueryParam("header", Boolean.toString(includeHeader))
755763
.build();
756764
return httpClient.<Result>call(request, apiKeyCache, resultStreamHandler);
757765
}

src/main/java/com/treasuredata/client/TDClientApi.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,20 @@ default <Result> Result jobResult(String jobId, TDResultFormat format, com.googl
281281
*/
282282
<Result> Result jobResult(String jobId, TDResultFormat format, Function<InputStream, Result> resultStreamHandler);
283283

284+
/**
285+
* Open an input stream to retrieve the job result.
286+
* The input stream will be closed after this method
287+
*
288+
* You will receive an empty stream if the query has not finished yet.
289+
*
290+
* @param jobId
291+
* @param format
292+
* @param resultStreamHandler
293+
* @param includeHeader
294+
* @return
295+
*/
296+
<Result> Result jobResult(String jobId, TDResultFormat format, boolean includeHeader, Function<InputStream, Result> resultStreamHandler);
297+
284298
// bulk import API
285299
List<TDBulkImportSession> listBulkImportSessions();
286300

0 commit comments

Comments
 (0)