Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: parentjobid in listjobs #20

Merged
merged 1 commit into from Dec 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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