Response is different between google list jobs API and its corresponding java library

Viewed 43

I am testing list jobs API from google side and want to use it in my java application, so i am using the corresponding java maven library

    public void listJobs() {
    try {
        // Initialize client that will be used to send requests. This client only needs to be created
        // once, and can be reused for multiple requests.
        BigQuery bigquery = getBigQuery();
        long time = 1653340103419L;
        Page<Job> jobs = bigquery.listJobs(BigQuery.JobListOption.minCreationTime(1653264000000L),
                BigQuery.JobListOption.maxCreationTime(1653350399000L),
                BigQuery.JobListOption.allUsers(), BigQuery.JobListOption.pageSize(100));
        if (jobs == null) {
            System.out.println("Dataset does not contain any jobs.");
            return;
        }
        jobs.getValues().forEach(job -> System.out.println("Success! Job ID: " + job.getJobId()));
    } catch (BigQueryException | IOException e) {
        System.out.println("Jobs not listed in dataset due to error: \n" + e.toString());
    }
}

But the response is different from the web API which i have given above, suppose if i given the minCreationTime as currentTimeStamp value, after this i had executed some jobs in bigquery console, then they will show up immediately in web API but they are not shown in java maven side, there is factor of some latency after some 3-4 hours those jobs are coming on maven library side.

JAVA Library calling same API

But ultimately this library is calling the same API, then what is the thing i am missing, my desired end result is simple, i want to poll the jobs repeatedly using this library after a particular time stamp that is by using minCreationTime parameter, that is happening exactly in web API but not on library side, i have inspected the web API to check whether it is converting the given timestamp or not. But it is sending the exact parameters i have given. Where exactly i am missing, why there is difference in output ?

0 Answers
Related