Created
March 18, 2015 11:11
-
-
Save sakama/d49773bc45eed971f8c4 to your computer and use it in GitHub Desktop.
BigQueryのJob実行/ステータスチェックのサンプル(Java)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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