Skip to content

Commit

Permalink
fix: parentjobid in listjobs (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
Praful Makani authored and stephaniewang526 committed Dec 10, 2019
1 parent ec4a6eb commit 1b0b21b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Expand Up @@ -510,7 +510,8 @@ public Tuple<String, Iterable<Job>> listJobs(String projectId, Map<Option, ?> op
.setStateFilter(Option.STATE_FILTER.<List<String>>get(options))
.setMaxResults(Option.MAX_RESULTS.getLong(options))
.setPageToken(Option.PAGE_TOKEN.getString(options))
.setProjection(DEFAULT_PROJECTION);
.setProjection(DEFAULT_PROJECTION)
.setParentJobId(Option.PARENT_JOB_ID.getString(options));
if (Option.MIN_CREATION_TIME.getLong(options) != null) {
request.setMinCreationTime(BigInteger.valueOf(Option.MIN_CREATION_TIME.getLong(options)));
}
Expand Down
Expand Up @@ -1271,7 +1271,6 @@ public void testQuery() throws InterruptedException {

@Test
public void testScriptStatistics() throws InterruptedException {
long currentTime = System.currentTimeMillis();
String script =
"-- Declare a variable to hold names as an array.\n"
+ "DECLARE top_names ARRAY<STRING>;\n"
Expand All @@ -1295,9 +1294,7 @@ public void testScriptStatistics() throws InterruptedException {
JobStatistics jobStatistics = info.getStatistics();
String parentJobId = info.getJobId().getJob();
assertEquals(2, jobStatistics.getNumChildJobs().longValue());
Page<Job> page =
bigquery.listJobs(
JobListOption.parentJobId(parentJobId), JobListOption.minCreationTime(currentTime));
Page<Job> page = bigquery.listJobs(JobListOption.parentJobId(parentJobId));
for (Job job : page.iterateAll()) {
JobStatistics.ScriptStatistics scriptStatistics = job.getStatistics().getScriptStatistics();
if (scriptStatistics != null) {
Expand Down

0 comments on commit 1b0b21b

Please sign in to comment.