Skip to content
Permalink
Browse files
fix: parentjobid in listjobs (#20)
  • Loading branch information
Praful Makani authored and stephaniewang526 committed Dec 10, 2019
1 parent ec4a6eb commit 1b0b21b7dae97507bfcb449ed78fabff636747f5
@@ -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)));
}
@@ -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"
@@ -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) {

0 comments on commit 1b0b21b

Please sign in to comment.