Skip to content

Instantly share code, notes, and snippets.

@sakama
Created March 18, 2015 11:11
Show Gist options
  • Save sakama/d49773bc45eed971f8c4 to your computer and use it in GitHub Desktop.
Save sakama/d49773bc45eed971f8c4 to your computer and use it in GitHub Desktop.
BigQueryのJob実行/ステータスチェックのサンプル(Java)
Job job = bigQueryClient.jobs().get(<プロジェクトID>, jobRef.getJobId()).execute();
if (job.getStatus().getErrorResult() != null) {
log.warn(String.format("Job failed. job id:[%s] reason:[%s] status:[FAILED]", jobRef.getJobId(), job.getStatus().getErrorResult().getMessage()));
}
String jobStatus = job.getStatus().getState();
if (jobStatus.equals("DONE")) {
JobStatistics statistics = job.getStatistics();
log.info(String.format("Job statistics [%s]", statistics.getLoad()));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment